Skip to content

fix(talk): retain selected targets and transcript ownership - #142293

Closed
roboclaw-bot wants to merge 4 commits into
openclaw/pr138726-split-p-auth-uifrom
openclaw/pr138726-split-t-target
Closed

roboclaw-bot wants to merge 4 commits into
openclaw/pr138726-split-p-auth-uifrom
openclaw/pr138726-split-t-target

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #138726

What Problem This Solves

Fixes an issue where Talk readiness or an unqualified chat key could use the ambient Talk agent instead of the selected owner. Native delegation also needs to remain distinct from transcript persistence ownership.

Why This Change Was Made

Carry the selected target through schema validation, authorization and revalidation, and advertise the target capability only when the complete method contract is available. Project transcript and control ownership from negotiation and regenerate the Swift decoder alongside the schema.

User Impact

Selected-agent catalog readiness and allocation use the same owner without changing global settings reads or silently rewriting opaque keys. Catalog support is not permission: session mutation still uses the existing authorization boundary. New auth/control metadata remains optional, and session-ID operations keep their existing ownership.

Evidence

  • The A-owned talk-client-metadata handshake capability gates the three new response fields. T extends the existing projection without redefining it or duplicating matrices.

  • At the T source stage: four legacy failures before repair; 15 focused metadata/target/readiness cases passed afterward.

  • The combined protocol candidate passed 120 Talk + 61 protocol + 15 unchanged secret-owner tests, plus canonical changed-file typecheck/lint/dead-export gates. These are combined-source receipts, not separate builds of every prefix.

  • The redundant catalog cast was removed after reproducing ratchet 6 > 5; the real validator narrows the type. No baseline increase.

  • Compatibility claim: v2026.9.3 generated OpenClawProtocol decoder, not a blanket iPhone/Watch failure. The older offerResponseMaxBytes incompatibility remains named follow-up TALK-LEGACY-SDP-BOUND; browser bounds are not weakened. Swift generation is not Swift compilation.

  • The exact integrated T tree (including the four UI inputs) passed canonical core production and core test-type lanes, both exit 0. Recorded input hashes matched after validation.

Validation source tree: commit c47ea188f41d77354b259e5d74e178a802ed9ab0. The local evidence above has its stated scope.

Data-model and upgrade compatibility

Scope: base 7e1d4058d4c220f2dce9ff853a47173a2a221a28 → head c47ea188f41d77354b259e5d74e178a802ed9ab0.

The changed packages/gateway-protocol/src/schema/channels.ts is the TypeBox RPC request/response contract, not a SQLite schema. This delta adds optional target inputs and optional WebRTC response metadata. It introduces no table, column, index, stored-record version, database-schema version, or storage migration.

Storage tracing: optional agentId/sessionKey inputs pass through prepareTalkSessionTarget and the existing sharing/revalidation boundary to an existing canonical agent/session/store identity. Transcript and close handlers then use the existing voice-record and transcript APIs. client-voice-session-store.ts, client-voice-session.ts, openclaw-agent-schema.sql, and config/sessions/session-accessor.ts are byte-identical between the base and head. Durable voice records remain version 1 in the existing cache_entries scope talk-client-voice-sessions; the three negotiated reply fields are not added to that stored format. The settings correction writes the existing talk.realtime.providers.<provider>.authMethod path, not a new configuration format.

Upgrade-contract coverage:

  • Existing requests → updated Gateway: target fields remain optional. The tested legacy-style create requests omit agentId, and the targeted/global catalog regression preserves the meaning of an empty catalog request.
  • Legacy versus opted-in responses: the eight-case matrix in src/gateway/server-methods/talk.test.ts covers native delegation × Gateway control × metadata support. Without talk-client-metadata, it checks the legacy response-key contract and omits authMethod, controlSource, and transcriptOwner. With the capability, it checks the expected metadata and validates the response with the current protocol validator. Both branches preserve clientControl and provider-owned authentication facts.
  • The released v2026.9.3 generated decoder at 1391f7cd2d40ab5bbcf2f5f831d3a64f520e72d7 was inspected: it explicitly rejects unknown keys. Four legacy cases failed before the T repair; the repaired T stage passed all 15 focused metadata/target/readiness cases. The published head has the same Gateway/protocol inputs. Both canonical core production and core test-type lanes passed on its identical full tree db220862d4fd8525391e89d2a98a7f1590a0fcde. The combined 196-test receipt remains supporting combined-source evidence, not a separate exact-T full-suite run.

