magpie builds each plugin's request itself, so the agent's own headers
(x-claude-code-session-id, x-claude-code-agent-id, x-opencode-session)
never reached a plugin. Devin's cache keepalive therefore keyed Claude
Code Auto's permission check by its text alone, and on the translated
path magpie merges consecutive same-role messages, so a check whose
history grew changed its first message in the middle and got a new key:
its older pings kept running beside the new ones (zelong77, plugins#620,
still seen on devin 0.1.33).
forwardOnce now sets X-Magpie-Session (sessionOf: the caller's own
X-Magpie-Session, else the agent's session header) and
X-Magpie-Subagent (Claude Code's agent id) on a plugin's request, after
deleting any the caller sent, and host.js's MAGPIE_ONLY list strips both
from what the plugin sends on, so the vendor never gets them. A request
naming no session has neither. devin 0.1.34 keys its pings by them.
docs/subsystems/provider-plugins.md says so.
Run at origin/main 1829cd52f plus these three commits (mote, macOS):
- gofmt -l internal/gateway internal/provider internal/plugin: clean.
- GOOS=linux and GOOS=windows go vet of the three: ok.
- go test -count=1 -timeout 45m ./internal/plugin ./internal/provider
./internal/gateway: plugin ok, provider ok; gateway one red,
TestCodexPoolSaysTheClientsVersion, which passes alone (-count=3)
and is another test's Codex identity leaking into it, filed as #4807,
untouched by this change.
- -v: TestPluginToldTheSession and TestMovedBuiltinsSayTheirPlugin pass.
- Rebased onto origin/main 52195b6b0 (it brings #3388's provider
change): gofmt clean, linux and windows vet ok,
internal/provider and internal/plugin ok, internal/gateway -run
'TestPlugin|TestMoved|Devin|WorkBuddy' ok. Pushed on 9f641daea,
whose Codex app-server change (codex_app_server.go, codex_daemon.go,
login_usage.go) touches none of these files; not run again on it.
Broken by hand:
- without the two Set lines in forwardOnce: TestPluginToldTheSession red
(the plugin told nothing), on relayed Anthropic and translated Chat.
- without the MAGPIE_ONLY entries in host.js: red, the vendor got
X-Magpie-Session.
Not tried: a real Devin account and a real Claude Code Auto session.