Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

🤖 fix: Mid-turn stage Continue drops a thinking change made during the turn

Closed
#7,237 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #7589 by @ThomasK33 — merged

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Start with AgentSession.setActiveTurnThinkingLevel in src/node/services/agentSession.ts and compare how setActiveTurnServiceTier updates captured options. Then trace TokenBudgetStrategy.onContextBudgetStepSettled in src/node/services/contextManagement/strategies/tokenBudget.ts and the Continue enqueue path described in #7231. Add a test that changes the thinking level during a turn, settles a step that stops for a stage, and verifies the Continue uses the new level.

Written by the indexing model from the issue text.

Description

Found from code, not reproduced. Found while reviewing #7231 (Codex thread PRRT_kwDOPxxmWM6vY-Zm on the refusal-fallback handover). Related: #5286.

Problem

A user changes the thinking level while a turn is streaming. Then a Token Budget stage stops that turn mid-turn and queues a "Continue". The Continue most likely runs at the turn's original thinking level, not at the level the user chose.

Evidence (code on main)

  1. AgentSession.setActiveTurnThinkingLevel (src/node/services/agentSession.ts, around line 11298) only sets holder.pending and holder.manual on the active turn's thinking holder. It never updates activeStreamContext.options.
  2. setActiveTurnServiceTier, just below it, does update activeStreamContext.options (and the auto-retry request) for the same reason: a later request built from the captured options must see the change.
  3. The stage Continue entry copies the stream context's captured options (TokenBudgetStrategy.onContextBudgetStepSettled in src/node/services/contextManagement/strategies/tokenBudget.ts; enqueueContinuation in #7231). Those options keep the turn's explicit original thinkingLevel, which wins over the newly persisted setting.

Proposed fix

Make setActiveTurnThinkingLevel update the captured send options, as setActiveTurnServiceTier does, or build the Continue's options from the holder's applied or pending level. A test sends a turn, changes the level mid-turn, settles a step that stops for a stage, and checks the Continue's thinkingLevel.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $515.79

Dominant language
TypeScript
Stars
2.1k
Forks
140
Avg merge
3h 23m
Merged PRs (30d)
953

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coder/xum

All issues in coder/xum

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.