#5584 (Suge8, magpie 0.1.3216, Claude Code 2.1.318, Pi on Opus 5.5,
interactive mode): a turn asking another effort than the one before let
the run go ("its effort is set at its start, and the next turn asks
another"), and a new Claude Code was told the conversation from a
transcript: 72,416 tokens written to the cache on a 108-message
conversation, 178,309 on a 148-message one (first token after 94.4s).
-p runs take a new level by apply_flag_settings (#502). The interactive
mode can't, as measured on the real 2.1.318 (Haiku 5.5, tmux, magpie's
own arguments):
- typing `/effort high` keeps the cache (55,310 read before, 55,400
after), but saves the level as the default for new sessions:
modelSettings.<model>.effortLevel in the settings.json of the
account's folder, the user's own ~/.claude for Claude Code's own
sign-in, even with --setting-sources ''. Only `max` is session-only.
- a --settings file rewritten (effortLevel, or modelSettings.<model>)
changes nothing: the request stays at medium, with or without
--effort. Claude Code pins the file's content as it starts.
- after `/effort max`, the one field of its requests that changes is
output_config.effort.
Fix:
- Every interactive run has the guard file (guard.json, {} with no
safeguards); guardBody writes its safeguards and, once the run was
told another level than its --effort (ownEffort), "effort" beside
them. setSafeguards and the new setTUIEffort both write it from the
run's state (tellGuard, under settingsMu).
- tap.js asks each main request (x-claude-code-request-class: main) at
the file's effort in output_config.effort, and leaves Claude Code's
other requests as they were; CLAUDE_CODE_EXTRA_BODY gets the file
without "effort". It writes guard.json.live at the first main request
as well as the first one carrying safeguards.
- resume: an interactive run asked another effort calls setTUIEffort.
A run with no .live (no tap), or a turn asking Claude Code's own
level ("") of a run started at another, is let go as before, the log
saying which.
- A level the model refuses (real 2.1.318 on claude-haiku-4-5 through
such a rewrite: "API Error: 400 This model does not support the
effort parameter.") fails the turn as a run started at it would; the
existing path (ended, !ok) lets the run go, and the turn asked again
starts a Claude Code at that --effort.
- docs/subsystems/claude-subscription-bridge.md says so.
Run at this tree (base 9e6687e3):
- New: TestTapAsksTheGuardFilesEffort (bun and node),
TestClaudeTUIEffortChangeGoesOnInItsRun,
TestClaudeTUIEffortChangeWithoutTapStartsAnew,
TestClaudeTUIEffortRefusedStartsAnew: ok; with the guard tests,
-race -count=3: ok.
- gofmt -l: clean. go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./...; go build, GOOS=linux go build -tags nogui,
GOOS=windows go build: ok.
- go test -tags nogui ./... (Go 1.26.8, go.mod's; sandbox HOME):
everything ok but TestPluginSOCKSProxy (#2207, Bun 1.4.4 here) and
TestLaneLimitRoutes (#5150, reads the running gateway; ok alone).
- The built binary, `magpie serve` on 127.0.0.1:34251 in a sandbox HOME,
XDG dirs and TMPDIR, Claude Code 2.1.318 signed in from a copy of the
access token (no refresh token), three turns of one conversation on
claude-haiku-5-5 at medium, high, medium (~20K tokens of history):
one Claude Code pid for all three, no "its effort is set at its
start"; the requests as sent (a read-only preload under the tap) asked
medium, high, medium; usage read/written 795/19,413, 19,869/384,
20,228/71. ~/.claude/settings.json byte for byte unchanged.
Broken by hand:
- resume's old abortFor back: the three gateway tests red ("started 2
runs, want one at medium"; the log's reason; the refused turn
answered 200).
- tap.js not asking the effort: TestTapAsksTheGuardFilesEffort red
("request 1 was sent … medium").
Not tried: Opus and Sonnet through the interactive mode (Haiku 5.5
only); whether Anthropic thinks harder at the rewritten level (the
request asks it, the reply doesn't tell); a Claude Code in WSL.