The earlier evidence above is wire-upgrade contract proof, not an executed released Swift binary or native-device/live-provider test. The new exact-head database reopen/restart evidence is recorded below. It does not claim a new client can send unsupported target fields to an older Gateway; explicit targeting has the separately advertised talk-session-target-v1 server contract.

Known pre-existing limitation: real OpenAI descriptors can still include offerResponseMaxBytes, which the released generated decoder also rejects. That remains the named TALK-LEGACY-SDP-BOUND follow-up. Removing it here would weaken existing browser SDP-bound behavior. The compatibility claim is that this PR's new metadata regression is fixed—not that every real OpenAI descriptor works with the old decoder.

Controlled-close authorization follow-up

Fix 108dc7c checks the already-authorized agent before controlled-owner teardown. Connection/key checks and legacy revalidation remain.

  • Before (65cd5b7): 2 regressions failed, 47 cases passed. Wrong-agent requests reached owner/provider teardown and persisted a closed session, including after direct access to that session was denied.
  • After: 279/279 cases pass on this T head; 288/288 overlapping cases pass on stack top 1b16709. Valid closes still succeed. Core/test types and changed-file lint pass.
  • Boundary: real Gateway authorization and local session records, instrumented test provider—not live external-provider or device evidence. Full check:changed remains blocked by the unchanged SDK expiry baseline; no CI pass is claimed.

Exact-head retained-state compatibility — September 10, 2026

Source: T 108dc7c; base P 32cbef2; released v2026.9.3 at 1391f7c.

  • Actual retained SQLite state: six isolated producer/reader processes passed. The released implementation and P each wrote a version-1 voice record with their real database/store APIs; a separate T process reopened, read and rewrote each record. Fresh T followed by a new T process also passed. Stored fields and canonical agent/session identity were retained; database version 19 and the full SQLite schema hash stayed unchanged. No storage migration was added or needed for this delta.
  • Owner isolation: three further real-reader processes passed. The original agent could retrieve its retained record; a different agent could not. Wrong-agent/key ownership and unsupported future record-version checks also passed.
  • Legacy requests: eight request shapes validated by each previous-version schema were accepted by the real T validator (16 cases). Optional new targeting remained valid on T; unexpected fields were rejected. Real connection-local binding functions kept identical opaque chat keys separate by agent, preserved conditional-close ownership and did not carry a binding into a new connection. Protocol validation is not authorization: the separately bound exact-T 279/279 handler-test receipt remains the authorization evidence, not a newly rerun suite.

All 847 materialized source files and dependency-manifest bindings were independently checked against the pinned revisions. The durable store/schema implementations are unchanged; the connection-local binding-key change is not a persisted database format.

Limits remain explicit: an initially broader response probe failed on offerResponseMaxBytes. Follow-up characterization reproduced that strict-schema rejection on release, P and T: the existing TALK-LEGACY-SDP-BOUND limitation, not a new all-descriptor compatibility claim. Both legacy response shapes remain accepted. Optional new response metadata still requires the handshake capability described above. These probes did not execute a released Swift binary, physical-device/live-provider session, or fresh GitHub CI.

Worked on by:

Carry the selected agent through Talk authorization, allocation, and revalidation. Advertise the complete target contract and project transcript ownership independently from native delegation.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime extensions: openai size: L maintainer Maintainer-authored PR labels Sep 8, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 8, 2026 15:53
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 10, 2026, 11:07 AM ET / 15:07 UTC (Revision 11).

ClawSweeper review

What this changes

Preserves the selected agent across Talk readiness, call creation, transcripts, and cleanup, and adds negotiated transcript-ownership metadata to the Gateway protocol and Swift models.

Merge readiness

⛔ Blocked before merge - 1 item remains

The repair remains useful and is absent from current main. All three earlier findings are resolved, and the updated retained-state evidence clears the generic migration blocker. No new actionable defect was found.

