Repository navigation
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
3 of 6 tasks
The model decides what to ask for, so the thing that says no has to sit where the model does not reach: the supervisor, between steps. `OPENCODE_TEMPORAL_BUDGET_*` set a turn's tokens and wall clock, a deadline that stops the running step, and the same two bounds for the whole session; what a session spent is carried across a rollover and read back off its own row, so an idle session woken again does not get its allowance back.
moetemp
force-pushed
the
moe/turn-budget
branch
from
September 15, 2026 01:01
ec0368a to
e6fa8e0
Compare
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
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.
This PR lets an operator bound what a turn, and a whole session, may spend.
The model decides what to ask for, so the thing that says no has to sit where the model does not reach: the supervisor, between steps.
OPENCODE_TEMPORAL_BUDGET_TOKENSandOPENCODE_TEMPORAL_BUDGET_SECONDSbound one turn and are checked after each step, so a step that has started is left to finish.OPENCODE_TEMPORAL_BUDGET_HARD_SECONDSis a deadline that stops the step that is running, which is what a user pressing stop does.OPENCODE_TEMPORAL_BUDGET_SESSION_TOKENSandOPENCODE_TEMPORAL_BUDGET_SESSION_SECONDSbound the session across every turn it runs: what a session spent is carried across a rollover and measured against the session's own row, so an idle session woken again does not get its allowance back.The bound rides the workflow input like the mode does, because the sandbox cannot read env. A bound that is set but unreadable refuses to start rather than reading as none, and
session doctorprints what was resolved. Off unless set, because a bound that ends real work is worse than none and only the operator knows which is which.Tests:
session-supervisor-ceiling.test.ts,drain-spend.test.ts,config.test.ts, and the spend cases instepped-turn.test.tsandsession-runner-model-call.test.ts.