Repository navigation
fix: expose OAuth-backed tools to CLI agents - #119166
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 7:25 AM ET / 11:25 UTC. ClawSweeper reviewWhat this changesThe PR carries prepared OAuth credentials, agent directory, and model context through authenticated CLI loopback grants so OAuth-backed plugin tools are available to CLI agents. Merge readinessKeep this PR open for protected Gateway/agent-owner review. The exact head resolves the source-proven OAuth omission and the prior cache-cap finding, but direct sibling Codex source inspection required by repository policy is unavailable in this environment. Priority: P1 Review scores
Verification
How this fits togetherCLI-backed agents obtain Gateway tools through an authenticated loopback MCP bridge. The bridge resolves plugin tools for a grant’s session and returns them to the CLI, while revocation must remove credential-capturing cached closures. flowchart LR
A[CLI-backed agent] --> B[Authenticated loopback grant]
B --> C[Gateway tool resolution]
C --> D[Prepared OAuth and model context]
D --> E[Eligible plugin tools]
E --> F[CLI tool catalog]
B --> G[Grant revocation]
G --> H[Targeted cache eviction]
Decision needed
Why: This is a credential-bound shared runtime path, and repository policy requires direct sibling Codex source inspection before a merge-ready verdict for the affected Codex-capable CLI surface. Before merge
Agent review detailsSecurityNone. PR surfaceSource +135, Tests +286. Total +421 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Mantis proof suggestionA redacted Telegram transcript would independently corroborate the OAuth-only CLI tool invocation claimed in the PR body. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: After direct Codex contract review, retain this single grant-private generic bridge for CLI backends rather than adding backend-specific OAuth tool paths. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s loopback resolver omits the prepared auth store that plugin tool availability requires, and the PR body supplies a concrete OAuth-only CLI reproduction plus live result. Is this the best way to solve the issue? Yes, subject to the unavailable direct Codex contract check. Passing the already-prepared auth and model facts through the existing grant and generic resolver repairs the owner boundary without a backend-specific parallel path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b5d41f90053b. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 (4 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Owner decision: approved. Prepared OAuth state may live only inside the authenticated, active, revocable CLI loopback grant. Unbound Gateway calls remain credential-free. |
937f2ae to
0c6e303
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
d1682e4 to
209e4c5
Compare
|
Applied the cache-cap finding: grant buckets are now a 256-entry outer LRU, with red/green proof that the least-recently-used bucket is released while a recently used grant remains cached. Exact head: 209e4c50117. Codex contract check at openai/codex@03bb3b123673: |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
209e4c5 to
3a98716
Compare
|
Applied the global-cap finding at exact head |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Maintainer resolution for the exact-head review: accepted the grant-private credential boundary. Prepared OAuth state is available only after runtime-owner + active capture validation, is revalidated after body upload, and its cached closures are synchronously evicted on revocation under the shared 256-entry cap. Direct sibling Codex inspection is documented in #119166 (comment). No head change; no further re-review needed. |
|
Landed via squash as |
…checkpoint * origin/main: (46 commits) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) fix(auto-reply): suppress false no-reply fallback during continuations (#119154) fix(scripts): prevent gateway benchmarks from stalling on probes (#119063) test(channels): verify built sanitizer semantics (#119151) fix: prevent live updater from leaving Gateway offline indefinitely (#119116) test(qa): restore memory tools primary ownership (#119142) fix(agents): settle yielded fanout at harness boundary (#118703) fix(codex): cap compaction override warning cache via createDedupeCache (#101745) fix(daemon): skip unlabeled launchd plists (#119091) test(qa): repair QA catalog integrity (#119140) ...
* origin/main: (208 commits) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121) fix(qqbot): keep channel API calls on the active account [AI] (#118575) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) fix(auto-reply): suppress false no-reply fallback during continuations (#119154) ...
* origin/main: (23 commits) chore(tui): add Gateway boundary PTY coverage (#119191) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121) fix(qqbot): keep channel API calls on the active account [AI] (#118575) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) ...
…time * origin/main: (177 commits) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (#119218) test(qa): cover Canvas agent and node controls (#119047) fix(cli): avoid repeated migration scans during local agent turns (#119051) fix(gateway): keep agents list on prepared model facts (#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (#119121) fix(qqbot): keep channel API calls on the active account [AI] (#118575) fix(agents): recover from invalid compaction summaries (#119137) fix(gateway): expose OAuth-backed tools to CLI agents (#119166) fix(plugins): preserve metadata reloads during models status (#119183) fix(test): bound direct gateway server runs (#119184) test(tui): prove command surfaces through PTY (#119165) fix(testbox): restore claims across path aliases (#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (#119164) fix(testbox): remove changed-gate sync residue (#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (#118998) fix(auto-reply): suppress false no-reply fallback during continuations (#119154) ...
Carry prepared OAuth and model context through authenticated CLI loopback grants. Revoke cached credential-bearing tools synchronously while preserving the global cache cap.
* origin/main: (23 commits) chore(tui): add Gateway boundary PTY coverage (openclaw#119191) fix(telegram): route reactions to their originating forum topics test(gateway): isolate scheduled service timers (openclaw#119218) test(qa): cover Canvas agent and node controls (openclaw#119047) fix(cli): avoid repeated migration scans during local agent turns (openclaw#119051) fix(gateway): keep agents list on prepared model facts (openclaw#119208) fix(telegram): retry update offset persistence fix(ci): accept profiled partial Kova gates (openclaw#119121) fix(qqbot): keep channel API calls on the active account [AI] (openclaw#118575) fix(agents): recover from invalid compaction summaries (openclaw#119137) fix(gateway): expose OAuth-backed tools to CLI agents (openclaw#119166) fix(plugins): preserve metadata reloads during models status (openclaw#119183) fix(test): bound direct gateway server runs (openclaw#119184) test(tui): prove command surfaces through PTY (openclaw#119165) fix(testbox): restore claims across path aliases (openclaw#119170) fix(message): preserve sends with incidental Telegram locations fix(perf): give each concurrency sample a full deadline (openclaw#119164) fix(testbox): remove changed-gate sync residue (openclaw#119163) fix(telegram): preserve later chunks after rejected sends fix(tui): block terminal controls in system messages (openclaw#118998) ...
Closes #101967
What
CLI-backed agents now carry their prepared auth snapshot, credential directory, and active model context through the authenticated loopback grant. Revocation synchronously evicts that grant's cached tool closures while one shared 256-entry cache preserves the previous global capacity.
Why
OAuth-backed tools such as
x_searchwere filtered out because loopback tool resolution lacked prepared auth and model context. The repaired path remains grant-private; unbound Gateway calls stay credential-free, and revoked grants cannot repopulate the cache through an already-admitted slow request.Proof
main: the OAuth regression fails becausex_searchis absent.mcp__openclaw__x_search: observedWorking / Mcp Openclaw X Search OpenClaw,X_SEARCH_TRANSPORT_PROOF, then1 tool call · 8s. The profile was synthetic OAuth-only with no API-key fallback.pnpm tsgo:core,pnpm tsgo:core:test, targeted Oxlint, dead-code exports, formatting, andgit diff --checkpass.openai/codex@03bb3b123673).check:changedremote routing was unavailable; the exact lanes above ran locally instead. Hosted CI is the broad gate.