routine: anthropic-effort-control (2026-07-22) - #112
Draft
jim4226 wants to merge 1 commit into
Draft
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Threads the Messages API's new
output_config.effortparameter throughAnthropicBackendas a per-checkpoint knob (effort_map), mirroring the existingmodel_mappattern.Source
Theme
Theme 6 — Substrate / capability boundaries.
effortis a new dial on every LLM call CSIS already wraps throughLLMBackend.complete(). Phase-0 default is empty (_DEFAULT_EFFORT_MAP = {}), so an operator who never setseffort_mapgets byte-identical request bodies to before this PR — the API's own default is"high", same as omitting the field entirely.What changed
csis/backends/anthropic.pyeffort_mapconstructor arg +_resolve_effort();complete()passesoutput_config={"effort": ...}tomessages.create()only when the checkpoint has a mapped entry;LLMResponse.raw["effort"]records what was senttests/test_anthropic_backend.pyAnthropicBackend) — 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 levelsTest plan
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_mapis a sibling of the existingmodel_mapfield, 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