Skip to content

fix(talk): recognize agent-scoped browser gateway control - #125142

Merged
steipete merged 1 commit into
mainfrom
steipete/beautiful-hermann-db59b8
Aug 17, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/beautiful-hermann-db59b8

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Follow-up to #125111

What Problem This Solves

Fixes an issue where browser Talk sessions requesting gateway-control-v1 could reject a routed agent as unsupported when that agent owned the only configured OpenAI Platform profile. Provider readiness and browser-session authentication already used the routed agent, but capability evaluation silently fell back to the unscoped auth store.

Why This Change Was Made

The host-selected agent now flows through the generic realtime capability context into the provider-owned OpenAI browser capability check. The field remains optional, so callers and providers without a route-owned agent retain the existing unscoped behavior.

User Impact

Multi-agent browser realtime sessions can use Gateway-controlled OpenAI audio when the selected agent owns the relevant Platform credential, instead of failing before session creation with a misleading unsupported-capability error.

Evidence

  • Pre-fix regression proof: the generic resolver test failed because scoped gateway control resolved false; the OpenAI provider test failed because agent-only Platform auth did not advertise gateway control; the Gateway handler tests failed because capability resolution omitted the selected agent.
  • node scripts/run-vitest.mjs src/talk/provider-resolver.test.ts extensions/openai/realtime-voice-provider-routing.test.ts src/gateway/server-methods/talk.test.ts — 107 tests passed across 3 shards.
  • node scripts/check-changed.mjs -- <9 changed paths> — passed all selected core, core-test, extension, and extension-test checks.
  • pnpm plugin-sdk:surface:check — passed; no public Plugin SDK surface changed.
  • oxfmt --check <9 changed paths> and git diff --check — passed.
  • Fresh autoreview — clean, no accepted/actionable findings.

The affected capability decision is entirely local and occurs before any external provider request; focused owner-boundary tests reproduce the exact credential-scope failure without requiring a live OpenAI session.

AI-assisted: yes. The implementation, regression proof, and final diff were maintainer-reviewed.

Ensure gateway-control capability checks use the same routed agent as realtime provider readiness and browser-session authentication.
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 17, 2026 07:22
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime extensions: openai size: S maintainer Maintainer-authored PR labels Aug 17, 2026
@steipete steipete self-assigned this Aug 17, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 3:28 AM ET / 07:28 UTC.

ClawSweeper review

What this changes

Pass the routed agent identity through browser realtime capability resolution so gateway control recognizes that agent’s OpenAI Platform credential.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Current main still drops the routed agent before browser capability evaluation, and the supplied patch carries that scope through the generic resolver to the OpenAI-owned auth check without a blocking defect found. The maintainer label also requires explicit maintainer handling.

Priority: P1
Reviewed head: 81be430f781494f6bc5eca8a3b81ecc4c6e6bd24

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused private-boundary repair with targeted regression coverage and no identified correctness or security defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its focused regression evidence remains supplemental to exact-head validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its focused regression evidence remains supplemental to exact-head validation.
Evidence reviewed 5 items Current-main failure path: The browser-session handler resolves requestedAgentId for provider readiness, then calls capability resolution without that agent before rejecting gateway control.
Provider auth contract: The OpenAI auth predicate selects an agent directory when agentId is supplied; browser configuration passes it, while the current browser capability hook does not.
Patch owner-boundary shape: The PR adds an optional agentId to the private browser-capability context and forwards it through the generic resolver, internal provider adapter, gateway entry points, and OpenAI capability check.
Findings None None.
Security None None.

How this fits together

Browser Talk resolves a session’s owning agent and realtime provider before deciding whether Gateway-controlled audio is available. The provider’s capability result determines whether the Gateway creates the browser session or returns an unsupported-capability error.

flowchart LR
  A[Browser Talk request] --> B[Resolve session agent]
  B --> C[Select realtime provider]
  C --> D[Resolve browser capabilities]
  D --> E[Check agent-scoped OpenAI auth]
  E --> F[Allow gateway control]
  E --> G[Return capability error]
Loading

Before merge

  • Resolve merge risk (P1) - This changes an auth-provider capability decision: exact-head checks should preserve both the selected-agent success case and the unscoped/no-credential denial case before merge.
  • Complete next step (P2) - Protected maintainer-owned work has no identified mechanical repair; it should proceed through normal exact-head review and CI.
Agent review details

Security

None.

PR surface

Source +9, Tests +48. Total +57 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 6 11 2 +9
Tests 3 53 5 +48
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 64 7 +57

Review metrics

