Skip to content

fix: closed browser Talk sessions admit new agent work - #133019

Merged
steipete merged 1 commit into
mainfrom
codex/browser-talk-lifetime
Aug 30, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/browser-talk-lifetime

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #132993

What Problem This Solves

Fixes an issue where a browser Talk session could admit new agent work after closing or disconnecting, while explicitly releasing a GPT-Live browser transport could abort work already accepted.

Why This Change Was Made

Pending and active provider sessions now use the existing browser lifecycle owner. Admission checks exact connected-client and active-transport ownership, queued chat creation rechecks ownership at commit, and failed or late startup releases its provider resources. Replacement remains transactional: the old transport stays active until its replacement succeeds. Accepted GPT-Live work outlives an intentional transport release, but cannot send results back through that closed wire. Recoverable provider errors reach the owning client.

User Impact

Closing Talk prevents new delegations without discarding an accepted task. Disconnects during startup do not leave provider sessions or empty chats behind. The existing client-control negotiation, GA behavior, config, and database schema remain unchanged.

Evidence

Independent Codex review of the combined candidate completed clean at P0–P2; the PRs contain disjoint subsets of that reviewed patch.

  • Before-fix regressions proved late admission after both close and disconnect, and an aborted accepted GPT-Live consult after browser cancellation.
  • Focused regressions passed: 100 Gateway tests, the client-session suite and extracted queued-commit test, plus OpenAI session/delegation/bridge suites. The final broker cleanup passed all 55 session, cancellation-lifecycle, and GA OAuth cases. These cover pending creation, exact client membership, queued writes, replacement, accepted-work continuation, late-result suppression, recoverable errors, and existing GA/provider routes.
  • Extension type checking and type-aware lint passed. Production LOC: +294/-191, net +103; tests: +401/-15, net +386. The added production state belongs to the existing lifecycle owner and covers pending startup, exact transport admission, and cancellation at commit; duplicate teardown and HTTP response policy were consolidated. Config/schema surface: unchanged.
  • A live GA WebRTC call completed its broker exchange, authenticated sideband, and tool response on Blacksmith Testbox tbx_01m185h6k7s0dnt939ehb0dtcg: https://github.com/openclaw/openclaw/actions/runs/33286432360 . The GA speech smoke also passed.
  • GPT-Live live verification remains infeasible with the available credentials: Platform model access was rejected and the hydrated OAuth token was expired. No GPT-Live live-success claim is made.
  • Direct Codex source inspection at 63d213884daea50e4f74efc192cdc44f549b67d5 covered frameless delegation, sideband closure, and normal WebSocket shutdown. No provider auth policy or payload contract is changed.

Provenance: the failures were reproduced at 9d8bf3525072487320da72b6718ecf9c69dc3f4e; the exact introducing commit is not established.

Follow-ups remain separate: GPT-Live audio-driven interruption needs a continuous-media ownership contract; a sideband transcript finishing does not prove its WebRTC media drained. Native phone tools and Discord forced-response/wake policies also need per-model capability follow-through. These limitations are documented, not silently treated as parity.

AI-assisted implementation and verification. Release-note context: bind browser Talk delegation admission and cleanup to its exact live transport while preserving accepted work.

@steipete steipete self-assigned this Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime extensions: openai size: L maintainer Maintainer-authored PR labels Aug 30, 2026
@clawsweeper clawsweeper Bot added 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 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 10:30 PM ET / August 30, 2026, 02:30 UTC.

ClawSweeper review

What this changes

This PR binds browser Talk provider delegation to the live client-session lifecycle, rejecting callbacks retained after close or disconnect while preserving work already accepted.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The branch repairs the linked closed-session delegation bug at its lifecycle owner; no introduced correctness or security defect was found, so it should remain open for normal maintainer review and exact-head CI.

Priority: P1
Reviewed head: beba77e96c2eb137ade53b147bf4491452510931

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused owner-boundary coverage and the lifecycle design are solid, with remaining normal CI and production-growth review work.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-owned PR is not subject to the external-contributor proof gate; its body reports focused GA Testbox validation and explicitly notes that GPT-Live live-success verification was unavailable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned PR is not subject to the external-contributor proof gate; its body reports focused GA Testbox validation and explicitly notes that GPT-Live live-success verification was unavailable.
Evidence reviewed 6 items Lifecycle ownership: Provider-native browser sessions now create and retain a pending Gateway lifecycle owner through asynchronous provider startup, then activate it only after durable session initialization.
Final admission fence: The provider-facing consultation callback verifies the abort state, connection, and active owner identity before it invokes the agent runner.
Close and startup ordering: Closure aborts admission synchronously before deferred cleanup, and session-row creation revalidates permission at the storage commit boundary.
Findings None None.
Security None None.

