Repository navigation
fix(cli): send max-step instruction as user message #13301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
43c4491
fix(cli): send max-step instruction as user message
chrarnoldus 1663c27
fix(llm): preserve provider message alternation
chrarnoldus 705f6b7
test(llm): expect coalesced Gemini user content
chrarnoldus 406c191
refactor(llm): share user message coalescing
chrarnoldus 13f1696
fix(llm): preserve coalescing helper types
chrarnoldus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@kilocode/cli": patch | ||
| --- | ||
|
|
||
| Prevent provider errors when agents reach their step limit by sending the final summary instruction as user input instead of an assistant prefill. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WARNING: Trailing user message can produce consecutive Anthropic user turns
Native Anthropic/Bedrock lowering maps tool results to
role: "user"and does not merge a following user message. On the last step after tools this becomes[assistant tool_use, user tool_result, user MAX_STEPS]; withsteps: 1it is[user prompt, user MAX_STEPS]. Anthropic Messages requires alternating roles, so this can 400 the thinking models this PR is trying to unblock.Suggestion: if the last converted message is already
user(or will lower as user, i.e. tool results), appendMAX_STEPS_PROMPTonto that message instead of pushing a new one.Reply with
@kilocode-bot fix itto have Kilo Code address this issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 1663c27. Anthropic, Bedrock, and Gemini lowering now coalesces adjacent user-compatible blocks, including a tool result followed by the max-step instruction, and focused provider tests cover that request shape.