You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: One source each for the run slot and the forwarded-header lookup, and seed fields that can't pass for live ones #792
Cleanup from the review of PR #719 (#628), with no behavior change. Each item is a place where two things agree only by convention, or where the compiler accepts the wrong one.
Goals
Seed fields can't be read as live state.Agent derefs to PreparedAgent, which puts the seed fields scratchpad_budget and turn_nudge beside the scratchpad_budget() and turn_nudge() methods, which return the run's live state. Forget the parentheses and it compiles, but reads a budget that never moves. Rename the fields seed_scratchpad_budget and seed_turn_nudge. Deref stays; dropping it would churn the orchestrator's field reads for no gain.
One source for the run slot.add_all_tools gets the slot from its run parameter, and also from config.scratchpad_tools_config.run for the scratchpad read tools and read_artifact. The two match only by convention, and tests already pass different ones. Drop ScratchpadToolsConfig.run so those tools read the slot begin_run binds, by construction. ScratchpadBuildInputs.run stays: it feeds the wrapper build_scratchpad builds, which is a separate path.
One forwarded-header lookup.ForwardedHeaders::of and resolve repeat the case-insensitive lookup in apply_request_header_mappings, and walk the same headers_from_request maps as resolve_mcp_headers_in and the HITL webhook route's mapping. The credential check begin_run makes is only right while they agree, so derive both from one lookup helper and one walk of the mappings.
prepare says what it takes from a request. Its doc says nothing in it depends on a request, but additional_tools (the server's per-run tools), client_tools and session_id all come from one. State that, and that an agent prepared with them is safe for one request until [FEATURE]: A prepared agent stays warm across a session's runs #787 moves or keys them.
Additional Context
Reported in the review of PR #719: #719 (comment) (items 10, 11, 12, and the doc half of 4). The other half of item 4, keeping request-scoped tools out of a warm prepared agent, is in #787.
Summary
Cleanup from the review of PR #719 (#628), with no behavior change. Each item is a place where two things agree only by convention, or where the compiler accepts the wrong one.
Goals
Agentderefs toPreparedAgent, which puts the seed fieldsscratchpad_budgetandturn_nudgebeside thescratchpad_budget()andturn_nudge()methods, which return the run's live state. Forget the parentheses and it compiles, but reads a budget that never moves. Rename the fieldsseed_scratchpad_budgetandseed_turn_nudge.Derefstays; dropping it would churn the orchestrator's field reads for no gain.add_all_toolsgets the slot from itsrunparameter, and also fromconfig.scratchpad_tools_config.runfor the scratchpad read tools andread_artifact. The two match only by convention, and tests already pass different ones. DropScratchpadToolsConfig.runso those tools read the slotbegin_runbinds, by construction.ScratchpadBuildInputs.runstays: it feeds the wrapperbuild_scratchpadbuilds, which is a separate path.ForwardedHeaders::ofandresolverepeat the case-insensitive lookup inapply_request_header_mappings, and walk the sameheaders_from_requestmaps asresolve_mcp_headers_inand the HITL webhook route's mapping. The credential checkbegin_runmakes is only right while they agree, so derive both from one lookup helper and one walk of the mappings.preparesays what it takes from a request. Its doc says nothing in it depends on a request, butadditional_tools(the server's per-run tools),client_toolsandsession_idall come from one. State that, and that an agent prepared with them is safe for one request until [FEATURE]: A prepared agent stays warm across a session's runs #787 moves or keys them.Additional Context
Reported in the review of PR #719: #719 (comment) (items 10, 11, 12, and the doc half of 4). The other half of item 4, keeping request-scoped tools out of a warm prepared agent, is in #787.
Searched Issues
Code of Conduct