Skip to content

feat: ✨ Session budget with HITL pause mode - #777

Draft
evaline-ju wants to merge 22 commits into
rossoctl:mainfrom
evaline-ju:session-budget
Draft

feat: ✨ Session budget with HITL pause mode#777
evaline-ju wants to merge 22 commits into
rossoctl:mainfrom
evaline-ju:session-budget

Conversation

@evaline-ju

Copy link
Copy Markdown
Contributor

Summary

  • Rename token-budget to session-budget. The plugin is not limited to observing/budget enforcement tokens but also calls and durations.
  • Pause mode feature: new on_exceed: 'pause' mode — HITL approval: POST to a webhook on breach and block the request until it responds {"action":"approve"} or pause_timeout fires.
    • New config: pause_webhook, pause_timeout (30s), pause_timeout_action (deny|allow), pause_grace_period (5m)
    • After approval, subsequent requests skip the webhook for the pod-local grace window
    • Concurrent requests that arrive when the local cache is empty share one Redis lookup instead of each firing their own
    • Example stub webhook included under authbridge/demos/session-budget/
  • Cold-cache behavior is now mode-dependent (and documented)
    • pause synchronously hydrates from Redis on the request path so pre-existing over-budget sessions fire the webhook on first request
    • deny / observe (for on_exceed) keep the pre-existing behavior: skip on cold-cache, counters populate as inference responses stream back and via the background refresh loop. Keeps Redis off the hot path for the common modes.
  • Added unit and e2e tests for pause mode

Assisted-By: Claude (Anthropic AI) noreply@anthropic.com

Related issue(s)

Closes #759

Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e6daa5ea-ca34-4ec7-b56c-25ec6e23e31f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New/ToDo

Development

Successfully merging this pull request may close these issues.

feature: token-budget human-in-the-loop approval when budget exceeded

2 participants