Skip to content

[NO-JIRA] Per-session settings on the state machine: settings/set {cacheTtl, recipe} and maxTurns (R8) - #31

Merged
johnnymo87 merged 2 commits into
patched/v1.60.2from
r8-settings-set
Nov 22, 2026
Merged

johnnymo87 merged 2 commits into
patched/v1.60.2from
r8-settings-set

Conversation

@johnnymo87

Copy link
Copy Markdown
Owner

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/set on every coordinator session and fails closed without it; honk sends maxTurns.

  • _goose/unstable/session/settings/set {sessionId, cacheTtl?, recipe?}
    • cacheTtl (5m or 1h) is pinned on the session's model config.
    • recipe is 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.
    • retry and sub_recipes are dropped before storing. Unlike 1.54, 1.60 would act on them every turn, and a retry block could truncate a coordinator's history.
    • Errors are unchanged: invalid cacheTtl: and invalid recipe: (invalid_params) leave the row as it was, and an unknown session returns resource_not_found.
  • session/prompt _meta.goose.maxTurns takes a positive integer and bounds the run. Any other value is invalid_params.
  • The fork code is in acp/server/session_settings.rs and custom_requests/session_settings.rs. Upstream files only get registration lines.
  • rollingMemory comes 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's tools/list only lists extension tools.

Consumer note (stall-watch, not this PR): _goose/unstable/tools/list no longer lists recipe__final_output. The tools=False guard at honk_transport.py:1183 expects it. Production callers all pass tools=True, so only tests reach that guard.

References

  • workstation epic workstation-6w7i.26, bead .26.4.1 (1.54 source: fa913cb)

Replaces #25, which GitHub closed during a botched rebase push and would not reopen. Same commits, rebased on R15 (#24).

…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.
@johnnymo87
johnnymo87 merged commit 188b491 into patched/v1.60.2 Nov 22, 2026
13 checks passed
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