forked from molecule-ai/molecule-core
Adds two new Claude API primitives (Opus 4.7+) as configurable workspace
fields in the Config tab form:
effort: 'low' | 'medium' | 'high' | 'xhigh'
Maps to output_config.effort in the Anthropic Messages API.
Controls thinking depth — xhigh enables extended thinking mode.
task_budget: integer (token count, 0 = unset)
Maps to output_config.task_budget.total; requires beta header
task-budgets-2026-03-13. Lets operators cap token spend per task.
Both fields are stored as top-level keys in config.yaml and read by
claude_sdk_executor.py (workspace-template side, tracked in #608).
Canvas changes:
- form-inputs.tsx: effort?: string, task_budget?: number added to
ConfigData; DEFAULT_CONFIG initialises them to "" / 0
- yaml-utils.ts: toYaml() emits effort + task_budget (omits when
empty/zero); parseYaml() already handles plain string/integer keys
- ConfigTab.tsx: new collapsible "Claude Settings" section (defaultOpen=false)
shown when runtime === "claude-code" OR model name contains "claude"
or "anthropic". Dropdown for effort (4 options + unset), number input
for task_budget (step 1000, 0 = unset).
Tests (25 cases in ClaudeSettings.test.tsx):
- toYaml serialises all four effort values + omits empty/undefined
- toYaml serialises task_budget + omits 0/undefined
- effort appears before task_budget in YAML output
- parseYaml round-trips both fields correctly
- DEFAULT_CONFIG shape assertions
- Source assertions for section guards + option values
- React rendering: section visible for claude-code/claude model,
hidden for non-Claude runtime (crewai + gpt-4o)
640/640 tests pass. Build clean.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| e2e | ||
| public | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| Dockerfile | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.ts | ||
| postcss.config.js | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| vitest.config.ts | ||