Metric Value Why it matters
Production vs test delta production +10/-2 (net +8); tests and test support +54/-5 (net +49) The production growth is narrowly scoped private-context plumbing across the Gateway-to-provider boundary, with most of the change devoted to regression coverage.
Capability scope input 1 optional internal agent-scope field added The new field changes browser capability auth lookup while preserving existing behavior for callers without a routed agent.

Root-cause cluster

Relationship: canonical
Canonical: #125142
Summary: This PR owns the remaining browser-capability scope gap after the related merged routing repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Confirm scoped capability coverage (recommended)
    Merge after exact-head validation confirms that only the selected agent’s Platform credential enables browser gateway control.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Require exact-head checks and retain the selected-agent and unscoped capability cases.

Technical review

Best possible solution:

Keep one routed agent identity from session selection through the generic capability resolver, with provider-owned auth evaluation and focused scoped-versus-unscoped regression coverage.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main resolves the routed agent for readiness but omits it from browser capability resolution, while the OpenAI auth predicate uses agentId to select the credential store.

Is this the best way to solve the issue?

Yes. Carrying the already-selected agent through the generic private capability context keeps provider-specific auth ownership in the OpenAI plugin and avoids duplicating credential lookup in Gateway code.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f59e945013db.

Labels

Label changes:

  • add P1: A routed multi-agent browser Talk session can currently fail before creation despite its selected agent having the required credential.
  • add merge-risk: 🚨 auth-provider: The PR changes which agent-scoped OpenAI Platform profile controls gateway-control capability advertisement.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its focused regression evidence remains supplemental to exact-head validation.

Label justifications:

  • P1: A routed multi-agent browser Talk session can currently fail before creation despite its selected agent having the required credential.
  • merge-risk: 🚨 auth-provider: The PR changes which agent-scoped OpenAI Platform profile controls gateway-control capability advertisement.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its focused regression evidence remains supplemental to exact-head validation.

Evidence

What I checked:

Likely related people:

  • steipete: Current browser capability lines blame to Peter Steinberger, who also authored the related merged routed-agent repair and this focused follow-up. (role: feature owner and recent area contributor; confidence: high; commits: 816ae22921f3, 73ab74ecccdc; files: src/gateway/server-methods/talk-client.ts, src/talk/provider-internal.ts, extensions/openai/realtime-voice-provider.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Landing verification for exact head 81be430f781494f6bc5eca8a3b81ecc4c6e6bd24:

  • Exact-head required CI is green: node scripts/watch-pr-ci.mjs 125142 81be430f781494f6bc5eca8a3b81ecc4c6e6bd24 reached GREEN with pending=0 on run 32005498096.
  • Focused regression proof passed: node scripts/run-vitest.mjs src/talk/provider-resolver.test.ts extensions/openai/realtime-voice-provider-routing.test.ts src/gateway/server-methods/talk.test.ts — 107 tests across 3 shards. The generic resolver, OpenAI provider, and Gateway caller cases each failed pre-fix for the dropped agent scope.
  • Changed-path gates passed: node scripts/check-changed.mjs -- extensions/openai/realtime-voice-provider-routing.test.ts extensions/openai/realtime-voice-provider.ts extensions/openai/realtime-voice-test-support.ts src/gateway/server-methods/talk-client.ts src/gateway/server-methods/talk.test.ts src/gateway/server-methods/talk.ts src/talk/provider-internal.ts src/talk/provider-resolver.test.ts src/talk/provider-resolver.ts.
  • pnpm plugin-sdk:surface:check, formatting, and git diff --check passed. No public Plugin SDK surface changed. Fresh exact-diff autoreview completed with no accepted/actionable findings.
  • Production LOC is +10/-2 (net +8); tests/test-support are +54/-5 (net +49). Production growth is limited to the optional private capability context and canonical forwarding.
  • ClawSweeper’s exact-head review found no actionable or security finding. Its selected-agent success/unscoped denial coverage and normal maintainer exact-head review/CI conditions are satisfied; it listed no separate behavior-changing Rank-up move.

Current main still resolves the routed agent for provider readiness and then drops it before browser capability evaluation. This patch preserves that host-selected scope through the private generic capability boundary and keeps OpenAI auth policy in the provider owner; omitted-agent behavior is unchanged.

Known proof gap: no live authenticated browser-session capture was supplied. ClawSweeper classified real-behavior proof as not applicable for this maintainer-owned deterministic repair; focused owner-boundary regressions and exact-head CI provide the landing evidence.

@steipete
steipete merged commit 3b8f9fb into main Aug 17, 2026
283 checks passed
@steipete
steipete deleted the steipete/beautiful-hermann-db59b8 branch August 17, 2026 07:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
)

Ensure gateway-control capability checks use the same routed agent as realtime provider readiness and browser-session authentication.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: openai gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant