Skip to content

fix: auto-continue when a turn ends on reasoning or a tool message - #1879

Merged
avoidwork merged 2 commits into
mainfrom
feat/new-work
Nov 18, 2026
Merged

avoidwork merged 2 commits into
mainfrom
feat/new-work

Conversation

@avoidwork

@avoidwork avoidwork commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Description

The silent "Continue" nudge only fired when a turn ended on reasoning, so a turn that ended on a tool message stalled with no final answer. shouldAutoContinue now also fires on tool and on_tool_end, and skips interrupted turns (e.g. clarify) and on_tool_start. Implements the updated tui-streaming requirement in openspec/specs/tui-streaming/spec.md.

Type of Change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)
  • Performance improvement
  • CI / build / tooling

Testing

Added cases to tests/unit/tui/conversationArea.test.js for tool, on_tool_end, on_tool_start, and interrupted turns. npm test: 5380 passed, 0 failed. npm run lint: 0 errors (1 existing no-new-array warning in tests/unit/vector/audit-fixes.test.js, untouched).

Coverage

  • Line coverage maintained

src/stream/consume.js coverage is identical to main. src/tui/conversationArea.js is excluded from the coverage report by npm run coverage; its logic is covered by the shouldAutoContinue unit tests. Overall lines moved 93.34% to 93.32% from drift in deepAgents.js, modelInfo.js and openai.js, which this PR does not touch. coverage.txt is not changed in this PR.

Checklist

  • npm run lint passes
  • Tests pass with maintained line coverage
  • No forbidden patterns used
  • Conventional Commit style applied

@avoidwork
avoidwork merged commit 2864a52 into main Nov 18, 2026
2 checks passed
@avoidwork
avoidwork deleted the feat/new-work branch November 18, 2026 01:06
avoidwork added a commit that referenced this pull request Nov 18, 2026
Resolve the conflict in src/tui/conversationArea.js between this branch's
loop strike handling and main's #1879, which widened shouldAutoContinue to
turns that end on a tool message and skips interrupted turns.

Keep both: the loop nudge/compact block stays ahead of auto-continue, and
the auto-continue comment takes main's wording. Apply main's interrupted
rule to the loop path as well. A turn paused on a clarify interrupt is
waiting for the user's answer, so decideLoopAction now ignores it and
records no strike, rather than nudging or compacting a paused turn.
autoContinueLimit stays read once from config, so main's ?? 1000 fallback
in runTurn is not reintroduced.
@avoidwork avoidwork mentioned this pull request Nov 18, 2026
6 of 12 tasks
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