feat(opencode): add per-session budget limit - #42823
Conversation
Add an optional budget to sessions that stops the assistant when the session cost reaches it: - budget field in session schemas, storage column, and database migration - PATCH /session/:id accepts budget (null clears it), sessions can be created with a budget - the prompt loop stops after a step-finish that crosses the budget and appends an explanatory text part; re-prompting does not start a new turn until the budget is raised - TUI sidebar context panel shows spent/budget, adjusts the budget with mouse scroll (0.25 steps, scroll below zero clears it) and edits it by clicking and typing (Enter saves, Esc cancels) - regenerated SDK types with a nullable budget on the session update request
|
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. |
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate PRs found:
Recommend reviewing PR #42202 first as it has an identical title and scope to PR #42823. |
|
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. |
Adds an optional per-session spending budget that stops the assistant once the session cost reaches the limit.
budgetfield on sessions: schema, storage column, and DB migration (20260812223059_session_budget)PATCH /session/:idacceptsbudget(nullclears it); sessions can be created with a budgetbudgeton the session update requestTests: added/updated
processor-effect,prompt, andschema-decodingtests.