Skip to content

fix(perf): make provider budget gates constant time - #816

Merged
seonghobae merged 1 commit into
ContextualWisdomLab:fix/auto-reasoning-effort-contract-rebasedfrom
seonghobae:fix/issue-814-budget-meter-hotpath
Aug 21, 2026
Merged

fix(perf): make provider budget gates constant time#816
seonghobae merged 1 commit into
ContextualWisdomLab:fix/auto-reasoning-effort-contract-rebasedfrom
seonghobae:fix/issue-814-budget-meter-hotpath

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Refs #814

Remediates the actionable post-merge review finding on #813.

Outcome

  • reads the ADR 0014 synchronized incremental meter in budget_status()
  • avoids deep-copying and rescanning up to 128 workflow runs before each provider call
  • preserves buyer-facing spend aggregates, cost rounding, durable checkpoints, and fail-closed limit semantics
  • proves the enforcement path cannot call spend_analytics()

Verification

  • 1,727 tests passed on base 5b43ebfa77fa4a9f0feb2d0c414482dac1139bfa
  • changed production statement/branch coverage: 100%
  • orchestrator.py docstring coverage: 100%
  • focused budget/generated/passthrough tests: 66 passed
  • diff check and CodeGraph sync: passed

The pre-existing repository-wide coverage baseline is 92%, tracked separately in #815; this PR does not weaken or hide that denominator.


Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e8ea361f-9a1b-407f-a3b0-bbaef348737f

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread contextual_orchestrator/orchestrator.py
@seonghobae
seonghobae merged commit 70f8b4d into ContextualWisdomLab:fix/auto-reasoning-effort-contract-rebased Aug 21, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in naruon Platform Roadmap Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant