Skip to content

fix: preserve Claude Code default budget with real configs - #515

Draft
yunyv wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
yunyv:fix/claude-code-default-budget
Draft

yunyv wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
yunyv:fix/claude-code-default-budget

Conversation

@yunyv

@yunyv yunyv commented Oct 15, 2026

Copy link
Copy Markdown

Summary

Use the documented 1.0 USD default when a Claude Code model's max_budget_usd is omitted or null.

Real LLMModelConfig objects have this attribute set to None by default. The provider's getattr(..., 1.0) fallback therefore does not apply, and the generated command contains --max-budget-usd None. Existing backend tests supplied a numeric budget through a mock config, hiding the problem.

This change handles only None; explicit values and per-call overrides keep their existing behavior. Five regression tests exercise the real config loader and provider factory with the subprocess mocked.

Validation

  • Before the fix: provider test file 2 failed, 18 passed. The omitted/null budget regressions failed.
  • After the fix: 47 relevant provider/config tests passed.
  • Full documented unittest suite: 667 passed, 2 skipped (669 run).
  • Black checks for both changed files and git diff --check: passed.
  • Independent automated review: provider tests plus four additional offline cases passed; no findings.

The full unit suite ran with test-only guards preventing external network requests and real model CLI subprocesses; its local fake HTTP server was allowed. No live Claude Code invocation or paid model call was tested. The model-backed integration suite was not run.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
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