How this fits together

Browser Talk creates a provider transport that may ask Gateway to run an agent consultation. The Gateway lifecycle owner must allow that admission only while the originating browser client and voice session remain live.

flowchart LR
  A[Browser Talk client] --> B[Gateway session creation]
  B --> C[Provider browser transport]
  C --> D[Gateway lifecycle owner]
  D --> E[Agent consultation]
  A --> F[Close or disconnect]
  F --> D
  D --> G[Reject new work]
  E --> H[Complete accepted work safely]
Loading

Before merge

  • Resolve merge risk (P1) - This bug fix has a net production increase of 103 lines; the pending-owner and commit-boundary states appear necessary for the startup/close invariant, but that added lifecycle surface should remain deliberately justified before landing.
  • Complete next step (P2) - This protected maintainer PR is an active candidate fix; it needs the normal review and exact-head CI gates rather than a separate repair job.
Agent review details

Security

None.

PR surface

Source +103, Tests +386. Total +489 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 7 294 191 +103
Tests 6 401 15 +386
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 695 206 +489

Review metrics

Metric Value Why it matters
Production versus test delta production +294/-191 (net +103); tests +401/-15 (net +386) The production growth implements pending lifecycle ownership and synchronous admission fencing; the larger test growth covers the resulting race boundaries.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #132993
Summary: This PR is the active candidate fix for the closed browser Talk session delegation bug.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the single lifecycle-owner repair once exact-head CI confirms the close, disconnect, startup, replacement, and accepted-work regressions, retaining only the additional state required to represent those distinct lifetimes.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the single lifecycle-owner repair once exact-head CI confirms the close, disconnect, startup, replacement, and accepted-work regressions, retaining only the additional state required to represent those distinct lifetimes.

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

Yes. The linked issue provides a deterministic lifecycle-boundary scenario, and the added close/disconnect regressions exercise that scenario against the durable voice-session owner.

Is this the best way to solve the issue?

Yes. Fencing admission at the lifecycle owner and session commit boundary rejects retained callbacks without disrupting already accepted work, avoiding a downstream-only guard.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: The linked reproduction shows a retained browser-provider callback can begin new agent work after the user closes or disconnects Talk.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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-owned PR is not subject to the external-contributor proof gate; its body reports focused GA Testbox validation and explicitly notes that GPT-Live live-success verification was unavailable.

Label justifications:

  • P1: The linked reproduction shows a retained browser-provider callback can begin new agent work after the user closes or disconnects Talk.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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-owned PR is not subject to the external-contributor proof gate; its body reports focused GA Testbox validation and explicitly notes that GPT-Live live-success verification was unavailable.

Evidence

What I checked:

Likely related people:

  • unknown: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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

Maintainer follow-through on the production-growth review: the net +103 lines are retained for three distinct lifetimes the old active-only map could not represent: pending provider startup, exact active browser transport admission, and already accepted agent work after that transport closes. The patch extends the existing owner rather than adding a parallel lifecycle implementation. It also consolidates duplicated teardown and HTTP response handling.

A durable-record-only check cannot reject a callback from a disconnected or replaced transport; canceling the provider's consult signal discards already accepted work. The synchronous owner fence and existing storage commit callback close those gaps without new configuration or schema. The focused close, disconnect, pending startup, replacement, queued-write, and accepted-work tests pass; independent P0–P2 review found no actionable defect. The review's recommended implementation is retained, with exact-head CI still required before landing. GPT-Live credential/entitlement limits and media-interruption follow-up remain explicit in the PR body.

@steipete
steipete merged commit e41c5b8 into main Aug 30, 2026
245 checks passed
@steipete
steipete deleted the codex/browser-talk-lifetime branch August 30, 2026 02:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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 P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

[Bug]: Closed browser Talk sessions can still admit provider delegations

1 participant