Repository navigation
Conversation
Carry forward the surviving V2 role repair from closed PR anomalyco#34276 for the current step-cap reproduction in anomalyco#56250. Keep cached tool definitions and final-step tool selection unchanged, and update retry role controls. Co-authored-by: Anoosh Ahmadi <[email protected]>
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
This works. I ran the reproduction from #56250 with the simulated model (agent steps: 2). On the base, the step-capped request ends with the MAX_STEPS prompt as an assistant turn. With this change, it ends as a user turn and the model answers with a summary. session-runner.test.ts (229 tests) and the packages/core typecheck pass.
I checked that a user turn right after tool results is still a valid request. Bedrock Converse merges it into the previous user turn, and Anthropic accepts consecutive user turns. Transcripts with queued user input already produce that shape. The edited retry test still checks what it should: the first request must not carry the MAX_STEPS prompt as a user message.
Public API: unchanged.
I have no concerns.
Issue for this PR
Fixes #56250.
Type of change
What does this PR do?
Send the maximum-step instruction as a user message so providers that reject assistant prefill can receive the final summary request. Tool definitions,
toolChoice: none, step counting and durable history stay unchanged.This carries forward the surviving V2 repair from @Anooshiravan's closed, unmerged #34276, with attribution in the commit. The original author explicitly offered that patch for reuse. The existing final-step and retry tests now require the user role.
How did you verify your code works?
Native Windows, Bun 1.4.2, frozen dependencies:
devwith assistant versus user.The broader core run encounters three Windows failures: symlink creation and two config-discovery assertions; the latter also fail on unchanged
dev. Root lint completes, but root typecheck stops at the Windows checkout's textualapp/src/custom-elements.d.tssymlink. This is not a whole-repository or live-provider validation.reviewed and tested locally.
Screenshots / recordings
Not a UI change.
Checklist
Added by the opencode bot (AI-generated).
Related: #46415, #53524, #55921