Repository navigation
feat(gateway): advertise chat input custody contract - #180651
Conversation
Advertise the existing queue-mode and exact input-receipt transport shape without promising permission, consumption, or backend injection. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesAdds and documents chat-input-custody-v1 in Gateway hello capabilities. Example: An independently versioned chat client connects to the Gateway.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: the focused implementation has no actionable introduced defects, while adoption of the public discovery contract awaits an owner decision. Priority: P3 Decision needed
Before merge
FindingsNone. Agent review detailsHow this fits togetherThe WebSocket hello owner consumes authenticated connection state and the shared capability registry, then sends clients server features and effective scopes. flowchart LR
A[Chat client] --> B[Connect authentication]
B --> C[Hello owner]
D[Capability registry] --> C
C --> E[Hello response]
E --> A
A --> F[Chat send and history RPCs]
Technical reviewBest possible solution: If the owner accepts the transport-only discovery contract, retain this minimal registry-and-hello implementation with the documented permission and consumption limits. Do we have a high-confidence way to reproduce the issue? This is an additive discovery feature; source inspection confirms the marker is absent on fetched main, and the supplied exact-head Gateway trace demonstrates its advertisement. Is this the best way to solve the issue? The patch is the smallest complete implementation using existing owners: one shared constant, one hello entry, a focused protocol regression, and matching documentation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cd3bcc017653. TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +3, Tests +9, Docs +26. Total +38 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 26, 2026, 1:18 PM ET / 17:18 UTC (Revision 2). |
|
The requested real-Gateway proof is now in the PR's Evidence section, including the actual sanitized hello/RPC trace and downloadable reproduction artifacts, tied to unchanged head
The PR is ready for review, not merge-approved. Maintainer decision requested: should @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Advertise the existing queue-mode and exact input-receipt transport shape without promising permission, consumption, or backend injection. Co-authored-by: Copilot App <[email protected]>
What Problem This Solves
Independently versioned chat clients cannot discover the existing queue-mode and exact input-receipt contract without guessing from a protocol version or an unrelated capability.
This is an additive compatibility-contract feature, not a fix for a demonstrated data-loss or model-steering bug. The regression below proves missing discovery before the change and correct advertisement afterward; it does not prove that the marker itself repairs queue execution.
User Impact
Clients can check
hello-ok.features.capabilitiesforchat-input-custody-v1before offering the existingchat.send.queueModeandchat.history.inputRunIds/inputReceiptscontract. If absent, support is unknown and the client retains its existing send behavior.The marker is not permission, active-backend injection availability, acknowledgment-as-consumption, or permanent exactly-once delivery. Requested scopes are not increased. No new RPC, protocol version, queue policy, backend, migration, bundled UI or consumer implementation is added.
Why This Change Was Made
The existing server capability registry and hello owner are the discovery boundary. One constant and one hello-array entry expose the transport contract; the owner regression also checks unchanged read-only scopes. The handshake documentation explains pending versus consumed receipts, bounded idempotency, and retention of uncertain input.
At upstream main
6c672d42f2dec42b7917f34dfe5ae8157b9b0abb(2026-10-29), both the capability registry and hello response still omit this marker. The existingchat-send-routing-contractis not this input-custody discovery contract. No current-main code was substituted for the tested historical base.Evidence
Exact source and before/after regression
Ready for review, not merge-approved. Head remains
9c51b90ab5677c9fbae03a8a403d66d4df581c5b, tree4558ea5743235ed344de40d93145675eeb107fcd; parent/tested production base is776c8da8f06c6ed244b8ce22ea33165e4463f23b. No code changed or runtime was restarted for this description refresh.The same
advertises input custody without changing negotiated scopesregression and command were used on both sides. Test-file SHA256 was0FC3C374ABE9B8DE48513DE1492330E1E36A7A5FBAF0E822161542C281C5ACFCin both runs and matches the committed head.$HOOK_REPORTERrepresents the same passive hook-timestamp reporter's private filesystem path, omitted from this public description; it changes no assertions.776c8da8production plus only the identical new testchat-input-custody-v1; not a setup failure.9c51b90aauth.scopesremains["operator.read"]. This run preceded the commit; the recorded file hashes match the committed bytes.Supporting validation at the fixed revision
node scripts\run-vitest.mjs run src\gateway\server\ws-connection\connect-hello.update-scope.test.ts packages\gateway-protocol\src\schema\logs-chat.test.ts --maxWorkers=1node scripts\run-tsgo.mjs -p test\tsconfig\tsconfig.core.test.gateway-server.json --noEmit --incremental --tsBuildInfoFile "$TASK_CACHE\marker-types.tsbuildinfo"node scripts\run-oxlint.mjs --tsconfig tsconfig.json packages\gateway-protocol\src\server-capabilities.ts src\gateway\server\ws-connection\connect-hello.ts src\gateway\server\ws-connection\connect-hello.update-scope.test.tspnpm exec oxfmt --check packages\gateway-protocol\src\server-capabilities.ts src\gateway\server\ws-connection\connect-hello.ts src\gateway\server\ws-connection\connect-hello.update-scope.test.ts docs\gateway\protocol\handshake.mdpnpm run build ciArtifacts9c51b90a, unsigned token-authenticatedtest/backendclient (2026-10-26)users.selfrejected withFORBIDDEN/MISSING_SCOPE. This tests advertisement and the unchanged authorization boundary only.9c51b90a(2026-10-29)chat.sendcases passed hello/self/model, ack/matching final/history/provider and stored-byte length/SHA256 checks after verified quiescence. Input sizes: 3, 131, 2 and 68 bytes. This is supplementary actual behavior, not proof of backend steering or the marker's causal effect on storage.Live-05 used only task-owned resources and a synthetic loopback provider, with the original native request bytes preserved except five routing identities. All owned processes are gone and its one-use permission is revoked. Public-safe frozen proof digests: terminal
56C4FE039ECEDDA8597F2BFD7E742865DDB9E24053DCDE193AF5C009AD6ADA9E, aggregate4649B8E9BF754CCD19423ADB4ADBC0FF4374EDE232D3EC460F803C38D20786B6, independent postcheckA98115F9A1A1A881655B3D6622E4639D69EAAA5C45AA29B4830142EEC16E8D56. No private logs, credentials or machine dumps are attached.Remaining limits and merge blockers: no current-main integration/rebase execution, Windows UI/adopting-consumer proof, or live backend injection/exactly-once guarantee is claimed. Earlier deferred-custody attempts timed out or failed setup and remain failures; live-01 through live-04 remain BLOCKED, not retroactively upgraded. Live-05 does not replace those deferred-custody tests. The observed legacy
openclaw/security-sensitive-reviewand aggregate status still require a maintainer's exact-head approval; normal CI successes do not replace that approval. A maintainer must also accept this stable transport-discovery contract. No merge, release or CI rerun is requested here.Actual real-Gateway terminal output — exact PR head
The probe started the built production CLI with fresh isolated state and a task-generated token, waited for readiness, and made real WebSocket requests. The following is captured output, not a constructed response; only selected wire fields are retained to omit credentials and volatile connection identities.
Readiness follow-up — November 2, 2026
The PR is non-draft and GitHub reports no merge conflicts at unchanged head
9c51b90ab5677c9fbae03a8a403d66d4df581c5b. ClawSweeper's exact-head review reports no code findings, with diamond-lobster proof confidence and patch quality; its lower overall rating concerns the outstanding maintainer contract decision, not a code defect. Existing exact-head proof above remains applicable.The latest PR CI run failed only the Android third-party unit-test job:
NodeRuntimeAgentSelectionTest.coldStartUsesAnAllowedAgentBeforePatchingTheGatewayDefaulttimed out after 2,000 ms (3,769 tests, one failure). The four-file change does not modify Android sources or test/build inputs; the additional legacy security/aggregate red statuses still reflect the separately documented maintainer approval requirement. The automated failure report classified the Android failure as unknown because its then-current scheduled-main comparison had no comparable result; no matching-signature baseline claim is made.A rebase is deferred under the requested allowance for unrelated main failures: the newest completed scheduled-main CI is red in UI E2E shards 1/7 and 4/7 and Node compact-small shards 4 and 42. This is not a claim that the Android timeout is repaired or that all checks are green. The maintainer public-contract decision and exact-head security approval remain before merge. No merge or CI rerun was performed.