Skip to content

feat(issue-652): wire effort + task_budget to Anthropic output_config - #669

Merged
molecule-ai[bot] merged 2 commits into
mainfrom
feat/issue-652-effort-taskbudget-v2
Apr 17, 2026
Merged

feat(issue-652): wire effort + task_budget to Anthropic output_config#669
molecule-ai[bot] merged 2 commits into
mainfrom
feat/issue-652-effort-taskbudget-v2

Conversation

@molecule-ai

@molecule-ai molecule-ai Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wires effort (low/medium/high/xhigh/max) from config.yaml into output_config.effort on the Anthropic API call
  • Wires task_budget (int, must be ≥ 20000) into output_config.task_budget with type: tokens
  • Automatically adds task-budgets-2026-03-13 beta header when task_budget is set
  • Enforces 20K minimum for task_budget with a clear ValueError before any API call
  • Adds effort and task_budget fields to WorkspaceConfig in config.py

Files changed (3 files, 150 lines)

  • workspace-template/claude_sdk_executor.py_load_config_dict() helper + _build_options() wiring
  • workspace-template/config.pyWorkspaceConfig.effort and WorkspaceConfig.task_budget fields
  • workspace-template/tests/test_claude_sdk_executor.py — 5 acceptance tests covering all paths

Test plan

  • test_build_options_effort_only_sets_output_config_no_beta — effort only, no beta header
  • test_build_options_task_budget_sets_output_config_and_beta — task_budget ≥ 20K adds beta
  • test_build_options_both_effort_and_task_budget — combined output_config + beta
  • test_build_options_neither_effort_nor_task_budget_no_output_config — empty config → no output_config
  • test_build_options_task_budget_below_minimum_raises_value_error — < 20K → ValueError

53 tests pass (pytest tests/test_claude_sdk_executor.py).

Replaces #657 (closed — that branch was contaminated with audit-ledger files from being branched off feat/issue-594-audit-ledger instead of main).

🤖 Generated with Claude Code

Adds _load_config_dict() helper to ClaudeSDKExecutor and wires the new
effort and task_budget config fields into _build_options() before the
Anthropic API call:

- effort (str): low|medium|high|xhigh|max — populates output_config.effort
- task_budget (int): advisory total-token budget; must be >= 20000 when set;
  automatically adds task-budgets-2026-03-13 beta header

Also adds WorkspaceConfig.effort and WorkspaceConfig.task_budget fields in
config.py and 5 acceptance tests covering all code paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cover the four paths that were exercised only via mock in the
_build_options tests: valid YAML, missing file, malformed YAML,
and empty file (safe_load → None → {} via `or {}`).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@molecule-ai
molecule-ai Bot merged commit fb0d615 into main Apr 17, 2026
4 of 5 checks passed
molecule-ai Bot added a commit that referenced this pull request Apr 21, 2026
…dget-v2

feat(issue-652): wire effort + task_budget to Anthropic output_config
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the feat/issue-652-effort-taskbudget-v2 branch April 24, 2026 00:09
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.

0 participants