Skip to content

test: align send-budget default assertion with shipped 20x/200 cap - #139

Merged
jithin23-kv merged 1 commit into
masterfrom
test/align-send-budget-default
Jul 1, 2026
Merged

jithin23-kv merged 1 commit into
masterfrom
test/align-send-budget-default

Conversation

@jithin23-kv

Copy link
Copy Markdown
Collaborator

Problem

runners/cli/tests/fork.test.ts fails on master, so the CLI test suite is red (28/29). CI does not surface this because the test job runs only the core and sdk workspaces — the CLI suite is never executed.

Root cause

The test asserted BudgetGuard send-budget defaults of 300 (50× budgetUsd) and 400 (no budget), but the shipped code in core/src/autonomous/lib/budget.ts:64 uses 20× budgetUsd (else 200):

this.maxTotalSends =
  opts.maxTotalSends ?? (opts.budgetUsd ? Math.ceil(opts.budgetUsd * 20) : 200);

So budgetUsd: 6 → 120 (not 300) and no-budget → 200 (not 400).

Change

Test-only. Assertions + test name updated to match the shipped 20×/200 behaviour (the lower, intended spend ceiling). No production code touched.

How verified

  • npm test --workspace=@keyvaluesystems/agent-opfor-cli → green (was failing)
  • npm run typecheck · npm run lint · npm run format:check → pass
  • Committed with the full pre-commit hook (typecheck/lint/format/catalog/validate-skills/gitleaks), no --no-verify.

Follow-ups (separate PRs)

  • Run the CLI + MCP workspaces in CI so this class of regression is caught.

The fork.test.ts case asserted maxTotalSends defaults of 300 (50x budgetUsd)
and 400 (no budget), but BudgetGuard (core/src/autonomous/lib/budget.ts:64)
ships 20x / 200. The suite was red on master; CI did not catch it because the
CLI workspace tests are not run in CI. Update the assertions to match the
shipped behaviour (120 and 200) so the suite passes.
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jithin23-kv, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cc41998b-d90d-45fd-8258-1c2f41b8361d

📥 Commits

Reviewing files that changed from the base of the PR and between 55596b3 and 3b10aac.

📒 Files selected for processing (1)
  • runners/cli/tests/fork.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/align-send-budget-default

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.

@jithin23-kv
jithin23-kv merged commit 1e2eb53 into master Jul 1, 2026
13 checks passed
@jithin23-kv
jithin23-kv deleted the test/align-send-budget-default branch July 1, 2026 10:38
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.

2 participants