The VM's copy of Codex's auth.json holds only codexKeep's fields, and its
~/.claude.json only claudeAccountKeep's oauthAccount fields; everything
else is withheld and named by path in login_fields_withheld, which
replaces login_kept. A declarative keep-list in format.go owns what each
format keeps or binds, and TestFormatsWithholdUnknown puts a canary in
every object of every format's golden login.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
opencode gets the rule pi got: an entry of its auth.json that devvm
neither binds nor passes reaches the VM's copy with only the fields
that name its account, with the login_withheld warning, which says to
list the provider under opencode in config.toml's [pass-keys]. A listed
provider's api entry goes whole, metadata included (login_passed), and
opencode 2's import brings every API key the copy holds into its
database. A bound API key's entry is {type, key: placeholder} alone, its
metadata kept on the host. pi's allowlist becomes withheldEntry and
withheldKeep, which both agents share; login_oauth_withheld goes.
A user with a local server's key in opencode sees it withheld after
upgrading, and the launch warning names the provider.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
opencode 2 keeps its logins in its database's credential table, not
auth.json. When this machine's opencode --version is 2 or later, the
import runs opencode auth export (its output read from stdout, never
logged) and maps each provider's active credential to the store's
opencode format (agentlogin.OpencodeFromExport): an API key as
{"type":"api","key"}, the OpenAI login from a Codex method
(chatgpt-browser, chatgpt-headless, or none for one imported from
auth.json) as {"type":"oauth","access","refresh","expires","accountId"}.
Sign in with ChatGPT, other providers' OAuth and unknown types are left
out with agent_import_opencode_skipped; a failing export fails the
import (agent_import_opencode_failed). opencode 1 keeps auth.json.
Tests: TestOpencodeFromExport, TestOpencode (the new opencode stub),
agent_import_opencode.txtar; AgentImport.Opencode is the seam.
Co-Authored-By: Claude Opus 5.5 <[email protected]>