Skip to content

perf(talk): use published authority for foreign voice writes - #177533

Merged
steipete merged 4 commits into
mainfrom
dbasync/t1convfacts
Oct 19, 2026
Merged

steipete merged 4 commits into
mainfrom
dbasync/t1convfacts

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Creating a browser voice session with a foreign session store and an opaque commit callback re-reads the source database synchronously, although the source already has current published authority.

User Impact

Covered foreign session and membership checks use their existing publication owner without main-thread SQLite reads. Revoking membership or replacing the session during the native callback still rejects and rolls back the voice mutation. No configuration or migration is needed.

Why This Change Was Made

Use bound publication predicates in both voice writer modes. Ordinary worker writes retain their existing admission-once contract; opaque/native compositions recheck the published predicate after their original callbacks at the existing mutation and commit boundaries. Same-store predicates remain in the destination transaction. Unbound foreign predicates retain the native reader required by the supported generic SDK contract.

The removed branch tied publication use to worker-only admission. No SQL shape, schema, request, transaction envelope, or cross-store commit ordering changes. An already-admitted ordinary durable write may finish after source revocation; subsequent effects still reauthorize.

Production: +20/-6 lines (net +14); tests: +118/-29; documentation: +9/-7. The small retained predicate list is needed only for native callback compositions.

Evidence

  • Final cross-store voice and create-authority suites: 55 tests passed, including membership/session revocation before and after admission, native callback rollback, and an unchanged native success case.
  • Regression on the base fails specifically on the SQL-idle assertion: 11 executed source reads versus zero after the fix for each native revocation case; the unchanged-authority success case falls from 9 reads to zero. All run on the main thread and issue zero worker requests. Prepares are excluded from these statement counts (17/13 total SQLite API calls respectively).
  • Two independent Codex review rounds completed. The GitHub reviewer identified a hasOpaqueCheck-only foreign-wrapper routing gap. The regression reproduces a persisted voice record after revocation before the fix and proves native rollback afterward. Final routing selects native only when foreign published checks are retained; hasOpaqueCheck alone does not change ordinary same-store routing. All 11 cross-store cases and 44 creation-authority cases pass, including the three ordinary-route regressions caught during CI. The second local review was scoped-clean; the narrow CI correction was independently traced against caller and wrapper semantics.
  • Production and all 29 core-test typecheck groups, changed-file type-aware lint/format, runtime cycle checks, and T1/dialect ratchets passed. Madge reports zero cycles; export-collision checks pass. Exact-base runs reproduce the aggregate check’s three UI max-lines suppressions, two test-shard budgets, and single Matrix QA export finding; there are no added findings. Three alternating frozen-v3.1 baseline/candidate runs remain pending for the final lane head. The census does not exercise this opaque voice callback; its purpose here is warm-path non-regression, not attribution of a census-wide saving.

Final-head CI 39313354981, head 1fba80fe09c342fef2df373da413d950f6b3dff1, completed successfully: 37 jobs passed and 27 skipped. Both required CI gate entries are green. Source contracts, baseline ratchets, changed-boundary tests, production/test types, lint, and architecture checks pass. The earlier unrelated formatting failure is fixed on main and does not affect this run.

Authority review approved the final head, including the fail-closed guard: a publication predicate that is no longer admitted throws instead of allowing the effect. Its real-handler regression fails on the preceding head with a persisted voice record and successful response, and passes with rollback after the correction. It retains zero foreign-source SQL.

The frozen-v3.1 interim census covers two alternating pairs against a combined voice/conversation candidate, not this final head. Both revisions have causal warm medians of 51 SQL / 15 requests / 0 MAIN. Whole-workload medians are 3042.5 [3025–3060] SQL / 853 [844–862] requests / 101 [100–102] MAIN on base and 3050 [3040–3060] / 856.5 [853–860] / 100.5 [100–101] on the combined candidate. The +7.5 SQL / +3.5 requests remains unattributed, including candidate-correlated initial cleanup +5 SQL / +2 requests. The third baseline arm was interrupted and its candidate arm was unrun; neither is counted. Final three-pair proof remains outstanding. No whole-workload or latency saving is claimed; the targeted real-handler measurements above establish this PR's effect-time savings.

Use bound session and membership publication predicates when an opaque
callback selects the native voice writer. Keep the live predicate check
after callbacks at existing mutation and commit boundaries, so revoked
foreign authority still rolls back the mutation without native reads.

Keep same-store predicates in their transaction and preserve native
fallback for unbound SDK predicates. Ordinary worker writes retain the
existing admission-once contract.
@clawsweeper

clawsweeper Bot commented Oct 19, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T19:49:43.381525Z 1fba80f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: S labels Oct 19, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR uses existing published authority for foreign-store voice writes with native callbacks while retaining live revocation checks.

