Skip to content

feat(opencode): add per-session budget limit - #42823

Closed
HHrddtu wants to merge 1 commit into
anomalyco:devfrom
HHrddtu:pr/session-budget
Closed

feat(opencode): add per-session budget limit#42823
HHrddtu wants to merge 1 commit into
anomalyco:devfrom
HHrddtu:pr/session-budget

Conversation

@HHrddtu

@HHrddtu HHrddtu commented Aug 15, 2026

Copy link
Copy Markdown

Adds an optional per-session spending budget that stops the assistant once the session cost reaches the limit.

  • New budget field on sessions: schema, storage column, and DB migration (20260812223059_session_budget)
  • PATCH /session/:id accepts budget (null clears it); sessions can be created with a budget
  • The prompt loop stops after the step 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

Tests: added/updated processor-effect, prompt, and schema-decoding tests.

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
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential duplicate PRs found:

  1. PR feat(opencode): add per-session budget limit #42202 - feat(opencode): add per-session budget limit

  2. PR feat(app): add voice input and session budget UI #42824 - feat(app): add voice input and session budget UI

Recommend reviewing PR #42202 first as it has an identical title and scope to PR #42823.

@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 16, 2026
@github-actions github-actions Bot closed this Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant