Repository navigation
[NO-JIRA] Per-session settings on the state machine: settings/set {cacheTtl, recipe} and maxTurns (R8) - #31
Merged
Merged
Conversation
…cheTtl, recipe} and maxTurns Rewrite of fork patches 8 and 9 (1.54 fa913cb) for v1.60.2. Patch 7 (restored session keeps its stored cache TTL) landed with the mechanical port. * _goose/unstable/session/settings/set pins a session's prompt-cache TTL ("5m" or "1h", through switch_provider) and its recipe. The recipe is validated, rendered with the session's parameter values (scheduled sessions keep the template) and stored on the session row, which is what new_session stores and what the recipe and final_output operations read every turn. Invalid input is rejected with "invalid cacheTtl: " / "invalid recipe: " and leaves the row unchanged; an unknown session is resource_not_found; a cold session is activated. * session/prompt _meta.goose.maxTurns (positive integer) bounds the run; invalid values are invalid_params. * Fork code lives in acp/server/session_settings.rs and custom_requests/session_settings.rs; upstream files get registration lines. * RecipeResponseDto accepts a jsonSchema alias, as on 1.54. * Tests: 4 unit tests, 6 integration tests ported from 1.54 into tests/acp_session_settings_test.rs (final_output presence is asserted on the provider request, since 1.60's tools/list lists extension tools only), all in the patched-ci exact-test gate.
…ored template when no recipe is sent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Ports the fork's per-session settings onto the v1.60.2 state machine (R8+R9, workstation-6w7i.26.4.1). stall-watch calls
settings/seton every coordinator session and fails closed without it; honk sendsmaxTurns._goose/unstable/session/settings/set {sessionId, cacheTtl?, recipe?}cacheTtl(5mor1h) is pinned on the session's model config.recipeis validated, rendered with the session's parameter values (scheduled sessions keep the template), and stored on the session row. On 1.60 the recipe and final_output operations read that row every turn, so nothing is applied in memory. This is simpler than 1.54.retryandsub_recipesare dropped before storing. Unlike 1.54, 1.60 would act on them every turn, and aretryblock could truncate a coordinator's history.invalid cacheTtl:andinvalid recipe:(invalid_params) leave the row as it was, and an unknown session returns resource_not_found.session/prompt _meta.goose.maxTurnstakes a positive integer and bounds the run. Any other value is invalid_params.acp/server/session_settings.rsandcustom_requests/session_settings.rs. Upstream files only get registration lines.rollingMemorycomes in R12 (.26.4.3). Until then the field is ignored.Tests: 4 unit tests, and 6 integration tests ported from 1.54 (
tests/acp_session_settings_test.rs). All of them are in the patched-ci exact-test list. The tests check for final_output in the provider request, because 1.60'stools/listonly lists extension tools.Consumer note (stall-watch, not this PR):
_goose/unstable/tools/listno longer listsrecipe__final_output. Thetools=Falseguard athonk_transport.py:1183expects it. Production callers all passtools=True, so only tests reach that guard.References
Replaces #25, which GitHub closed during a botched rebase push and would not reopen. Same commits, rebased on R15 (#24).