Repository navigation
feat(gateway): bind requests to selected profiles - #143587
Conversation
|
Codex review: blocked before merge. Reviewed September 13, 2026, 11:58 PM ET / September 14, 2026, 03:58 UTC (Revision 43). ClawSweeper reviewWhat this changesAdds optional profile-bound Gateway requests and recipient-stamped events, preserves accepted input ownership and receipts, and updates protocol clients, documentation, and validation fixtures. Merge readiness⛔ Blocked before merge - 5 items remain This remains a useful prerequisite for the native-action stack: current main and the latest release lack the selected-profile contract. No actionable introduced defect was found, and the captured body resolves the earlier custody-policy hold. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway receives authenticated requests from OpenClaw clients and dispatches them to session and agent owners. Profile binding checks the selected account while existing custody and authorization owners govern persistence, execution, and response delivery. flowchart TD
A[Authenticated client request] --> B[Selected profile check]
B -->|Mismatch| C[Explicit rejection]
B -->|Match or omitted| D[Session and run authorization]
D --> E[Input custody and transcript commit]
E --> F[Agent execution and original receipt]
F --> G[Guarded response publication]
D --> H[Recipient stamped events]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep profile selection in Gateway admission and publication, while original live session/run authority governs accepted work and its recorded outcome. Do we have a high-confidence way to reproduce the issue? Not applicable as a shipped-bug reproduction: this adds an opt-in contract absent from main and v2026.9.4; the inspected wire scenarios define its observable behavior. Is this the best way to solve the issue? Yes: extending existing dispatch, custody, and transcript owners is a coherent solution, with explicit capability negotiation and preserved unbound behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 65710d3e8bac. LabelsLabel 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 (42 earlier review cycles; latest 8 shown)
|
4d52f72 to
9d6f1d0
Compare
c9e90e5 to
06117e8
Compare
|
Merged via squash.
|
Carry the bounded consumed-snapshot, provenance, and include-boundary assertions from 3de18f6 (#143587). Preserve the observed snapshot and all existing writer/exclusion assertions. The hosted failure cause remains unresolved. Co-authored-by: Vincent Koc <[email protected]>
…47866) * refactor(runtime): probe SQLite startup capabilities in a worker Move current-runtime capability SQL off the main thread and share one pending result across launcher and runtime callers. Await worker exit before admission, preserve failure caching and Bun library selection, and retain the native SQLite SDK and foreign-runtime probe contracts. * test(config): expose include provenance in writer failures Carry the bounded consumed-snapshot, provenance, and include-boundary assertions from 3de18f6 (#143587). Preserve the observed snapshot and all existing writer/exclusion assertions. The hosted failure cause remains unresolved. Co-authored-by: Vincent Koc <[email protected]> --------- Co-authored-by: Vincent Koc <[email protected]>
* feat(gateway): bind requests to selected profiles Punchcard-Session: amber-timber-workshop-bk * test(gateway): verify profile-bound wire admission and replay Punchcard-Session: amber-timber-workshop-bk * fix(gateway): preserve idle presence during profile refresh Keep unchanged profiles out of presence writes while retaining explicit refresh and recipient preparation. Complete profile-bound test fixtures and regenerate the dependent Workboard asset pointers. Punchcard-Session: amber-timber-workshop-bk * test(gateway): repair context and loading-state fixtures Punchcard-Session: amber-timber-workshop-bk * test(gateway): verify instance retirement before agent dispatch Punchcard-Session: amber-timber-workshop-bk * test(gateway): verify session revocation during accepted steering Punchcard-Session: amber-timber-workshop-bk * chore(gateway): refresh embedded protocol assets * test(ui): await Inbox fixture preload * test(transcripts): bind Discord lifecycle fixture generation * test(gateway): drain task fixture notifications * fix(protocol): exclude profile ID primitive from generated registry * test(gateway): simplify subscription fixture state setup * test(gateway): preserve authority refusal through terminal admission * fix(gateway): retain live profile refresh after runtime extraction * test(agents): cover redaction with fresh transcript admission * refactor(gateway): inline release version checks * test(gateway): observe async runtime lease disposal * test(gateway): supply profile refresh callbacks in lifecycle fixtures * test(agents): assert recorder admission callback availability * test(gateway): model native profile fixture node subscribers * test(desktop): retain bounded viewer close diagnostics * test(ui): keep cloud history aligned with placement failure * test(ui): brace the desktop close bound
…enclaw#147866) * refactor(runtime): probe SQLite startup capabilities in a worker Move current-runtime capability SQL off the main thread and share one pending result across launcher and runtime callers. Await worker exit before admission, preserve failure caching and Bun library selection, and retain the native SQLite SDK and foreign-runtime probe contracts. * test(config): expose include provenance in writer failures Carry the bounded consumed-snapshot, provenance, and include-boundary assertions from 66ab4fd (openclaw#143587). Preserve the observed snapshot and all existing writer/exclusion assertions. The hosted failure cause remains unresolved. Co-authored-by: Vincent Koc <[email protected]> --------- Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Native actions need an atomic selected-account precondition and truthful receipts when an accepted request outlives a later account selection or connection change.
User Impact
Requests can bind to the intended profile at Gateway admission. New actions check the selected account; accepted work stays with its original session and admission while that captured authority remains valid. Revocation, cancellation, and host retirement still prevent later effects. Callers receive explicit rejection or the original accepted-run receipt instead of silently switching accounts.
The owner has accepted this custody contract for the native action stack. This resolves the previous product-discussion hold; current-head validation remains a separate landing gate. No new operator configuration or storage migration is introduced.
Why This Change Was Made
Use the existing Gateway admission and transcript persistence owners to carry accepted authority and original-run identity through completion. Runtime callbacks and private symbols are not serialized transcript message fields or SQLite schema changes.
The current signed head
76ee05c40b1c69e5e5a970d05a99d595420c11e4preserves the original PR ancestry and composes pinned maine2b0038cafd54c552874381e9026ae99b202f53f, including the landed wait and glyph-test repairs. This merge required no conflict edits. The admitted-authority guard, separate completion fence, completion tracking, session activity summaries, profile refresh, and normalized public errors remain intact.Related: #142950. This prerequisite precedes #143610 and #143615, then Ask #147668. The separate voice PR #143631 remains outside this landing sequence.
Credit is preserved for the original contributors, including Peter Steinberger's worker fixture and navigation corrections from #143666 and #144002.
Evidence
ac5559d30a8a9217e63e03407d97b7e7e1830709and preservation of all 79 prior feature/test payloads. The latest correction supplies the canonical subscription signal and profile-refresh mock in the two composed fixtures; production ordering and requirements are unchanged. The config test inspects its actual consumed snapshot and selected include leaf without changing reads, locks, retries, the 250 ms exclusion assertion or cleanup. The repair is test-only. Full feature delta remains production +489/-100 (net +389), generated clients +18, proof tooling +31, tests/support +3,052 and docs +44. Source reviews, formatting/privacy checks and scoped-clean P0–P2 autoreview passed before signed publication.59225a4e38e9376918019e03efdc5897408be4b0, with parentscf56057e5f8b276b4b2b84f18c22f7cedd736d71and this exact head76ee05c40b1c69e5e5a970d05a99d595420c11e4. This is PR-merge proof, distinct from the exact-source wire run below.chat.history.sessionInfobefore emitting the placement event. No assertion, timeout or runtime behavior was relaxed. Their broader E2E results are recorded separately below.e1ce9c01a27eeb7b44608d5e2967d8c7b81ff60e07b478abc846abe2340f2acf; receipt SHA25639f24cc43ba4d6cdd5d38a5f37130621819c22386f274f76361728f147258079. Successful output contains no failed-viewer close diagnostic; it proves neither the old disconnect cause nor zero socket closes. This is Ubuntu synthetic-worker proof with real node/SSH carriers and emulated mobile viewport, not physical-mobile or installer/cloud provisioning proof.76ee05c40b1c69e5e5a970d05a99d595420c11e4. Original-socket profile merge/rejected effects passed in 12,427 ms at 04:06:59.705 UTC; accepted custody/reconnect/profile mismatch passed in 11,017 ms at 04:07:10.635 UTC. Validator103851351563admitted this source under actual trusted toolingbd463dc1fed8e188c03443bb831c64c387dec016; workflow SHA2563936ffdac346aacf0f3e0f2e1613d3f591605a296a55e4838548319ceb9fef75. Full Gateway build passed before execution. The owning broad shard remained red with 393 passed, 8 failed and 7 skipped tests; named target success is not aggregate E2E success.Wider-suite disposition and follow-ups
The optional broad E2E run contains failed jobs and was retired after required target and completed failure receipts were captured. Its terminal workflow conclusion is
cancelled(04:25:10 UTC); only non-target Gateway 3/4 was still running at the guarded cancellation. No result is inferred for that incomplete shard. Required normal CI and the named wire pair are green; no global E2E success or blanket failure waiver is claimed.src/gateway/gateway.test.ts:914expects anError:prefix after canonical error normalization; the follow-up is to correct that expectation while preserving completion/status/configuration/health assertions. Discordtest/e2e/gateway-transcripts-discord-capture.e2e.test.ts:565fails provider reference identity before the agent/capture turn; diagnose the registry reuse predicate and provider instance without weakeningtoBe. Both reproduce independently without G1 at artifact sourcef0a202b31ccc01bca37d1e7f7349994014bd7476(job) and historical G10577f9d6b1c74e00c2aae14b54621efb511fb43e(job); the tests and 12 relevant owner modules are byte-identical. These two failures predate G1. The other three current failures are--plainstdout assertions after successful CLI exit. The fixture seeds a pending state-schema migration; nested model commands enter the default config guard, whose health persistence opens the shared SQLite worker. Its logger does not inherit the parent stderr-routing state, and Node workers route default worker stdout to parent stdout. All 27 relevant owner/test blobs match no-G1 maine2b0038cafd54c552874381e9026ae99b202f53fand fb8; worker persistence PR147256 predates all three heads. This is an inherited diagnostic-routing mechanism outside G1 admission, not a retained no-G1 runtime reproduction or logged emitting-thread identity. Named follow-up: propagate CLI stderr diagnostic routing into SQLite workers; preserve the exact stdout assertion.compactionStartedAt. These failure classes repeat the prior fb8 run; repetition alone does not establish a baseline or harmlessness. Native-hook output records abwraploopback permission error, not a Codex dependency verdict. Remaining owner/cause limits are preserved.Runner failedvisibility and website iframeService detailsvisibility. Both named cases passed in current normal CI above. Both use browser MockWebSocket with no passthrough, so their chat/session RPCs do not execute the changed Gateway authority handlers. The touched cloud fixture now updates failed history and list coherently before the event. Its equal queued/resumed/failed timestamps predate G1 in0278bf26e9901b90ff45e0dc0b39baadf1af1357; the row owner rejects an inactive snapshot at or before an active row timestamp. Record cloud fixture ordering/timestamp fidelity as a follow-up, without claiming the unavailable triggering row/order. The website follow-up is iframe navigation after mobile split restoration. Retained failures show connection/document completion but lack row/response/iframe-navigation evidence; no browser-load cause, flakiness or exact M-byte equivalence is claimed.test/system-agent-managed-auth.e2e.test.ts:130expects “Let's hatch a new agent” and receives canonical “Let's create an agent”; this precedes credential-rotation assertions and does not establish a provider-key defect. The named follow-up is to align the welcome fixture with the canonical producer.test/e2e/qa-lab/runtime/webhooks-taskflow-cancellation-authz.e2e.test.ts:680receives two identicalturn/interruptrecords forthread-process-1/turn-process-1, rather than one; diagnose the cancellation owner without weakening the assertion or inferring successor confusion. Both observations match historical fb8 Gateway 1/4, where the NewAgent action and session ID matched and only the reply differed. The other current failures are the synthetic refusal continuation case at line 218 and isolated quota-reset recovery; the exact quota assertion frame is unverified. Follow-ups retain those original failed cases and missing first-boundary evidence. The same job reports an unhandledACP_BACKEND_MISSINGatregistry.ts:100; Vitest's last-file attribution does not identify its originating thread or cause. No Codex, backend or dependency verdict is made.Historical qualification stays attached to its source. The 0577 wire pair and fb8 wire pair also passed 2/2; their wider failures remain historical. The old fb8 normal run exposed the two now-corrected fixture omissions and the unexplained include refusal. Its prior desktop artifact remains distinct from the current archive above. Superseded old-source workflows were retired only after relevant receipts were captured.
Native artifacts for the earlier
b3bceecfintegration were populated after publication; that sequencing gap remains recorded. Current repair source reviews preceded publication. Current required qualification and the ClawSweeper proof/disposition requests are complete. Broader failure causes still marked unknown remain named follow-ups, not a claim of global E2E success. Native prepare/merge owns fresh head, review, gate and mergeability admission; the dependent native/installed-action proof remains with its own PRs.