Example: Creating voice session admitted-membership from custom.sqlite while a native commit callback removes the caller's membership.

  • Before: Foreign authority is reread through SQLite before the voice mutation rolls back.
  • After: Published authority rejects the mutation without those source-validation SQLite calls, and no voice record commits.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported patch with useful production-owner integration coverage; proof remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) ✨ media proof bonus Sufficient (linked_artifact): For this maintainer-authored PR, the authority harness exercises the production Talk handler, real sharing revocation owners, and real voice persistence: unchanged authority succeeds, while callback-triggered membership removal and session replacement roll back persistence and deny the response. The reported focused run covers these cases; the provider is a fixture, and this is not a live browser or provider proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Browser voice creation with a foreign store and native commit callback performs avoidable synchronous database work on the Gateway thread.
Reason: The maintainer-authored direction removes measured redundant work through the existing owner while retaining callback rollback behavior and released SDK compatibility.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides a focused performance improvement that current main lacks, with no actionable code defect found; the required CI gate remains red.

Priority: P2
Reviewed head: e6e738cedfa7071ef183161d9f8c8318f79c478d

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Talk Gateway handler prepares caller and session authority, then passes it to the existing voice writer, which commits voice records and returns a result for authorized disclosure.

flowchart TD
  A[Talk client create request] --> B[Sharing authority owner]
  B --> C[Prepared source predicates]
  C --> D[Voice writer]
  D --> E[Native callback]
  E --> F[Live publication check]
  F --> G[Commit or rollback]
Loading

Technical review

Best possible solution:

Retain this small extension of the existing publication owner and resolve the required CI gate before landing.

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

Current main visibly routes opaque foreign authority through synchronous validation; the PR reports a base regression observing 17 SQLite API calls versus zero after the change, but no target code was executed during this review.

Is this the best way to solve the issue?

