Fix agentd buffet provider support (claude-code, codex)

t-630·WorkTask·
·
·
·Omni/Agentd.hs
Created2 months ago·Updated1 week ago·pipeline runs →

Description

Edit

agentd containers fail with CostExhausted immediately when using OpenRouter (account out of credits) and the claude-code provider doesn't exist inside the container's agent binary.

Root causes found during Pipeline testing (t-603): 1. OpenRouter returns 402 (insufficient credits), agent translates this to CostExhausted 2. The agent binary inside Docker containers only supports: anthropic, openrouter, ollama — no claude-code/codex 3. ANTHROPIC_API_KEY is not set in the host env (only OPENROUTER_API_KEY), so --provider anthropic also fails inside containers 4. Auth token for claude-code may just need refreshing

Fix options:

  • Add claude-code/codex provider support to the container agent binary
  • Pass through OAuth tokens / refresh mechanism into containers
  • Ensure ANTHROPIC_API_KEY or equivalent auth is available
  • Consider adding a --provider passthrough that uses host-side pi via RPC instead of container-local inference

The agentd daemon mode (Omni/Agentd/Daemon.hs) already uses pi via RPC — the CLI agentd run path needs the same capability.

Key files:

  • Omni/Agentd.hs (runAgent function, ~line 847)
  • Container agent binary (inside agent-git/agent-haskell images)
  • Omni/Agentd/Daemon.hs (spawnPiAgent — working reference)

Timeline (21)

🔄[system]Open → InProgress1 month ago
💬[system]1 month ago

Pipeline: dev completed (run=dev-t-630-1771477853, cost=0.0c)

🔄[system]InProgress → Open1 month ago
💬[system]1 month ago

