feat(session): spend the last steps of a turn on a report, not on the wall - #107
Merged
Conversation
… wall Stopping a turn at the ceiling threw away everything worked out but not written down, which is exactly what the next message would have needed. Ask for the report a couple of steps before the wall, using the mechanism `agent.steps` already uses, and keep the wall for a model that ignores it. Claude-Session: https://claude.ai/code/session_01U29Yk1UscZJ5ZVBXV1Sn8b
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The problem
TURN_STEP_CEILING = 200was a cliff. At the wall the turn was cut off and the user was told to"send another message to continue it" — but everything the model had worked out and not yet written
down went with the turn, so there was nothing to base that message on. Both omp and hermes landed
independently on the same shape: warn, force a summary, then abort. The point is not saving money,
it is not throwing away work already done.
The change
session/step-budget.ts— pure, tested — turns the cliff into two rungs:what is left, and what to do next. This reuses
MAX_STEPS_PROMPT, the exact mechanismagent.stepsalready uses at its own bound, so there is one behaviour to reason about ratherthan two;
Two grace steps rather than one, because a model asked to summarise sometimes makes one last tool
call first.
experimental.turn_stepssets both bounds orfalseremoves the ceiling, which is whatthe plan asked for when it said the ceiling should stay at 200 and become configurable.
Verification
no report instruction) and passing after.
wrap_up_atset past the wall, which would otherwise never fire.bun typecheckacross all 31 packages;packages/redcodesession suite 441 pass.finalizes assistant when cancelled before processor creation completes, both timing out underlocal load. CI arbitrates.
https://claude.ai/code/session_01U29Yk1UscZJ5ZVBXV1Sn8b
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.