Repository navigation
fix(media): image description fails with no API key when OpenAI uses ChatGPT OAuth - #167221
ericcurtin wants to merge 11 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs real behavior proof before merge. What this changesThis PR shares credential-compatible model-route preparation between image descriptions and simple completions. Example: Describe cat.png with openai/gpt-5.6-luna using only ChatGPT OAuth.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR addresses a documented image-authentication defect that remains on current main; source review found no actionable introduced bug. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherImage tools, inbound analysis, and the image-description CLI send selected models and agent credentials through the shared image runtime, which prepares provider transport and returns description text. flowchart TD
A[Image entry points] --> B[Image runtime]
B --> C[Shared completion auth]
D[Simple completions] --> C
C --> E[Provider route policy]
E --> F[Provider transport]
F --> G[Description or completion]
Technical reviewBest possible solution: Use the existing route-aware authentication owner for image descriptions while preserving explicit credential choices and unrelated provider behavior. Do we have a high-confidence way to reproduce the issue? Current-main source authenticates the initial Platform model before selecting an OAuth-compatible route, matching the affected-release report and supplied before-fix trace; no target code was executed during this review. Is this the best way to solve the issue? Sharing the established completion auth owner repairs the ordering at the image boundary without weakening provider compatibility checks or introducing another routing policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 993a793007d4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +86, Tests +161, Other 0. Total +247 across 8 files. Added test files: 1. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (5 earlier review cycles)
Reviewed October 12, 2026, 8:50 PM ET / October 13, 2026, 00:50 UTC (Revision 6). |
Signed-off-by: Eric Curtin <[email protected]>
|
CI is green except the two maintainer approval gates (security sensitive review on completion-model-auth.ts). A successful image run needs a real ChatGPT OAuth account, so the description has the fixture token CLI trace and the routing tests only. @steipete @obviyus PTAL when you get a chance. Thank you! |
|
Merged main and moved the auth store read to the async API. Touched tests and tsgo pass. @clawsweeper re-review |
|
@RomneyDa @vincentkoc PTAL when you get a chance. Thank you! |
# Conflicts: # src/agents/simple-completion-runtime.ts # src/media-understanding/image.test.ts
|
Merged main, resolved the simple-completion conflict (onAuthProfiles now flows through the shared auth step). Image, simple-completion tests and tsgo:core pass. @clawsweeper re-review |
|
Merged main, resolved conflicts (plugin-owned auth now lives in the shared auth step). Image, simple-completion tests and tsgo:core pass. @clawsweeper re-review |
|
Merged main (conflict in image-model-runtime.ts resolved, assertion baseline tightened). The failing runtime-llm prepared-owner test passes locally on merged main. Thank you! |
|
Merged main to clear conflicts and the test-types red that came from main (6b40f49). Touched tests and tsgo pass. |
|
@jalehman @joshavant PTAL when you get a chance, the security-sensitive gate needs a maintainer approval. Thank you! |
Related to #165961
What Problem This Solves
Fixes: image description fails with
No API key found for provider "openai"when OpenAI is connected only through ChatGPT OAuth.User Impact
view_image, inbound image analysis andopenclaw infer image describework with ChatGPT OAuth. API keys with Codex enabled work too.Why This Change Was Made
Auth was checked against the first (Platform) route before the route was chosen. Image description now uses the same route-aware auth step as simple completions (moved to
completion-model-auth.ts, not copied). Other providers are unchanged.Evidence
Real CLI, isolated state, OAuth-only OpenAI profile,
openclaw infer image describe --model openai/gpt-5.6-luna:image.auth-routing.test.ts(real resolver and route plan, stream stubbed): both cases fail before, pass after.pnpm test <file> --maxWorkers=1: 2 passed, 11s.pnpm tsgo:coreandpnpm tsgo:core:testclean.image.test.ts: generic abort/retry cases use a non-OpenAI provider, since OpenAI now takes the real route plan.autoreview(script removed from checkout); fresh read-only review found no issues.test/scripts/eager-import-closure.test.ts, which also fails on puremain(12a91e0919,08005517c4) and on unrelated PRs. This PR does not touch it.