Pipeline: verification failed: Build failed for Omni/Agentd.hs (exit 1): 7[10000;10000H7[10000;10000Hthis derivation will be built: /nix/store/qjhwmpwsn1han0q6v29vrkn2c2jyyqa7-agentd.drv building '/nix/store/qjhwmpwsn1han0q6v29vrkn2c2jyyqa7-agentd.drv'... Running phase: unpackPhase unpacking source archive /nix/store/6a95x2kq0y2gz2qscgxgqgik25cmq3kg-source source root is source Running phase: patchPhase Running phase: updateAutotoolsGnuConfigScriptsPhase Running phase: configurePhase no configure script, doing nothing Running phase: buildPhase [ 1 of 27] Compiling Alpha ( Alpha.hs, Alpha.o ) [ 2 of 27] Compiling Omni.Agent.Paths ( Omni/Agent/Paths.hs, Omni/Agent/Paths.o ) [ 3 of 27] Compiling Omni.Agent.Models ( Omni/Agent/Models.hs, Omni/Agent/Models.o )

Omni/Agent/Models.hs:35:1: error: Could not find module Data.Yaml' Use -v (or :set -v in ghci) to see a list of the files searched for. | 35 | import qualified Data.Yaml as Yaml | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ 4 of 27] Compiling Omni.Test ( Omni/Test.hs, Omni/Test.o ) [ 5 of 27] Compiling Omni.Cli ( Omni/Cli.hs, Omni/Cli.o ) [ 7 of 27] Compiling Omni.Agent.Trace ( Omni/Agent/Trace.hs, Omni/Agent/Trace.o ) [ 9 of 27] Compiling Omni.Agent.Prompt.IR ( Omni/Agent/Prompt/IR.hs, Omni/Agent/Prompt/IR.o ) [10 of 27] Compiling Omni.Agent.Prompt.Hydrate ( Omni/Agent/Prompt/Hydrate.hs, Omni/Agent/Prompt/Hydrate.o ) [11 of 27] Compiling Omni.Agent.Prompt.Compile ( Omni/Agent/Prompt/Compile.hs, Omni/Agent/Prompt/Compile.o ) [12 of 27] Compiling Omni.Agent.Op ( Omni/Agent/Op.hs, Omni/Agent/Op.o ) [20 of 27] Compiling Omni.Agent.Auth ( Omni/Agent/Auth.hs, Omni/Agent/Auth.o ) [22 of 27] Compiling Omni.Time ( Omni/Time.hs, Omni/Time.o ) error: builder for '/nix/store/qjhwmpwsn1han0q6v29vrkn2c2jyyqa7-agentd.drv' failed with exit code 1; last 25 log lines: > source root is source > Running phase: patchPhase > Running phase: updateAutotoolsGnuConfigScriptsPhase > Running phase: configurePhase > no configure script, doing nothing > Running phase: buildPhase > [ 1 of 27] Compiling Alpha ( Alpha.hs, Alpha.o ) > [ 2 of 27] Compiling Omni.Agent.Paths ( Omni/Agent/Paths.hs, Omni/Agent/Paths.o ) > [ 3 of 27] Compiling Omni.Agent.Models ( Omni/Agent/Models.hs, Omni/Agent/Models.o ) > > Omni/Agent/Models.hs:35:1: error: > Could not find module Data.Yaml' > Use -v (or :set -v in ghci) to see a list of the files searched for. > | > 35 | import qualified Data.Yaml as Yaml > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > [ 4 of 27] Compiling Omni.Test ( Omni/Test.hs, Omni/Test.o ) > [ 5 of 27] Compiling Omni.Cli ( Omni/Cli.hs, Omni/Cli.o ) > [ 7 of 27] Compiling Omni.Agent.Trace ( Omni/Agent/Trace.hs, Omni/Agent/Trace.o ) > [ 9 of 27] Compiling Omni.Agent.Prompt.IR ( Omni/Agent/Prompt/IR.hs, Omni/Agent/Prompt/IR.o ) > [10 of 27] Compiling Omni.Agent.Prompt.Hydrate ( Omni/Agent/Prompt/Hydrate.hs, Omni/Agent/Prompt/Hydrate.o ) > [11 of 27] Compiling Omni.Agent.Prompt.Compile ( Omni/Agent/Prompt/Compile.hs, Omni/Agent/Prompt/Compile.o ) > [12 of 27] Compiling Omni.Agent.Op ( Omni/Agent/Op.hs, Omni/Agent/Op.o ) > [20 of 27] Compiling Omni.Agent.Auth ( Omni/Agent/Auth.hs, Omni/Agent/Auth.o ) > [22 of 27] Compiling Omni.Time ( Omni/Time.hs, Omni/Time.o ) For full logs, run: nix log /nix/store/qjhwmpwsn1han0q6v29vrkn2c2jyyqa7-agentd.drv

[1A[1G[2K[+] Omni/Agentd.hs [1A[1G[2K[0m[…] Omni/Agentd.hs[0m[1B

[1A[1G[2K[+] Omni/Agentd.hs [1A[1G[2K[~] Omni/Agentd.hs: warning: you did not specify '--add-root'; the result mi...[1B[1A[1G[2K[~] Omni/Agentd.hs: /nix/store/qjhwmpwsn1han0q6v29vrkn2c2jyyqa7-agentd.drv…[1B[1A[1G[2K[~] Omni/Agentd.hs: this derivation will be built:…[1B[1A[1G[2K[~] Omni/Agentd.hs: /nix/store/qjhwmpwsn1han0q6v29vrkn2c2jyyqa7-agentd.drv…[1B[1A[1G[2K[~] Omni/Agentd.hs: building '/nix/store/qjhwmpwsn1han0q6v29vrkn2c2jyyqa7-ag...[1B[1A[1G[2K[~] Omni/Agentd.hs: Running phase: unpackPhase…[1B[1A[1G[2K[~] Omni/Agentd.hs: unpacking source archive /nix/store/6a95x2kq0y2gz2qscgxg...[1B[1A[1G[2K[~] Omni/Agentd.hs: source root is source…[1B[1A[1G[2K[~] Omni/Agentd.hs: Running phase: patchPhase…[1B[1A[1G[2K[~] Omni/Agentd.hs: Running phase: updateAutotoolsGnuConfigScriptsPhase…[1B[1A[1G[2K[~] Omni/Agentd.hs: Running phase: configurePhase…[1B[1A[1G[2K[~] Omni/Agentd.hs: no configure script, doing nothing…[1B[1A[1G[2K[~] Omni/Agentd.hs: Running phase: buildPhase…[1B[1A[1G[2K[~] Omni/Agentd.hs: [ 1 of 27] Compiling Alpha ( Alpha.hs, Alpha....[1B[1A[1G[2K[~] Omni/Agentd.hs: [ 2 of 27] Compiling Omni.Agent.Paths ( Omni/Agent/Paths...[1B[1A[1G[2K[~] Omni/Agentd.hs: [ 3 of 27] Compiling Omni.Agent.Models ( Omni/Agent/Mode...[1B[1A[1G[2K[~] Omni/Agentd.hs: …[1B[1A[1G[2K[~] Omni/Agentd.hs: Omni/Agent/Models.hs:35:1: error: Could not find modu...[1B[1A[1G[2K[~] Omni/Agentd.hs: [ 4 of 27] Compiling Omni.Test ( Omni/Test.hs, Om...[1B[1A[1G[2K[~] Omni/Agentd.hs: [ 5 of 27] Compiling Omni.Cli ( Omni/Cli.hs, Omn...[1B[1A[1G[2K[~] Omni/Agentd.hs: [ 7 of 27] Compiling Omni.Agent.Trace ( Omni/Agent/Trace...[1B[1A[1G[2K[~] Omni/Agentd.hs: [ 9 of 27] Compiling Omni.Agent.Prompt.IR ( Omni/Agent/P...[1B[1A[1G[2K[~] Omni/Agentd.hs: [10 of 27] Compiling Omni.Agent.Prompt.Hydrate ( Omni/Ag...[1B[1A[1G[2K[~] Omni/Agentd.hs: [11 of 27] Compiling Omni.Agent.Prompt.Compile ( Omni/Ag...[1B[1A[1G[2K[~] Omni/Agentd.hs: [12 of 27] Compiling Omni.Agent.Op ( Omni/Agent/Op.hs...[1B[1A[1G[2K[~] Omni/Agentd.hs: [20 of 27] Compiling Omni.Agent.Auth ( Omni/Agent/Auth....[1B[1A[1G[2K[~] Omni/Agentd.hs: [22 of 27] Compiling Omni.Time ( Omni/Time.hs, Om...[1B[1A[1G[2K[~] Omni/Agentd.hs: error: builder for '/nix/store/qjhwmpwsn1han0q6v29vrkn2c...[1B[0m[38;5;1m[2Kfail: bild: realise: Omni/Agentd.hs [0m[0m [0m[1A[1G[2K[0m[38;5;1m[x] Omni/Agentd.hs[0m[1B 1

🔄[system]Open → InProgress1 month ago
💬[system]1 month ago

Pipeline: dev failed (run=dev-t-630-1771488438): Agent exited with code 1: The model gpt-5.3-codex does not exist or you do not have access to it.

🔄[system]InProgress → Open1 month ago
🔄[system]Open → InProgress1 month ago
💬[human]1 month ago

Pipeline scheduler: started run=pipeline-omni-agentd-hs-t-630-1771562111 domain=Omni/Agentd.hs

🔄[human]InProgress → Review1 month ago
💬[human]1 month ago

Pipeline scheduler: run=pipeline-omni-agentd-hs-t-630-1771562111 domain=Omni/Agentd.hs status=done cost=81c (fund-spend=failed)

💬[human]1 week ago

Ava triage: pipeline auto-run reached status=done but the agent made NO git commits and reported blockers (missing files, path mismatches, or need clarification). This task is not actually in review — there's nothing to review. Resetting status to Open so it can be re-scoped.

🔄[human]Review → Open1 week ago
💬[human]1 week ago

ORPHAN COMMIT: coder agent produced commit 560bee62cc1675daef6e41382e08cb4fedd01790 on 2026-02-19 but it was never merged into live. Reachable only via branchless reflog. Pipeline scheduler bug — see separate task. To recover: git cherry-pick 560bee62cc1675daef6e41382e08cb4fedd01790 from omni/live (expect conflicts after 6+ weeks of drift). Otherwise re-implement from scratch.