Priority: P2
Reviewed head: 108dc7c6b69aefdee70e18029d28d55cbef996ae

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with resolved prior findings, meaningful boundary coverage, and adequately scoped upgrade evidence.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor gate does not apply to this bot-authored PR. Reported exact-head Gateway rejection and teardown observations address the earlier authority defect, while real SQLite reopen observations address retained-state compatibility; neither is claimed as live-provider or native-device proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor gate does not apply to this bot-authored PR. Reported exact-head Gateway rejection and teardown observations address the earlier authority defect, while real SQLite reopen observations address retained-state compatibility; neither is claimed as live-provider or native-device proof.
Evidence reviewed 11 items Pinned scope and live state: The local introduced-file list matches the supplied merge-base-to-head scope. GitHub REST confirms the PR remains open and unmerged at the pinned head, assigned to IWhatsskill, targeting the preceding settings layer.
Current-main necessity: Current main still accepts only the session key in Talk target preparation and resolves unqualified keys through the ambient Talk owner; it lacks this branch's explicit selected-agent input.
Release comparison: The supplied latest release also has the two-argument target resolver without explicit selected-agent support. No implemented-on-main or shipped-fix closure is supported.
Findings None None.
Security None None.

How this fits together

Talk connects voice clients to provider sessions and OpenClaw agents. The Gateway resolves and authorizes the selected conversation, then routes consultation, transcript storage, and call cleanup to that owner.

flowchart LR
  A[Voice client and selected conversation] --> B[Capability negotiation]
  B --> C[Resolve agent and session]
  C --> D[Authorize and revalidate]
  D --> E[Provider voice session]
  D --> F[Agent transcript store]
  E --> G[Owner-bound call cleanup]
  F --> G
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +65, Tests +678, Docs +11, Other +56. Total +810 across 24 files.

View PR surface stats
Area Files Added Removed Net
Source 11 97 32 +65
Tests 11 695 17 +678
Docs 1 18 7 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 1 58 2 +56
Total 24 868 58 +810

Review metrics

Metric Value Why it matters
Wire negotiation 1 server capability; 2 optional response fields Target support and transcript ownership are negotiated without extending legacy client responses unconditionally.

Stored data model

Persistent data-model change detected: unknown-data-model-change: packages/gateway-protocol/src/schema/channels.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one authorized conversation identity throughout the call, with capability-gated metadata and unchanged durable voice-record compatibility.

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

Yes, from source: an unqualified conversation key follows the ambient Talk owner on current main, while selected-agent readiness needs that explicit owner. Runtime regressions are reported in the PR but were not executed during this review.

Is this the best way to solve the issue?

Yes. The patch extends the existing target-resolution and authorization flow, preserves global catalog semantics, and gates metadata instead of introducing competing ownership or persistence mechanisms.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2872da666dba.

Labels

Label justifications:

  • P2: This is a bounded repair to multi-agent Talk targeting and call ownership.
  • 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: The ordinary external-contributor gate does not apply to this bot-authored PR. Reported exact-head Gateway rejection and teardown observations address the earlier authority defect, while real SQLite reopen observations address retained-state compatibility; neither is claimed as live-provider or native-device proof.

Evidence

