Skip to content

Add dedicated next-turn state API#22436

Closed
etraut-openai wants to merge 1 commit into
mainfrom
etraut/next-turn-state-api
Closed

Add dedicated next-turn state API#22436
etraut-openai wants to merge 1 commit into
mainfrom
etraut/next-turn-state-api

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented May 13, 2026

Summary

Remote app-server clients need a way to update a thread's next-turn defaults without starting a turn. Today those settings are either local to one TUI or piggybacked on turn/start, which means a second TUI attached to the same thread can miss changes like model, plan mode, or fast mode until a later turn.

This adds a dedicated v2 app-server API for next-turn state and a broadcast notification so connected clients can keep their UI in sync.

This also fixes several bugs reported against the /goal feature where the goal continuation prompt was using outdated turn state because the client was not notifying the server when settings change.

Addresses: #20656, #22090

Changes

  • Add thread/turnContext/update and thread/turnContext/updated, including generated JSON schema and TypeScript protocol fixtures.
  • Apply partial turn-context updates through the existing session settings path, returning and notifying with the full effective ThreadTurnContext.
  • Emit the same notification from turn/start when turn-context overrides change stored defaults.
  • Mark the new notification as delivery-required for remote and in-process app-server clients.
  • Update the TUI to send setting changes through the new API and refresh active or cached thread state when another client changes the turn context.
  • Cover partial updates, explicit serviceTier: null, no-op notification suppression, websocket broadcast delivery, and TUI state refresh behavior.

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