Skip to content

Only pull relevant keys for caching FlowContext#193

Draft
NeejWeej wants to merge 2 commits intonk/auto_deps_auto_callable_modelfrom
nk/flow_model_semantic_v2
Draft

Only pull relevant keys for caching FlowContext#193
NeejWeej wants to merge 2 commits intonk/auto_deps_auto_callable_modelfrom
nk/flow_model_semantic_v2

Conversation

@NeejWeej
Copy link
Copy Markdown
Collaborator

Description

In the new functional syntax, @Flow.model decorated functions specify what arguments they pull from the context, but at runtime, a large "bag of context" FlowContext is provided. For correctness of the cache, this PR restricts the context arguments used for caching to be only the ones requested by each model (and it's dependencies).

This helps avoid the issue where an unrelated context parameter inside a FlowContext is used to cache a model.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup
  • CI / build configuration
  • Other (describe below)

Checklist

  • Linting passes (make lint)
  • Tests pass (make test)
  • New tests added for new functionality
  • Documentation updated (if applicable)
  • Changelog / version bump (if applicable)

@NeejWeej NeejWeej changed the base branch from main to nk/auto_deps_auto_callable_model April 13, 2026 16:17
@github-actions
Copy link
Copy Markdown
Contributor

Test Results

740 tests  +100   738 ✅ +100   1m 52s ⏱️ +11s
  1 suites ±  0     2 💤 ±  0 
  1 files   ±  0     0 ❌ ±  0 

Results for commit 7e49dca. ± Comparison against base commit cde4fbb.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 87.33624% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.11%. Comparing base (c479bb5) to head (7e49dca).

Files with missing lines Patch % Lines
ccflow/evaluators/common.py 81.73% 15 Missing and 6 partials ⚠️
ccflow/flow_model.py 66.66% 3 Missing and 3 partials ⚠️
ccflow/tests/test_flow_model.py 97.91% 2 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           nk/auto_deps_auto_callable_model     #193      +/-   ##
====================================================================
+ Coverage                             95.04%   95.11%   +0.06%     
====================================================================
  Files                                   144      144              
  Lines                                 11410    11619     +209     
  Branches                                737      754      +17     
====================================================================
+ Hits                                  10845    11051     +206     
- Misses                                  399      400       +1     
- Partials                                166      168       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NeejWeej NeejWeej marked this pull request as draft April 13, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant