#3536·Archon

bug(providers): Pi nodes on a subscription OAuth credential fail in the compiled binary

Author: tone4hookCreated Sep 26, 2026Updated Sep 26, 2026

Problem

In the compiled archon binary, a Pi node fails whenever its model uses a subscription OAuth credential (a type: "oauth" entry in ~/.pi/agent/auth.json, written by pi → /login). The node fails before any model call with:

OAuth auth derivation failed for openai-codex: ResolveMessage: Cannot find module './openai-codex.js' from '/$bunfs/root/archon-linux-arm64'

The same workflow on the same credential completes when Archon runs from source (bun run packages/cli/src/cli.ts). So in the binary, Pi is effectively limited to API keys, even though the docs list OAuth subscriptions (ChatGPT Plus/Pro, Claude Pro/Max, GitHub Copilot, …) as supported Pi authentication.

Why

The compiled binary is Archon's released install artifact. A user who has logged into Pi with a ChatGPT/Codex subscription can't use it in workflows at all and has to switch to a pay-per-token API key.

Desired outcome

A Pi node whose model resolves to an OAuth subscription credential runs in the compiled binary the same way it does from source.

Acceptance

  • In the compiled binary, a one-node Pi workflow on an openai-codex OAuth credential completes.
  • Pi nodes on API-key backends still work in the compiled binary.
  • The source (bun run) path is unchanged.

Evidence

Reproduction

  1. Log in to Pi with a ChatGPT subscription (pi → /login → OpenAI Codex). ~/.pi/agent/auth.json now has an openai-codex entry with type: "oauth".
  2. In any git repo, add .archon/workflows/pi-oauth-smoke.yaml:
    yaml
    name: pi-oauth-smoke
    description: One Pi node on an OAuth subscription credential
    provider: pi
    model: openai-codex/gpt-5.5
    nodes:
      - id: hello
        prompt: "Reply with exactly the word: ok"
        allowed_tools: []
  3. Build the binary with scripts/build-binaries.sh, then run archon workflow run pi-oauth-smoke --no-worktree.
  4. The node fails with the error above. Running the same workflow from source succeeds.

Environment

  • Archon version or commit: 0.11.1, dev at 879c99fe (binary built with scripts/build-binaries.sh)
  • Platform or adapter: CLI, compiled binary (archon-linux-arm64)
  • Database: SQLite
  • OS: Ubuntu 26.04 (arm64); Bun 1.3.14; @earendil-works/pi-ai 0.87.1

Logs or screenshots

[hello] Started  (pi/openai-codex/gpt-5.5)
[hello] Failed: Node 'hello' failed: SDK returned error — OAuth auth derivation failed for openai-codex: ResolveMessage: Cannot find module './openai-codex.js' from '/$bunfs/root/archon-linux-arm64'
❌ DAG workflow 'pi-oauth-smoke' failed: node hello failed. 0 downstream nodes were skipped.
Error: Workflow failed: Workflow did not complete successfully

Constraints and related work

  • Must remain true: API-key Pi backends and every other provider are unaffected. Credentials continue to come from Pi's own auth.json without Archon rewriting them.
  • Related issues or PRs: #2154, the same class of compiled-binary gap for Pi's Bedrock backend, fixed by registering the statically bundled module.
  • Solution steering: Hint — pi-ai loads OAuth flow modules in auth/oauth/load.js through import() on a runtime-computed specifier, which bun build --compile can't embed. pi-ai exports a @earendil-works/pi-ai/bun-oauth entrypoint whose registerBunOAuthFlows() registers statically imported flows for Bun binaries. Calling it once per process, as with the Bedrock shim, fixes the reproduction above. I have a fix with a unit test on a branch and can open a PR if maintainers agree with this direction.