Skip to content

openai-codex: write pi auth.json from OpenClaw OAuth profiles#15184

Merged
mbelinky merged 1 commit intoopenclaw:mainfrom
loiie45e:fix/codex-spark-first-class
Feb 13, 2026
Merged

openai-codex: write pi auth.json from OpenClaw OAuth profiles#15184
mbelinky merged 1 commit intoopenclaw:mainfrom
loiie45e:fix/codex-spark-first-class

Conversation

@loiie45e
Copy link
Contributor

@loiie45e loiie45e commented Feb 13, 2026

Problem

OpenClaw stores OAuth credentials in auth-profiles.json, but pi-coding-agent (ModelRegistry/AuthStorage) expects OAuth credentials in auth.json / env.

This mismatch can cause pi-based model discovery to omit OpenAI Codex built-in models (including gpt-5.3-codex-spark) from the registry/catalog, leading to configured,missing entries and discovery inconsistencies.

Change

  • Add a small bridge that copies OpenClaw's openai-codex OAuth profile fields (access/refresh/expires) into <agentDir>/auth.json when present.
  • Invoke the bridge before loading the pi ModelRegistry (models list) and before building OpenClaw's model catalog.

Tests

  • Unit test verifies ensurePiAuthJsonFromAuthProfiles() writes the expected auth.json entry and is idempotent.

Greptile Overview

Greptile Summary

This PR adds a small bridge (ensurePiAuthJsonFromAuthProfiles) that copies OpenClaw’s stored OAuth credentials for the openai-codex provider from auth-profiles.json into <agentDir>/auth.json, which is the format expected by pi-coding-agent’s AuthStorage/ModelRegistry. The bridge is invoked before pi model discovery runs in both the CLI registry listing path and the model catalog loading path, and a unit test validates that the bridge writes the expected auth.json entry and is idempotent.

Confidence Score: 5/5

  • This PR appears safe to merge with minimal risk.
  • Changes are scoped to writing a single bridge entry into agentDir/auth.json before pi model discovery, with conservative validation (requires access/refresh/expires) and idempotent behavior covered by a unit test. No concrete functional regressions or security issues were identified in the modified call sites.
  • No files require special attention

Last reviewed commit: 6f62221

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

@openclaw-barnacle openclaw-barnacle bot added commands Command implementations agents Agent runtime and tooling size: S labels Feb 13, 2026
@loiie45e
Copy link
Contributor Author

Additional validation (local):

  • Built this branch locally and confirmed the Codex OAuth bridge writes auth.json in an isolated agentDir (generated from auth-profiles.json).
  • With that bridge, openclaw models list --provider openai-codex --all includes openai-codex/gpt-5.3-codex-spark as an available model (not missing due to auth).
  • Also ran a 10/10 consecutive embedded smoke test via OpenClaw's agent --local path targeting openai-codex/gpt-5.3-codex-spark with prompt Reply with exactly OK and nothing else. → 10/10 OK.

@mbelinky mbelinky merged commit 07faab6 into openclaw:main Feb 13, 2026
27 checks passed
zhangyang-crazy-one pushed a commit to zhangyang-crazy-one/openclaw that referenced this pull request Feb 13, 2026
skyhawk14 pushed a commit to skyhawk14/openclaw that referenced this pull request Feb 13, 2026
leftspin pushed a commit to clickety-clacks/clawdbot that referenced this pull request Feb 13, 2026
GwonHyeok pushed a commit to learners-superpumped/openclaw that referenced this pull request Feb 15, 2026
cloud-neutral pushed a commit to cloud-neutral-toolkit/openclawbot.svc.plus that referenced this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments