Skip to content

routine: anthropic-effort-control (2026-07-22) - #112

Draft
jim4226 wants to merge 1 commit into
mainfrom
claude/daily-2026-07-22-anthropic-effort-control
Draft

routine: anthropic-effort-control (2026-07-22)#112
jim4226 wants to merge 1 commit into
mainfrom
claude/daily-2026-07-22-anthropic-effort-control

Conversation

@jim4226

@jim4226 jim4226 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

Threads the Messages API's new output_config.effort parameter through AnthropicBackend as a per-checkpoint knob (effort_map), mirroring the existing model_map pattern.

Source

Theme

Theme 6 — Substrate / capability boundaries. effort is a new dial on every LLM call CSIS already wraps through LLMBackend.complete(). Phase-0 default is empty (_DEFAULT_EFFORT_MAP = {}), so an operator who never sets effort_map gets byte-identical request bodies to before this PR — the API's own default is "high", same as omitting the field entirely.

What changed

File Change
csis/backends/anthropic.py effort_map constructor arg + _resolve_effort(); complete() passes output_config={"effort": ...} to messages.create() only when the checkpoint has a mapped entry; LLMResponse.raw["effort"] records what was sent
tests/test_anthropic_backend.py New file (first direct test coverage of AnthropicBackend) — 8 tests covering the no-map-set backward-compat path, a mapped checkpoint, an unmapped checkpoint alongside a mapped one, and all five documented effort levels

Test plan

python -m pytest tests/test_anthropic_backend.py -v   # 8 passed
python -m pytest tests/ -q                              # 258 passed (250 baseline + 8 new), no regressions

Verified fail-before/pass-after: the new tests fail with TypeError: unexpected keyword argument 'effort_map' against the pre-change source and pass after.

Chokepoint argument

N/A — trivial PR (~25 LOC excluding tests/comments). effort_map is a sibling of the existing model_map field, resolved at the same call site (AnthropicBackend.complete()), which is not one of the cycle-9 chokepoints (Coordinator.__init__, _BackendTracker, writer_iteration_id, promotion CAS). No new top-level dependency.

https://claude.ai/code/session_01QMGb4kSfCWFArBgZJvbDU1


Generated by Claude Code

The Messages API shipped output_config.effort on 2026-07-22 (low/medium/
high/xhigh/max token-spend control on every call). Thread it through
AnthropicBackend as effort_map, mirroring the existing model_map pattern,
so an operator can dial down cost on cheaper roles without touching
Coordinator, _BackendTracker, writer_iteration_id, or the promotion CAS.
Default is empty (no override), matching the API's own "high" default,
so existing callers see byte-identical request bodies.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QMGb4kSfCWFArBgZJvbDU1
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