Files
magpie/internal
yetone 5754fea435 gateway: a saved Claude account's run in the caller's folder starts with it trusted in that account's file (@ahz2ygnhjmIJ0E0 on X)
The reporter's own ~/.claude.json trusts the folders they work in, while
magpie's saved accounts' .claude.json files had them only here and there.
A run of an account without the entry was asked about the caller's folder
in the interactive mode, and 2.1.329's question went unread (70a881071),
so each account in turn waited out 45s. claude -p asks nothing, which is
why claudePrintMode answered 200.

Before an interactive run of a saved account in the caller's folder,
trustCaller now records the folder in that account's .claude.json, under
the keys Claude Code looks it up by (claudeTrustKeys: the path and its
resolved one, /private/tmp/... on a Mac), through the same
provider.ClaudeTrustFolder that trusts magpie's own folder (#4830). Every
caller's folder is recorded, not only those the user's own file trusts:
the shim answers yes for a saved account all the same (TrustEnv), and
Claude Code then writes just this entry, so the file ends as it would,
without the question. The signed-in account's own ~/.claude.json is
never written (configDir ""), and its untrusted folders still go to
magpie's folder (startTrusted).

Run:
- mote: go test -tags nogui -count=1 -run 'TestClaudeBridgeTrusts|TestClaudeTrust|TestClaudeOneOff|TestClaudeTUI' ./internal/gateway ok (67s).
- Broken by hand: with claude_subscription.go from 70a881071,
  TestClaudeBridgeTrustsCallersFolderForSavedAccount fails ("the run
  started with [/elsewhere] trusted, want the caller's ..."); green with
  the change.
- Real Claude Code 2.1.329 on mote, sandbox HOME and CLAUDE_CONFIG_DIR,
  the account file holding the folder under /tmp/... and /private/tmp/...
  as trustCaller writes it, and MAGPIE_CLAUDE_TUI_TRUST not set: the
  helper wrote init and the message was sent (authentication_failed,
  no sign-in in the sandbox); nothing asked about trust.
- mote: go vet (darwin, GOOS=windows, GOOS=linux) of internal/gateway and
  internal/provider clean; gofmt clean.

Not tried: a signed-in saved account sending a real message; Windows and
WSL runs (WSL runs never use the caller's folder, binary.wsl).
2026-11-20 16:42:52 +08:00
..
…
…
2026-11-11 08:14:28 +08:00
…
…
…