The patch is the smallest complete fix: reuse bound publications, retain their live checks for native compositions, and preserve transaction-local checks and the generic unbound SDK fallback.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Foreign voice publication admission changes intended behavior with a stated reason (11fcb67: Admit ordinary cross-store durable writes once using published sharing facts while retaining opaque native guards.)
  • Native callback and transaction compatibility keeps the original intent (31c35d5: Move voice writes to the worker while preserving synchronous SDK callback atomicity and physical-store authority.)
  • Existing authority regression table keeps the original intent (c3798ae: Consolidate test setup while retaining distinct authorization, lifecycle, ordering, and recovery contracts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +6, Tests +52, Docs +2. Total +60 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 11 5 +6
Tests 1 80 28 +52
Docs 1 9 7 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 100 40 +60

Review metrics

Metric Value Why it matters
Production versus test changes Production +11/-5; tests +80/-28 The small retained predicate list preserves native rechecks; test growth extends the existing table with distinct membership-revocation, session-replacement, and successful native cases.

Labels

Label changes:

  • add P2: Removes synchronous source-validation work from a limited foreign-store voice path without establishing an urgent user-facing regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Removes synchronous source-validation work from a limited foreign-store voice path without establishing an urgent user-facing regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 1:41 PM ET / 17:41 UTC.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6e738cedf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +169 to 174
if (admitPublishedSessionSource(check.predicate)) {
// Opaque guards keep live checks through native commit; ordinary writes admit once.
if (!canAdmitOnce) {
publishedChecks.push(check);
}
continue;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve native routing for opaque wrapper checks

When a bound foreign predicate is combined with an authority that has hasOpaqueCheck but neither nativeSource nor opaqueCommitGuard (for example, an unbound/native-compatibility Gateway request whose transport wrapper has no explicit callback), this branch removes the predicate from foreign and returns no nativeSource marker. mutateAuthorizedClientVoiceSession therefore takes the worker path even though PreparedSessionSourceAuthority.hasOpaqueCheck explicitly requires a native transaction, leaving a window between the final host admission callback and the worker commit in which transport authority can be revoked while the write still commits. Keep this case routed through the native writer, either by retaining the foreign/native marker or propagating hasOpaqueCheck into writer selection.

AGENTS.md reference: AGENTS.md:L64-L65

Useful? React with 👍 / 👎.

@steipete steipete Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 38cf544. When every foreign check uses published authority, native routing is retained only when published foreign checks remain; ordinary same-store and callback-absent requests keep worker preparation. This preserves the opaque foreign wrapper transaction and rollback contract without forcing ordinary creation onto native transactions. The same-store and cross-store real-handler suites pass all 54 cases, including membership/session revocation, wrapper rollback, and unchanged authority. Covered foreign authority checks execute zero main-thread SQL.

@steipete
steipete merged commit 2346b98 into main Oct 19, 2026
130 checks passed
@steipete
steipete deleted the dbasync/t1convfacts branch October 19, 2026 20:13
vincentkoc added a commit that referenced this pull request Oct 19, 2026
* commit '08e32fdb4df002c9d4eea158b855d6521dd1e916': (52 commits)
  test(gateway): restore local probe deferred import
  fix(agents): release prompt diagnostics for retired sessions (#177614)
  fix(release): tag restart plugin cohorts consistently (#177725)
  refactor(ui): inline single-caller detail requests (#177705)
  chore(i18n): refresh native locales (#177721)
  refactor(codex): drop unread private runtime reports (#177689)
  refactor(ui): consolidate static artwork registries (#177692)
  refactor(ui): derive settings schema analysis in the view (#177624)
  refactor(media): consolidate capability defaults and compression grids (#177665)
  refactor(auth): bind OAuth managers to native provider operations (#177676)
  refactor(ui): remove redundant component rendering layers (#177607)
  fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (#166082)
  fix(agents): report failed secret input prompt delivery (#177688)
  refactor(ui): share chat message render contracts (#177668)
  fix(ui): settle model status after overlapping publication (#177667)
  refactor(gateway): reuse native workspace and lifecycle facts (#177670)
  refactor(runtime): rely on canonical async lifecycle owners (#177635)
  refactor: fold private operation helpers into their callers (#177655)
  refactor(ui): remove unused chat leaf element adapters (#177582)
  perf(talk): use published authority for foreign voice writes (#177533)
  ...
vincentkoc added a commit that referenced this pull request Oct 19, 2026
#167350)

* fix(pr): retain the admitted workflow across maintainer commands

* fix: refresh the reviewed correction baseline

Baseline-Refresh: a89bd166b79d54b343b93ad374f8ebfa4f3d1163

* fix(pr): preserve cold workflow admission and repository identity

* chore(pr): integrate canonical main CI repair

* commit '08e32fdb4df002c9d4eea158b855d6521dd1e916': (52 commits)
  test(gateway): restore local probe deferred import
  fix(agents): release prompt diagnostics for retired sessions (#177614)
  fix(release): tag restart plugin cohorts consistently (#177725)
  refactor(ui): inline single-caller detail requests (#177705)
  chore(i18n): refresh native locales (#177721)
  refactor(codex): drop unread private runtime reports (#177689)
  refactor(ui): consolidate static artwork registries (#177692)
  refactor(ui): derive settings schema analysis in the view (#177624)
  refactor(media): consolidate capability defaults and compression grids (#177665)
  refactor(auth): bind OAuth managers to native provider operations (#177676)
  refactor(ui): remove redundant component rendering layers (#177607)
  fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (#166082)
  fix(agents): report failed secret input prompt delivery (#177688)
  refactor(ui): share chat message render contracts (#177668)
  fix(ui): settle model status after overlapping publication (#177667)
  refactor(gateway): reuse native workspace and lifecycle facts (#177670)
  refactor(runtime): rely on canonical async lifecycle owners (#177635)
  refactor: fold private operation helpers into their callers (#177655)
  refactor(ui): remove unused chat leaf element adapters (#177582)
  perf(talk): use published authority for foreign voice writes (#177533)
  ...

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
…w#177533)

Reuse current published foreign session and membership facts at voice mutation effects. Keep same-store checks in their destination transaction and reject unavailable published authority.

Covered native checks fall from 9 MAIN statements on success and 11 on revocation to zero, with no additional worker requests. Real-handler rollback and unavailable-authority regressions pass alongside 55 affected owner tests; final-head CI passes.

Whole-workload savings are not claimed; the rare voice effect is absent from the census workload.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
openclaw#167350)

* fix(pr): retain the admitted workflow across maintainer commands

* fix: refresh the reviewed correction baseline

Baseline-Refresh: a89bd166b79d54b343b93ad374f8ebfa4f3d1163

* fix(pr): preserve cold workflow admission and repository identity

* chore(pr): integrate canonical main CI repair

* commit '4f8617589b6c71d754171052b603fe534901bfa1': (52 commits)
  test(gateway): restore local probe deferred import
  fix(agents): release prompt diagnostics for retired sessions (openclaw#177614)
  fix(release): tag restart plugin cohorts consistently (openclaw#177725)
  refactor(ui): inline single-caller detail requests (openclaw#177705)
  chore(i18n): refresh native locales (openclaw#177721)
  refactor(codex): drop unread private runtime reports (openclaw#177689)
  refactor(ui): consolidate static artwork registries (openclaw#177692)
  refactor(ui): derive settings schema analysis in the view (openclaw#177624)
  refactor(media): consolidate capability defaults and compression grids (openclaw#177665)
  refactor(auth): bind OAuth managers to native provider operations (openclaw#177676)
  refactor(ui): remove redundant component rendering layers (openclaw#177607)
  fix(ios): model sign-in is a permanent row under the composer instead of an item in the model menu (openclaw#166082)
  fix(agents): report failed secret input prompt delivery (openclaw#177688)
  refactor(ui): share chat message render contracts (openclaw#177668)
  fix(ui): settle model status after overlapping publication (openclaw#177667)
  refactor(gateway): reuse native workspace and lifecycle facts (openclaw#177670)
  refactor(runtime): rely on canonical async lifecycle owners (openclaw#177635)
  refactor: fold private operation helpers into their callers (openclaw#177655)
  refactor(ui): remove unused chat leaf element adapters (openclaw#177582)
  perf(talk): use published authority for foreign voice writes (openclaw#177533)
  ...

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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