Repository navigation
refactor(flows): run capabilities take the turn origin from the run's context (#7801) - #7919
Conversation
…ctors Capability constructors now take the memory adapter explicitly instead of reaching for it internally, so each cap receives its dependencies from the caller. This keeps construction consistent across the agent, code, http, ops, tier, and tool caps and makes the wiring in memory_adapter explicit. Auto-committed-on: dragonfly
Flow execution and resume now take a dispatch context so that downstream operations can access runtime state consistently. The memory adapter tests were updated to match the new signatures. Auto-committed-on: dragonfly
Adds unit tests covering the tinyflows memory adapter, exercising its read and write paths against the in-memory store. The tests were missing from the module and are needed to guard the adapter's behaviour as the flow engine evolves. Auto-committed-on: dragonfly
Adds coverage for the tinyflows memory adapter, exercising the conversion between flow memory and the core memory store so that regressions in that boundary are caught by the test suite. Auto-committed-on: dragonfly
Reformat several tinyflows capability files and add a test helper that builds a memory adapter bound to a run's turn origin. The tests now set the adapter context explicitly so flow scoping is exercised without relying on ambient origin state. Auto-committed-on: dragonfly
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 12
Comment |
Tiny Sweeper reviewTiny Sweeper reviewed this change across 5 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below. State: Incomplete Review snapshot
Completeness: Incomplete FeaturesNone identified with supported citations. TestsNo supported feature-to-test mapping was produced. Test execution is not inferred.
FindingsNo active actionable findings. Could not review: crates/openhuman-core/src/flows/tinyflows/caps/code.rs, crates/openhuman-core/src/flows/tinyflows/caps/tools/composio.rs, crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs, crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs, tinysweeper/tests Before merge
How this fits togetherflowchart LR
n0["DispatchCtx<br/>changed"]:::changed
n1["run_flow_body_inner<br/>changed"]:::changed
n2["flows_resume<br/>changed"]:::changed
n3["OpenHumanAgentRunner<br/>changed"]:::changed
n4["OpenHumanCode<br/>changed"]:::changed
n5["OpenHumanHttp<br/>changed"]:::changed
n6["build_capabilities<br/>changed"]:::changed
n7["ComposioToolBackend<br/>changed"]:::changed
n8["NativeToolBackend<br/>changed"]:::changed
n9["Result"]:::impacted
n10["with_origin"]:::impacted
n11["ToolBackend"]:::impacted
n12["ToolCallCtx"]:::impacted
n13["ApprovalTurnContext"]:::impacted
n1 -->|uses| n0
n1 -->|calls| n6
n1 -->|uses| n9
n1 -->|calls| n10
n2 -->|uses| n0
n2 -->|calls| n6
n2 -->|uses| n9
n2 -->|calls| n10
n3 -->|uses| n0
n3 -->|uses| n13
n4 -->|uses| n13
n5 -->|uses| n0
n5 -->|uses| n13
n6 -->|uses| n0
n6 -->|uses| n3
n6 -->|uses| n4
n6 -->|uses| n5
n6 -->|uses| n13
n7 -->|implements| n11
n8 -->|implements| n11
n11 -->|uses| n9
n11 -->|uses| n12
n12 -->|uses| n0
n12 -->|uses| n13
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: crates/openhuman-core/src/flows/tinyflows/caps/code.rs, crates/openhuman-core/src/flows/tinyflows/caps/tools/composio.rs, crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs, crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs, tinysweeper/tests.
$0.0058 · 568,223 in / 28,992 out · 8,704 cached (2%) · ladder/vectors-oai3, glm-5.3-flash, deepseek-v4.1-flash · 517 embedded
critique: $0.0030 · 316,996 in / 14,782 out · 8,704 cached (3%) · glm-5.3-flash, deepseek-v4.1-flash
security: $0.0022 · 220,550 in / 7,256 out · 0 cached (0%) · glm-5.3-flash
tests: $0.0002 · 16,739 in / 245 out · 0 cached (0%) · glm-5.3-flash
description: $0.0001 · 8,215 in / 83 out · 0 cached (0%) · glm-5.3-flash
Summary
A saved flow run now acts under a context that carries its own trusted Workflow origin (new DispatchCtx::with_turn_origin), built in flows_run and flows_resume. gate_call_for_tier, the nested agent runner and the memory adapter read the origin from that context instead of DispatchCtx::ambient_turn().
Total production DispatchCtx::ambient* + load_config_with_timeout( sites: 44 -> 41 (ambient 39 -> 36, load_config_with_timeout 5 -> 5).
Tests
Gates
cargo check (--no-default-features, e2e-test-support all-targets, app), openhuman-core bin build, rust:layout, check-agent-runtime-boundary, check-saas-ambient, check-process-statics all pass. Full lib suite and embed saas_profiles not run this round.
Refs #7801, #7523