fix(auth): support OpenAI OAuth vision in Peekaboo - #293
Conversation
|
Codex review: found issues before merge. Reviewed July 30, 2026, 3:38 AM ET / 07:38 UTC. ClawSweeper reviewWhat this changesThis PR lets Peekaboo treat refreshable OpenAI OAuth sessions as available for vision, updates the Tachikoma dependency, adds regression tests, and documents stored versus environment credential refresh behavior. Merge readinessKeep this PR open. Its OAuth availability and credential-boundary work has focused tests and credible runtime evidence, but the branch still pins a pre-merge Tachikoma commit even though the PR explicitly requires repinning to the final upstream merge revision before Peekaboo can safely land it. Priority: P2 Review scores
Verification
How this fits togetherPeekaboo’s configuration layer decides whether an OpenAI credential can start image analysis or agent vision, then hands the request to Tachikoma’s provider runtime. The changed gate must allow a refreshable OAuth session through without mixing environment credentials with persisted login state. flowchart LR
A[OAuth credentials] --> B[Peekaboo configuration]
B --> C{API key or usable refresh path?}
C -->|yes| D[Tachikoma OAuth provider]
C -->|no| E[OpenAI unavailable]
D --> F[Refresh credential session]
F --> G[Vision request]
G --> H[Visual answer]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The credential-boundary logic is security-sensitive, and the branch must not ship its pre-merge Tachikoma revision as the finalized dependency. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: After the upstream Tachikoma OAuth PR is merged, repin Do we have a high-confidence way to reproduce the issue? Yes. The PR supplies a deterministic current-path test using an expired access token plus a refresh token, with an exact focused Swift test command and red/green results; this read-only review did not execute it locally. Is this the best way to solve the issue? Unclear. Allowing a refreshable session through the existing availability gate is a narrow solution, but this branch is not the best landing path until its Tachikoma gitlink is repinned to the final upstream merge revision. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8448599ab899. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
What problem this solves
Peekaboo already converts captures into provider-neutral image messages, but its OpenAI availability gate only accepted a currently valid OAuth access token. Once that token expired, Peekaboo reported OpenAI as unavailable and stopped before Tachikoma had a chance to use the refresh token.
Previous call chain
New call chain
Implementation
see --analyze,image --analyze, and agent visionpeekaboo config loginpersists refresh rotationEvidence
Red-green availability proof
The deterministic setup stores:
Red step: the PR test was run with only the new refresh-token clause temporarily removed, reproducing the previous implementation.
Observed result:
Green step: restore the PR implementation:
Observed result:
Only that availability condition changed between the red and green runs. Both repositories were restored to clean state afterward.
Reproduction command:
Real OAuth vision proof from the pinned Tachikoma dependency
openclaw/Tachikoma#40 includes protocol-level red/green evidence using the same valid ChatGPT OAuth token:
The image is embedded in the live integration test; no host desktop was captured.
Environment credential-boundary proof
The pinned Tachikoma commit
d4cd49fadds direct tests proving that an environment-supplied OAuth refresh does not write to~/.peekaboo/credentials:The tests assert an empty credential store for environment-only sessions, unchanged stored values when a separate stored account exists, correct use of rotated refresh tokens, and cache invalidation when the source changes. Stored-login refreshes retain their separate atomic-persistence test.
Dependency
Important
Depends on openclaw/Tachikoma#40. This PR must merge only after that dependency lands; then the Tachikoma gitlink must be repinned to the final upstream merge commit before Peekaboo merges.
User impact
After the Tachikoma dependency lands, users authenticated through
peekaboo config login openaican use OpenAI OAuth for image analysis and agent vision without configuring a separate OpenAI API key. Existing explicit API-key configurations retain priority. Hosts that inject OAuth through environment variables keep those credentials ephemeral and must provide fresh values after a process restart.Validation
ConfigurationAccessorsOAuthTests— 14 tests passedAuthManagerTests— 19 tests passedOpenAIResponsesProviderTests— 30 tests passedpnpm run lint:docs— passedgit diff --check