What I checked:

  • Pinned scope and live state: The local introduced-file list matches the supplied merge-base-to-head scope. GitHub REST confirms the PR remains open and unmerged at the pinned head, assigned to IWhatsskill, targeting the preceding settings layer. (108dc7c6b69a)
  • Current-main necessity: Current main still accepts only the session key in Talk target preparation and resolves unqualified keys through the ambient Talk owner; it lacks this branch's explicit selected-agent input. (src/gateway/talk-session-target.ts:20, 2872da666dba)
  • Release comparison: The supplied latest release also has the two-argument target resolver without explicit selected-agent support. No implemented-on-main or shipped-fix closure is supported. (src/gateway/talk-session-target.ts:20, 1391f7cd2d40)
  • Earlier ownership findings resolved: Connection-local legacy bindings now include agent identity. Controlled close compares the authorized agent, exact voice key, and connection before invoking owner teardown; the handler revalidates before this call and before legacy fallback. (src/gateway/talk-client-gateway-control.ts:650, 108dc7c6b69a)
  • Forbidden-principal and revoked-access coverage: The inspected regression exercises real Gateway authorization and local voice records with an instrumented provider. Wrong-agent closes, including after owner access is revoked, must leave teardown uncalled and records open; correctly targeted closes must succeed. The captured PR body reports two pre-fix failures and 279 passing cases on this head; these were not rerun during review. (src/gateway/server-methods/talk-target.test.ts:182, 108dc7c6b69a)
  • Legacy metadata finding resolved: New transcriptOwner and controlSource response fields require the existing metadata handshake capability. The expanded eight-case response matrix checks legacy keys and negotiated ownership independently of native delegation. (src/gateway/server-methods/talk-client-create.ts:432, 108dc7c6b69a)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-08T19:46:27.564Z sha c47ea18 :: blocked before merge. :: none
  • reviewed 2026-09-08T20:17:54.580Z sha c47ea18 :: blocked before merge. :: none
  • reviewed 2026-09-08T22:26:22.397Z sha c47ea18 :: blocked before merge. :: none
  • reviewed 2026-09-08T23:25:20.184Z sha c47ea18 :: blocked before merge. :: [P2] [P2] Include the selected agent in legacy voice-session bindings
  • reviewed 2026-09-09T10:08:28.376Z sha 65cd5b7 :: needs real behavior proof before merge. :: [P1] [P1] Match the authorized agent before closing a controlled call
  • reviewed 2026-09-09T15:14:17.238Z sha 108dc7c :: blocked before merge. :: none
  • reviewed 2026-09-09T15:25:00.368Z sha 108dc7c :: blocked before merge. :: none
  • reviewed 2026-09-09T20:10:07.180Z sha 108dc7c :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Sep 8, 2026
Integrate the reviewed owner-scoped repairs and updated stack prerequisite.
The resulting source tree is identical to the validated private T candidate.
Preserve the original published head as a merge parent; no existing commit is rewritten.

Worked on by:
- @IWhatsskill

Co-authored-by: IWhatsskill <[email protected]>
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 8, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper explain

The current exact-head review has a readiness inconsistency that needs clarification: its technical assessment accepts the canonical target/authorization flow and negotiated metadata; its evidence confirms unchanged durable formats and supports clearing the earlier generic migration request; its label explanation says there is no concrete contributor-facing blocker. Yet Before merge and the machine review-state remain blocked solely on data-model compatibility proof.

The current Evidence section records unchanged canonical SQL, voice-record/parser/accessor formats, the legacy/opted-in response matrix, and the exact scope of the retained tests/typechecks. It also preserves the older SDP-bound limitation rather than claiming universal released-decoder compatibility.

What specific missing data shape or upgrade scenario still blocks this delta, or how should the remaining gate be reconciled with the accepted technical evidence? No proof or CI waiver is requested; current CI and the separate F2 owner contract remain independent prerequisites.

@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper status:

  • Current PR: 142293
  • Branch: openclaw/pr138726-split-t-target
  • ClawSweeper PR: no
  • Automerge: not-enabled
  • Automerge job: jobs/openclaw/inbox/automerge-openclaw-openclaw-142293.md
  • Merge state: UNKNOWN
  • Checks: SUCCESS:7 SKIPPED:6

@openclaw-barnacle openclaw-barnacle Bot closed this Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Sep 8, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Sep 8, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Sep 8, 2026
Include the resolved agent ID in connection-local legacy voice binding keys
and migrate create, consult, close, and deferred cleanup callers together.
Cover shared unqualified keys across agents without changing durable storage,
legacy session identity, TTL, or compare-before-delete behavior.

Co-authored-by: IWhatsskill <[email protected]>
Worked on by:
- @IWhatsskill
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 9, 2026
Check the prepared target agent before closing its Gateway-controlled call.
Retain connection and exact voice-key ownership checks, and revalidate
request authority before teardown and before the legacy close fallback.
Cover cross-agent close attempts with live and revoked target access.

Co-authored-by: IWhatsskill <[email protected]>
Worked on by:
- @IWhatsskill
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 9, 2026
@roboclaw-bot roboclaw-bot reopened this Sep 9, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Closing this PR in favor of a planned rebuild on current main.

@RomneyDa
RomneyDa deleted the openclaw/pr138726-split-t-target branch October 22, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation extensions: openai gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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.

2 participants