docs: document gateway client API contracts#89383
Conversation
a3dce23 to
020a659
Compare
|
Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 7:55 PM ET / 23:55 UTC. Summary Reproducibility: not applicable. this is a source-comment documentation PR rather than a bug report or runtime behavior change. The relevant checks are contract accuracy, branch mergeability, owner approval, and the contributor's after-patch validation evidence. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch, then have Gateway and security-aware maintainers approve, narrow, or split the source-contract comments before merge. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a source-comment documentation PR rather than a bug report or runtime behavior change. The relevant checks are contract accuracy, branch mergeability, owner approval, and the contributor's after-patch validation evidence. Is this the best way to solve the issue? No, not merge-ready as-is: source comments are an appropriate place for non-obvious Gateway invariants under AGENTS.md, but the breadth of compatibility wording and the dirty branch need Gateway-aware maintainer handling first. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 18b2ff683fd3. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (1 earlier review cycle)
|
7e2d8a0 to
0430f0a
Compare
f4a63e8 to
a2474b9
Compare
87f06c8 to
84e54dd
Compare
29a52ba to
de6f18a
Compare
c0e8d66 to
30348b6
Compare
|
Closing this broad source-comment sweep. It changes 113 fast-moving Gateway files and is conflicting; even with strong test proof, reviewing this many maintainer-facing contract claims as one unit is not reliable or worth the compatibility burden. The maintainable alternative is a narrow current-main PR for one Gateway contract at a time, reviewed with its callers, tests, and owner boundary. A new focused PR would be welcome with that scope and proof. |
Summary
Verification
git diff --checkpnpm test packages/gateway-client/src/client.watchdog.test.ts packages/gateway-client/src/timeouts.test.ts src/gateway/client.test.ts src/tui/gateway-chat.test.tspnpm test src/gateway/device-auth.test.ts src/gateway/node-command-policy.test.ts src/gateway/gateway-misc.test.tspnpm test src/gateway/mcp-http.test.ts src/gateway/gateway-cli-backend.live-probe-helpers.test.tspnpm test src/gateway/node-pairing-auto-approve.test.ts src/gateway/server.node-pairing-auto-approve.test.ts src/gateway/server.node-pairing-authz.test.tspnpm test src/gateway/gateway-misc.test.tspnpm test src/gateway/probe-auth.test.tspnpm test src/gateway/session-transcript-key.test.tspnpm test src/gateway/server-session-key.test.ts src/gateway/server-methods/artifacts.test.ts src/gateway/server-methods/sessions.abort-agent-scope.test.tspnpm test src/gateway/session-utils.test.tspnpm test src/gateway/operator-approvals-client.test.ts src/agents/tools/gateway.test.ts src/gateway/server/ws-connection/message-handler.post-connect-health.test.tspnpm test src/gateway/hooks.test.ts src/gateway/server.hooks.test.ts src/security/audit-hooks-routing.test.tspnpm test src/gateway/call.test.ts src/cli/command-path-policy.test.tspnpm test src/gateway/method-scopes.test.ts src/agents/tools/gateway.test.tspnpm test src/commands/doctor-gateway-auth-token.test.ts src/commands/status.scan.config-shared.test.ts src/security/audit-gateway.test.ts src/commands/doctor-security.test.tspnpm test src/gateway/startup-auth.test.ts src/pairing/setup-code.test.ts src/gateway/call.test.tspnpm test src/gateway/http-common.test.ts src/gateway/http-common.fuzz.test.tspnpm test src/gateway/http-utils.request-context.test.ts src/gateway/http-utils.authorize-request.test.ts src/gateway/http-endpoint-helpers.test.tspnpm test src/gateway/http-endpoint-helpers.test.ts src/gateway/openai-http.test.ts src/gateway/openresponses-http.test.ts src/gateway/embeddings-http.test.tspnpm test src/gateway/server-request-context.test.ts src/gateway/control-ui.http.test.tspnpm test src/gateway/plugin-channel-reload-targets.test.ts src/gateway/server-aux-handlers.test.tspnpm test src/gateway/server-cron-notifications.test.ts src/gateway/server.cron.test.tspnpm test src/gateway/server-model-catalog.test.tspnpm test src/gateway/channel-status-patches.test.ts src/gateway/openai-http.test.ts src/gateway/openresponses-http.test.tspnpm test src/gateway/channel-health-policy.test.ts src/gateway/channel-health-monitor.test.ts src/gateway/server.health.test.ts src/gateway/server-methods/channels.status.test.tspnpm test src/gateway/call.test.ts src/gateway/client-bootstrap.test.ts src/commands/status.scan.shared.test.ts src/cli/capability-cli.test.tspnpm test src/gateway/config-reload.test.ts src/gateway/server-methods/config.test.ts src/gateway/server-methods/config.shared-auth.test.tspnpm test src/gateway/model-pricing-cache.test.ts src/gateway/server-runtime-services.test.ts src/commands/health.test.tspnpm test src/gateway/mcp-http.test.ts src/gateway/gateway-cli-backend.live-probe-helpers.test.ts src/agents/cli-runner/prepare.test.tspnpm test src/gateway/control-ui-csp.test.ts src/gateway/control-ui.http.test.tspnpm test src/gateway/control-ui-routing.test.ts src/gateway/control-ui.http.test.tspnpm test src/commands/onboard-helpers.test.ts src/commands/dashboard.test.ts src/cli/daemon-cli/status.print.test.tspnpm test src/gateway/control-ui-routing.test.ts src/gateway/control-ui.http.test.ts src/commands/onboard-helpers.test.ts src/commands/status.scan.shared.test.tspnpm test src/gateway/auth-mode-policy.test.ts src/gateway/startup-auth.test.ts src/commands/gateway-install-token.test.tspnpm test src/commands/doctor-gateway-auth-token.test.ts src/commands/gateway-install-token.test.tspnpm test src/commands/status.scan.config-shared.test.ts src/commands/doctor-security.test.ts src/security/audit-gateway.test.tspnpm test src/gateway/client-bootstrap.test.ts src/gateway/call.test.ts src/gateway/operator-approvals-client.test.tspnpm test src/gateway/chat-sanitize.test.ts src/gateway/server-methods/chat.directive-tags.test.tspnpm test src/gateway/chat-attachments.test.ts src/gateway/server.agent.gateway-server-agent-a.test.tspnpm test src/gateway/chat-abort.test.ts src/gateway/server-methods/chat.abort-authorization.test.ts src/gateway/server-methods/models-auth-status.test.tspnpm test src/gateway/server-methods/server-methods.test.tspnpm test src/gateway/session-child-sessions.test.tspnpm test src/gateway/session-history-state.test.tspnpm test src/gateway/session-lifecycle-state.test.tspnpm test src/gateway/session-transcript-files.fs.archive-events.test.ts src/gateway/session-utils.fs.test.tspnpm test src/gateway/session-compaction-checkpoints.test.tspnpm test src/gateway/sessions-resolve.test.ts src/gateway/sessions-resolve-store.test.ts src/agents/tools/embedded-gateway-stub.test.tspnpm test src/gateway/sessions-patch.test.ts src/tui/embedded-backend.test.tspnpm test src/gateway/server.sessions.reset-hooks.test.ts src/gateway/drain-active-sessions-for-shutdown.test.ts src/gateway/server-close.test.ts src/channels/plugins/acp-stateful-target-driver.test.tspnpm test src/gateway/session-kill-http.test.ts src/gateway/sessions-history-http.revocation.test.ts src/gateway/session-subagent-reactivation.test.tspnpm test src/gateway/active-sessions-shutdown-tracker.test.ts src/gateway/drain-active-sessions-for-shutdown.test.ts src/gateway/server-methods/agent.create-event.test.ts src/gateway/sessions-history-http.revocation.test.tspnpm test src/gateway/session-utils.test.ts src/gateway/session-utils.plugin-runtime.test.ts src/gateway/session-utils.subagent.test.tspnpm test src/gateway/session-utils.fs.test.ts src/gateway/session-transcript-files.fs.archive-events.test.tspnpm test src/gateway/session-utils.fs.test.ts src/gateway/server-methods/chat.directive-tags.test.tspnpm test src/gateway/server.sessions.list-changed.test.ts src/gateway/server-methods/sessions.abort-agent-scope.test.ts src/gateway/server-methods/sessions.send-deleted-agent.test.ts src/gateway/server-methods/sessions.send-followup-status.test.ts src/gateway/server-methods/talk.test.tspnpm test src/gateway/gateway-misc.test.ts src/gateway/session-message-events.test.tspnpm test src/gateway/session-history-state.test.ts src/gateway/session-lifecycle-state.test.tspnpm test src/gateway/gateway-misc.test.ts src/gateway/server-talk-nodes.test.ts src/gateway/server-chat.agent-events.test.tspnpm test src/gateway/node-registry.test.ts src/gateway/server-node-events.test.ts src/gateway/server-methods/nodes.invoke-wake.test.tspnpm test src/gateway/server-node-events.test.ts src/gateway/server-methods/nodes-pending.test.ts src/gateway/server-methods/nodes.invoke-wake.test.ts src/gateway/gateway-misc.test.tspnpm test src/gateway/server-request-context.test.ts src/gateway/local-request-context.test.ts src/gateway/server-methods/nodes-pending.test.ts src/gateway/server-methods/push.test.ts src/gateway/server-methods/environments.test.tspnpm test src/gateway/node-pending-work.test.ts src/gateway/server-methods/nodes-pending.test.ts src/gateway/server-methods/nodes.invoke-wake.test.tspnpm test src/gateway/server/ws-connection/auth-context.test.ts src/gateway/server/ws-connection/auth-context.state.test.ts src/gateway/server/ws-connection/handshake-auth-helpers.test.tspnpm test src/gateway/server/ws-connection/auth-messages.test.ts src/gateway/server/ws-connection/unauthorized-flood-guard.test.ts src/gateway/server/ws-connection/handshake-auth-log-limiter.test.tspnpm test src/gateway/server/ws-shared-generation.test.ts src/gateway/server/preauth-connection-budget.test.ts src/gateway/server/ws-connection.test.tspnpm test src/gateway/server/ws-connection.test.ts src/gateway/server/ws-connection.startup.test.ts src/gateway/server/ws-connection/message-handler.post-connect-health.test.tspnpm test src/gateway/server/ws-connection.test.ts src/gateway/server/ws-connection.startup.test.ts src/gateway/server/ws-connection/message-handler.post-connect-health.test.ts src/gateway/server/ws-connection/auth-context.test.ts src/gateway/server/ws-connection/connect-policy.test.tspnpm test src/gateway/server-node-events.test.ts src/gateway/server-methods/nodes-pending.test.ts src/gateway/server-methods/nodes.invoke-wake.test.ts src/gateway/gateway-misc.test.tspnpm test src/gateway/server/event-loop-health.test.ts src/gateway/server/readiness.test.ts src/gateway/server/http-listen.test.ts src/gateway/server/hooks.agent-trust.test.ts src/gateway/server/plugin-route-runtime-scopes.test.ts src/gateway/server/plugins-http.runtime-scopes.test.ts src/gateway/server/plugins-http/route-capability.test.ts src/gateway/server/plugins-http.test.tspnpm test src/gateway/server/plugins-http.test.ts src/gateway/server/plugins-http.runtime-scopes.test.ts src/gateway/server/plugin-route-runtime-scopes.test.ts src/gateway/server/plugins-http/route-capability.test.tspnpm test src/gateway/auth-rate-limit.test.ts src/gateway/auth-surface-resolution.test.ts src/gateway/connection-auth.test.ts src/gateway/auth.test.tspnpm test src/gateway/auth.test.ts src/gateway/auth-rate-limit.test.ts src/gateway/origin-check.test.ts src/gateway/net.test.tspnpm test src/gateway/server-http.stages.test.ts src/gateway/server-http.probe.test.ts src/gateway/server-http.request-trace.test.ts src/gateway/server.plugin-http-auth.test.tspnpm test src/gateway/exec-approval-manager.test.ts src/gateway/node-invoke-system-run-approval.test.ts src/gateway/node-invoke-system-run-approval-match.test.ts src/gateway/system-run-approval-binding.test.ts src/gateway/system-run-approval-binding.contract.test.tsReal behavior proof
Behavior addressed: exported gateway client API contracts are now documented for reconnect pause callbacks, request error handling, close-code hints, connect challenge timeout resolution, device-auth signing payloads, metadata normalization, MCP loopback JSON-RPC/tool-schema handling, node pairing auto-approval policy, voice-wake trigger normalization, gateway error formatting, probe target resolution, transcript-file session lookup, run-id session-key lookup, session-store key canonicalization, approval runtime token validation, hook agent allowlist routing, explicit Gateway config-bypass policy, operator scope vocabulary, Gateway auth-token precedence diagnostics, Gateway auth SecretRef materialization, shared HTTP helpers, HTTP auth helper APIs, the POST+JSON endpoint dispatch helper, Gateway live state, Control UI bootstrap payloads, channel plugin reload target matching, cron notification dispatch, model-catalog cache refresh/invalidation, channel status patches, assistant stream text extraction, channel health policy evaluation, Gateway connection detail resolution, Gateway config reload settings normalization, model-pricing enablement, MCP loopback runtime publication/token selection, Control UI CSP hashing/header construction, Control UI HTTP method/response helpers, Control UI link resolution, Control UI routing/shared avatar/base-path helper contracts, Gateway auth-mode ambiguity policy contracts, Gateway install auth-token requirement policy contracts, Gateway auth-token source conflict diagnostic contracts, Gateway client bootstrap URL/auth provenance contracts, Gateway chat envelope sanitizer contracts, Gateway chat attachment parsing/offload contracts, Gateway chat abort lifecycle contracts, Gateway chat display projection contracts, Gateway direct child-session helper contracts, Gateway session history snapshot/SSE state contracts, Gateway session lifecycle projection/persistence contracts, Gateway transcript archive/path helper contracts, Gateway compaction checkpoint helper contracts, Gateway session resolver selector contracts, Gateway session patch helper contract, Gateway session reset lifecycle helper contracts, Gateway session HTTP/reactivation helper contracts, Gateway session runtime tracker/path helper contracts, Gateway session utility row/default/store/model contracts, Gateway transcript reader/usage/preview helper contracts, Gateway transcript index cache/active-tree contracts, Gateway session method/Talk session mode and ownership contracts, Gateway node/session event runtime fanout contracts, Gateway session history/lifecycle state projection contracts, Gateway node subscription/chat-run/subscriber registry contracts, Gateway node registry invoke/event authorization contracts, Gateway server helper event-loop/readiness, hook dispatch/auth, plugin route auth, and plugin node-capability contracts, Gateway plugin HTTP dispatch registry, route fallthrough, runtime-scope injection, and upgrade rejection contracts, Gateway auth rate-limit/credential/surface resolution contracts, Gateway shared-secret/trusted-proxy/browser-origin/Tailscale auth branch contracts, Gateway HTTP pipeline probe redaction/plugin-stage/routing contracts, and Gateway exec approval lifecycle/replay guard contracts.
Real environment tested: local OpenClaw checkout on
codex/protocol-schema-comments-20260602, rebased onorigin/main.Exact steps or command run after this patch:
git diff --check;pnpm test packages/gateway-client/src/client.watchdog.test.ts packages/gateway-client/src/timeouts.test.ts src/gateway/client.test.ts src/tui/gateway-chat.test.ts;pnpm test src/gateway/device-auth.test.ts src/gateway/node-command-policy.test.ts src/gateway/gateway-misc.test.ts;pnpm test src/gateway/mcp-http.test.ts src/gateway/gateway-cli-backend.live-probe-helpers.test.ts;pnpm test src/gateway/node-pairing-auto-approve.test.ts src/gateway/server.node-pairing-auto-approve.test.ts src/gateway/server.node-pairing-authz.test.ts;pnpm test src/gateway/gateway-misc.test.ts;pnpm test src/gateway/probe-auth.test.ts;pnpm test src/gateway/session-transcript-key.test.ts;pnpm test src/gateway/server-session-key.test.ts src/gateway/server-methods/artifacts.test.ts src/gateway/server-methods/sessions.abort-agent-scope.test.ts;pnpm test src/gateway/session-utils.test.ts;pnpm test src/gateway/operator-approvals-client.test.ts src/agents/tools/gateway.test.ts src/gateway/server/ws-connection/message-handler.post-connect-health.test.ts;pnpm test src/gateway/hooks.test.ts src/gateway/server.hooks.test.ts src/security/audit-hooks-routing.test.ts;pnpm test src/gateway/call.test.ts src/cli/command-path-policy.test.ts;pnpm test src/gateway/method-scopes.test.ts src/agents/tools/gateway.test.ts;pnpm test src/commands/doctor-gateway-auth-token.test.ts src/commands/status.scan.config-shared.test.ts src/security/audit-gateway.test.ts src/commands/doctor-security.test.ts;pnpm test src/gateway/startup-auth.test.ts src/pairing/setup-code.test.ts src/gateway/call.test.ts;pnpm test src/gateway/http-common.test.ts src/gateway/http-common.fuzz.test.ts;pnpm test src/gateway/http-utils.request-context.test.ts src/gateway/http-utils.authorize-request.test.ts src/gateway/http-endpoint-helpers.test.ts;pnpm test src/gateway/http-endpoint-helpers.test.ts src/gateway/openai-http.test.ts src/gateway/openresponses-http.test.ts src/gateway/embeddings-http.test.ts;pnpm test src/gateway/server-request-context.test.ts src/gateway/control-ui.http.test.ts;pnpm test src/gateway/plugin-channel-reload-targets.test.ts src/gateway/server-aux-handlers.test.ts;pnpm test src/gateway/server-cron-notifications.test.ts src/gateway/server.cron.test.ts;pnpm test src/gateway/server-model-catalog.test.ts;pnpm test src/gateway/channel-status-patches.test.ts src/gateway/openai-http.test.ts src/gateway/openresponses-http.test.ts;pnpm test src/gateway/channel-health-policy.test.ts src/gateway/channel-health-monitor.test.ts src/gateway/server.health.test.ts src/gateway/server-methods/channels.status.test.ts;pnpm test src/gateway/call.test.ts src/gateway/client-bootstrap.test.ts src/commands/status.scan.shared.test.ts src/cli/capability-cli.test.ts;pnpm test src/gateway/config-reload.test.ts src/gateway/server-methods/config.test.ts src/gateway/server-methods/config.shared-auth.test.ts;pnpm test src/gateway/model-pricing-cache.test.ts src/gateway/server-runtime-services.test.ts src/commands/health.test.ts;pnpm test src/gateway/mcp-http.test.ts src/gateway/gateway-cli-backend.live-probe-helpers.test.ts src/agents/cli-runner/prepare.test.ts;pnpm test src/gateway/control-ui-csp.test.ts src/gateway/control-ui.http.test.ts;pnpm test src/gateway/control-ui-routing.test.ts src/gateway/control-ui.http.test.ts;pnpm test src/commands/onboard-helpers.test.ts src/commands/dashboard.test.ts src/cli/daemon-cli/status.print.test.ts;pnpm test src/gateway/control-ui-routing.test.ts src/gateway/control-ui.http.test.ts src/commands/onboard-helpers.test.ts src/commands/status.scan.shared.test.ts;pnpm test src/gateway/auth-mode-policy.test.ts src/gateway/startup-auth.test.ts src/commands/gateway-install-token.test.ts;pnpm test src/commands/doctor-gateway-auth-token.test.ts src/commands/gateway-install-token.test.ts;pnpm test src/commands/status.scan.config-shared.test.ts src/commands/doctor-security.test.ts src/security/audit-gateway.test.ts;pnpm test src/gateway/client-bootstrap.test.ts src/gateway/call.test.ts src/gateway/operator-approvals-client.test.ts;pnpm test src/gateway/chat-sanitize.test.ts src/gateway/server-methods/chat.directive-tags.test.ts;pnpm test src/gateway/chat-attachments.test.ts src/gateway/server.agent.gateway-server-agent-a.test.ts;pnpm test src/gateway/chat-abort.test.ts src/gateway/server-methods/chat.abort-authorization.test.ts src/gateway/server-methods/models-auth-status.test.ts;pnpm test src/gateway/server-methods/server-methods.test.ts;pnpm test src/gateway/session-child-sessions.test.ts;pnpm test src/gateway/session-history-state.test.ts;pnpm test src/gateway/session-lifecycle-state.test.ts;pnpm test src/gateway/session-transcript-files.fs.archive-events.test.ts src/gateway/session-utils.fs.test.ts;pnpm test src/gateway/session-compaction-checkpoints.test.ts;pnpm test src/gateway/sessions-resolve.test.ts src/gateway/sessions-resolve-store.test.ts src/agents/tools/embedded-gateway-stub.test.ts;pnpm test src/gateway/sessions-patch.test.ts src/tui/embedded-backend.test.ts;pnpm test src/gateway/server.sessions.reset-hooks.test.ts src/gateway/drain-active-sessions-for-shutdown.test.ts src/gateway/server-close.test.ts src/channels/plugins/acp-stateful-target-driver.test.ts;pnpm test src/gateway/session-kill-http.test.ts src/gateway/sessions-history-http.revocation.test.ts src/gateway/session-subagent-reactivation.test.ts;pnpm test src/gateway/active-sessions-shutdown-tracker.test.ts src/gateway/drain-active-sessions-for-shutdown.test.ts src/gateway/server-methods/agent.create-event.test.ts src/gateway/sessions-history-http.revocation.test.ts;pnpm test src/gateway/session-utils.test.ts src/gateway/session-utils.plugin-runtime.test.ts src/gateway/session-utils.subagent.test.ts;pnpm test src/gateway/session-utils.fs.test.ts src/gateway/session-transcript-files.fs.archive-events.test.ts;pnpm test src/gateway/session-utils.fs.test.ts src/gateway/server-methods/chat.directive-tags.test.ts;pnpm test src/gateway/server.sessions.list-changed.test.ts src/gateway/server-methods/sessions.abort-agent-scope.test.ts src/gateway/server-methods/sessions.send-deleted-agent.test.ts src/gateway/server-methods/sessions.send-followup-status.test.ts src/gateway/server-methods/talk.test.ts;pnpm test src/gateway/gateway-misc.test.ts src/gateway/session-message-events.test.ts;pnpm test src/gateway/session-history-state.test.ts src/gateway/session-lifecycle-state.test.ts;pnpm test src/gateway/gateway-misc.test.ts src/gateway/server-talk-nodes.test.ts src/gateway/server-chat.agent-events.test.ts;pnpm test src/gateway/node-registry.test.ts src/gateway/server-node-events.test.ts src/gateway/server-methods/nodes.invoke-wake.test.ts.Evidence after fix: focused package/client, core wrapper, TUI gateway-chat, device-auth, node-command policy, gateway misc, MCP loopback HTTP, MCP live-probe helper, node pairing auto-approve/authz, probe auth, session transcript-key, server-session-key, artifacts, session abort-agent-scope, session-utils, operator approvals client, gateway tool, websocket post-connect health, hooks, server hooks, audit hooks routing, gateway call, CLI command-path, method-scope, doctor token, status scan config, audit gateway, doctor security, startup auth, pairing setup-code, HTTP common, HTTP request-context, HTTP authorize-request, HTTP endpoint helper, OpenAI HTTP, OpenResponses HTTP, embeddings HTTP, server request-context, Control UI HTTP, plugin channel reload-target, server aux-handler, cron notification, gateway cron, model-catalog, channel status/HTTP stream, channel health policy, connection details, client bootstrap, status scan, capability CLI, config reload, config write/shared-auth, model-pricing cache, runtime services, health, MCP HTTP, MCP live-probe helper, CLI prepare, Control UI CSP, Control UI routing, Control UI HTTP, onboard helper, dashboard, daemon status, auth-mode policy, startup auth, doctor gateway-token, gateway install-token, status scan config, doctor security, audit gateway, client bootstrap, gateway call, operator approvals client, chat sanitizer, chat directive-tag, chat attachments, gateway agent attachment, chat abort, chat abort authorization, model auth-status, server-methods display projection, session child helper, session history state, session lifecycle state, transcript archive events, session fs, compaction checkpoint, session resolver, embedded gateway stub, session patch, TUI embedded backend, reset-hook, shutdown-drain, server-close, ACP stateful target driver, session kill HTTP, session history revocation, subagent reactivation, active session shutdown tracker, session active-run projection, transcript path matching, session utility, plugin-runtime row, subagent session utility, transcript reader, transcript archive, usage, preview, transcript index, directive-tag reader, sessions list/change, session abort/send, Talk handler, gateway misc, session message-event, session history/lifecycle state, Talk-node, server chat agent-event, node-registry, server node-event, and node invoke/wake tests passed after the branch was rebased on current
origin/main.Observed result after fix: API comments are present on the shared package and core wrapper without adding file-header or import-area comments; device-auth metadata comments describe the reusable signing and policy contracts; MCP comments describe protocol negotiation and schema projection contracts; node pairing comments document the narrow auto-approval policy; server utility comments document bounded trigger normalization and diagnostic formatting; probe target comments document remote-mode fallback semantics; transcript lookup comments document cache reset and ambiguous-session handling; run-session lookup comments document miss caching and agent-scope filtering; session-store comments document persisted-key canonicalization and legacy default-agent alias handling; approval runtime comments document token generation and timing-safe validation; hook policy comments document wildcard/unrestricted routing semantics; explicit connection policy comments document when config loading and config guard bypasses are intentional; operator-scope comments document public scope meanings and the runtime allowlist invariant; auth-token comments document precedence and when env fallback/conflict warnings are intentional; auth-config comments document local materialization of active SecretRefs without mutating canonical config; HTTP helper comments document shared response, body-limit, SSE, and disconnect semantics; HTTP auth comments document reusable header parsing, auth metadata, scoped authorization, and shared-secret scope resolver variants; endpoint helper comments document path-delegation and auth-before-body ordering; live-state comments document startup-assembled runtime state and Control UI bootstrap contracts; reload-target comments document channel/plugin alias matching and exact/subpath config detection; cron notification comments document failure/completion dispatch contracts and non-blocking completion webhooks; model-catalog comments document cache invalidation and stale refresh publishing semantics; channel status and assistant stream comments document liveness patch semantics and delta-over-snapshot extraction; channel health comments document policy/result contracts and inherited transport timestamp handling; connection details comments document the resolved target/explanation shape and resolver-injected builder contract; reload-settings comments document normalized reload mode/debounce semantics; model-pricing config comments document default-enabled optional pricing refresh behavior; MCP loopback runtime comments document active runtime snapshots, owner/non-owner token selection, owner-token guarded cleanup, and env-placeholder server config; Control UI CSP comments document inline-script hash handling, attribute parsing, and restrictive header construction; Control UI HTTP comments document read-method routing and shared plain-text/not-found response helpers; Control UI link comments document operator-facing HTTP/WebSocket URL resolution across bind modes; auth-mode policy comments document the dual-credential ambiguity guard and SecretRef ownership invariant; install auth-policy comments document explicit mode decisions and durable service-env password inference; token-source conflict comments document shared audit/status fields and warning suppression invariants; client-bootstrap comments document URL provenance mapping and explicit override auth precedence; chat sanitizer comments document envelope stripping and sender-label attribution preservation; chat attachment comments document raw attachment, inline image, offloaded media-ref, parser, preflight, and legacy builder contracts; chat abort comments document stop matching, run expiry, registration, tracked adapters, provider metadata, and abort fanout contracts; chat display projection comments document history text limits, tool block detection, display sanitization, recent-message projection, and single-message projection contracts; child-session comments document direct lineage matching and non-recursive listing contracts; session-history comments document tail-window sizing, display-safe snapshots, SSE page state, inline append refresh behavior, and disk refresh contracts; lifecycle comments document event-to-row projection, persisted patch normalization, and reset-rotated row protection; transcript archive comments document candidate ordering, archive event emission, source-to-archive mapping, stable end-transcript selection, and archive cleanup counts; compaction checkpoint comments document retained-byte limits, reason mapping, tail leaf scans, checkpoint forks/capture/persist, cleanup, and lookup/list contracts; session resolver comments document the canonical key/error union and key/sessionId/label selector resolution contract; session patch comments document validated sessions.patch mutation without direct store writes; session reset comments document archive helper variants, start/end/unbind hook emission, cleanup-before-mutation, global-store agent inference, ACP reset metadata migration, and replacement transcript creation before lifecycle hooks; session HTTP comments document kill path handling, requester-vs-admin kill scopes, history path/limit handling, SSE auth rechecks, patch-hook cloning, and lazy completed-subagent reactivation; session runtime comments document shutdown finalization tracker APIs, global-session active-run agent matching, and transcript path comparison for not-yet-created files; session utility comments document public row/result types, canonical/legacy store lookup, default thinking/model resolution, image capability checks, and normalized Gateway session row construction; transcript reader comments document OpenClaw metadata attachment, full/recent/indexed reads, count caching, message id lookup, recent sequence annotations, usage snapshots, capped arrays, title extraction, and preview item construction; transcript index comments document visible indexed entries, cache clearing, oversized-line placeholders, active tree-chain selection, and shared in-flight index builds; session method comments document parent runtime inheritance, global-agent notifications, WebChat mutation blocking, checkpoint branch/restore selection, transcript creation, abort alias resolution, scoped abort ownership, send/steer delegation, preview store caching, main-DM reset semantics, child creation hooks, and Talk mode/transport/brain ownership checks; session event comments document node/session registry wiring, node delivery adapters, Talk presence snapshots, global message subscription fanout, session snapshot goal redaction, serialized transcript broadcasts, sequence fallback reads, display-safe message broadcasts, and sessions.changed fallback events; session state comments document exact cursor parsing, raw-tail pagination, duplicate live append refreshes, message-tool mirror seq attachment, hidden control-message refreshes, terminal outcome status mapping, lifecycle timestamp preference, and runtime preservation for partial lifecycle events; subscription comments document bidirectional node/session indexes, single-serialization fanout, node-level bypass broadcasts, chat-run FIFO ownership, run buffer cleanup, websocket subscriber reverse cleanup, tool-event recipient TTLs, and Talk-node capability detection; node-registry comments document serialized payload branding, reconnect-safe unregister, declared-surface narrowing, system.run authorization, legacy macOS fallback ambiguity, failed-invoke cleanup, raw event JSON embedding, and slow-consumer closure.
Latest slice proof: commit 896def0 documents approval record publication, resolved-entry grace, one-shot consumption, prefix lookup ambiguity, backend chat replay binding, approved-plan rehydration, and allow-once replay protection on current origin/main.
What was not tested: no full suite or live gateway session; this is documentation-only code commentary.