Skip to content

refactor(gateway): consolidate read and presentation paths - #169449

Merged
steipete merged 2 commits into
mainfrom
deslop/w07-gateway-new-20261011
Oct 12, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/w07-gateway-new-20261011

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Gateway read, presentation, and asset paths have accumulated parallel implementations and coordination for synthetic interleavings. This wave-2 cleanup removes 507 net production lines without changing protocol/configuration shapes, storage schemas, or ordinary user features. Test/support code shrinks by 909 lines; five obsolete assertion-safety/mock-export baseline entries are removed.

User Impact

No ordinary feature or protocol change. Security, transcript durability, byte limits and normal concurrent-session behavior are retained; rare reload, cache and presentation interleavings use the explicitly listed best-effort tradeoffs below.

Why This Change Was Made

Share session-access preparation across discovery, reactions, and sharing; use one asynchronous Claude history lookup; consolidate MCP approval and request validation; reuse bootstrap traversal and managed-image resolution; and remove redundant cache, refresh-acknowledgment, public-asset reload, and presentation bookkeeping. Reaction membership still prepares eagerly, private reads and effects still revalidate authority, and thumbnails stay inside their retained transcript-authorized read.

Best-effort tradeoffs accepted

  • Open MCP Apps no longer invalidate solely because model/harness selection changes mid-view (#161747, synthetic selection-change tests, no cited human incident). The existing transport remains until reopening; credential, sandbox, permission and session checks remain.
  • Public MCP renderer reads no longer carry reload epochs (#138074, synthetic lifecycle cases rather than a reported public-asset race). An admitted public read can finish across reload; same-registry cached assets refresh on restart.
  • Immutable Control UI asset builds no longer each retain/recheck lifecycle predicates (#145484, #134943, feature/runtime proof, no cited human overlap report). An in-flight catalog can finish against its selected record; subsequent access selects current owners. Custom-UI policy, HTTP authorization, safe paths and byte budgets remain.
  • PR subscriptions no longer reserve shared-cache custody for pending replacements (#156121, review-derived synthetic replacement cases). If the last viewer leaves during preparation, the replacement can perform another load.
  • PR refreshes use a pending flag rather than per-refresh acknowledgment nonces, and one per-key delivery queue rather than an additional recipient queue (same provenance). Simultaneous identical refresh acknowledgments can coalesce; explicit refresh, cooldown, FIFO and live recipient authorization remain.
  • Theme preference commits no longer fence plugin-definition object identity (#152460, synthetic before-commit plugin replacement). A reloaded/missing theme resolves by its saved ID and existing fallback; requester authority and preference CAS remain.
  • Artifact reads no longer refresh foreign SQLite writers through a second worker path (#166447, direct-SQL synthetic fixture). Unsupported foreign writes may remain stale until refresh/restart; Gateway publications and mid-read visibility revocation remain authoritative.
  • Live chat presentation drops closed-occurrence reentry vetoes and symbolic copies of reused occurrences (#167054, seeded arbitrary reentry tests). Late reused identities may display imperfectly; normal streaming and committed-text filtering remain.
  • Live chat no longer reconstructs ownership for unknown capped prefixes or unscoped cross-occurrence corrections (same seeded synthetic provenance). An unusual correction after cap/reuse may leave duplicate or imperfect live text; persisted transcripts, sanitization and the buffer cap are unchanged.
  • Narration drops eager per-abort pending-payload retirement (#160002, feature/performance machinery, no cited incident requiring immediate payload release). One bounded pending payload can survive until its existing pacing deadline; flush still rejects an aborted group before delivery, and socket/subscription cleanup remains eager.
  • Session-facts caching drops concurrent equal-snapshot reconciliation, reset tokens, and backwards-clock rebuilding (#165896, synthetic concurrency/clock tests). Equivalent concurrent reads may return different revision tokens; invalidation during a cold build may require the next refresh. The existing installation CAS, dirty-row tokens, bounded caches, authority and redaction checks remain.
  • Talk cleanup no longer queues replacement cleanup closures for the same disconnected connection (#146676, review-generated teardown races). Existing callbacks scan all current sessions; a genuinely new same-kind session on an already disconnected connection may wait for expiry/restart. Pending cleanup joins and failed-cleanup retry remain.
  • Config schema lookup no longer runtime-validates the typed producer's response a second time (#37266, feature implementation rather than a cited producer incident). A future producer bug surfaces as an invalid response; incoming request validation and missing-path errors remain.
  • Managed-image resize no longer retries the same encode three times (#70719, predating the Rastermill cutover 50b98a187895; no cited oversized-success incident). Rastermill owns dimension clamping; one final dimension/byte validation rejects an invalid result instead of re-encoding it.

Coverage log

Inspected recent growth first, then the larger related owners. Retained session-sharing source authority, worker placement claims and result settlement, local workspace journals, incognito disclosure guards, the measured CLI-history index, credential/pairing checks, private asset authorization, bounded background work, and ordinary shutdown/transcript durability. The main structural clusters inspected were history, session facts/access, MCP and Control UI assets, Talk and live presentation, bootstrap/workspace handling, image delivery, and Gateway reload/state ownership. No changes to src/audit, CHANGELOG.md, or PR-tooling imports.

500–999-line exception: candidate ledger (locations refer to the starting source)
Candidate cluster Location Provenance and disposition
Internal schema result validation server-methods/config.ts:820 #37266 feature; removed redundant producer mirror, kept request boundary.
Channel reload snapshots/fence server-channels.ts:468, server-channel-start-fence.ts Retained: plugin retirement and failed-replacement diagnostics also depend on it.
Queued session-store fallback session-utils-store-lookup.ts:420 #166027; retained consistent snapshots and realistic queued writes.
MCP model-selection fingerprint mcp-app-extension-runtime.ts:30 #161747 synthetic selection changes; removed only model/harness invalidation.
MCP approval preparation and schema mirrors mcp-app-extension-runtime.ts:338, mcp-app-operations.ts:76,549 #161747/#164368; consolidated, retaining live policy checks and cursor contract.
Public MCP renderer epochs mcp-app-sandbox-http.ts:63 #138074 synthetic reload cases; removed public-read fence, kept HTTP/security boundary.
PR subscription admission/acknowledgment queues control-ui-session-pr-subscriptions.ts:105,266,385,486 #156121 review/synthetic cases; removed cache custody and duplicate queues, kept FIFO and recipient authority.
Per-build browser asset lifecycle control-ui-plugin-assets.ts:44,149,207 #145484/#134943 feature work; removed reload fences, kept record ownership, private policy and budgets.
Theme identity and metadata copies server-methods/themes.ts #152460/#168027; removed synthetic catalog identity fence and duplicate metadata inventory.
Discovery/reaction/sharing preparation server-methods/session-discovery-access.ts, sessions-reactions-access.ts, sessions-sharing-authority.ts #167504/#166447; one existing owner, operation-specific authority and eager reaction membership retained.
Foreign artifact refresh server-methods/artifacts-session-resolution.ts #166447 direct-SQL fixture; removed unsupported second-writer path, retained owner-published revocation.
Bootstrap traversal and duplicate filesystem admission worker-environments/node-bootstrap-artifact-build.ts:162,279, bundle-staging.ts:25 #163446/#147336; one bounded walker and descriptor-based safe read, no security relaxation.
Image record selection and repeated encoding managed-image-attachments.ts:825,1105 Shared record owner and retained authorized reader; encoder tradeoff above.
Talk cleanup replacement chain talk/session-registry.ts:36,102 #146676 review races; removed replacement closures, kept pending/failure settlement.
Talk handler error/owner boilerplate talk/handlers/{client,session,voice,client-create}.ts #167720/#159697; existing error-map owner and guaranteed owner binding, kept security and rollback.
Live chat occurrence/cap reconstruction server-chat-buffer.ts #167054 seeded reentry/cap cases; removed model-only machinery, retained normal stream/history de-duplication.
Narration abort bookkeeping server-broadcast-narration.ts #160002; removed eager duplicate retirement, retained bounded pacing and abort check before send.
Sync history discovery and prefix wrapper cli-session-history.claude.ts:551,322 #69973/#145684/#166080; one async lookup through all callers, same validation and missing-file outcomes.
Selected-facts identity/reset/clock machinery server-plugin-session-facts.ts:43,59,274,455, session-facts-read.ts:196 #165896 synthetic interleavings; removed reconciliation/fences and duplicate eligibility checks, retained measured cache, row invalidation and authority.
Private readers, credentials, retained work and resource limits MCP file/upload/standalone owners; history scopes/index; worker journals/finalization; Talk run owners; session patch/agent deletion/pairing Retained: security/disclosure, ordinary shutdown/durability, realistic concurrent work, or measured performance.

Evidence

Production typecheck, SDK export registration, and both runtime/static cycle checks pass (zero cycles). Changed-file validation passed all ratchets, formatting, ownership/boundary guards, production types, all core-test type shards, and all three dead-export scans (zero entries). Its whole-core lint step hit the unchanged 900-second tooling timeout without diagnostics. The supported file-scoped lint alternative found two issues (map spread and redundant boolean conversion); both were corrected, and type-aware lint passed on the corrected files. Independent P0-P2 review completed: its reaction membership finding was fixed. A closeout request to restore foreign-SQL visibility probing was declined under the explicit single-Gateway-owner contract; supported visibility/member writes publish current facts before observers, and the retained mid-download owner-published revocation test passes. No accepted review finding remains.

  • The broad focused run executed 48 files: 961 passed, 9 failed, and 2 existing skips (Vitest 8710.78s; wrapper 9415.79s, one worker). Three failures pinned the retired chat reentry/capped-prefix mechanisms; those cases were corrected/removed without changing the retained assertions. The complete correction/unreached group then passed 203 tests (wrapper 1585.22s), including both agent attempt suites, the full wire suite, Talk target, session reactions, MCP approval, and all 3 lint-suppression checks. New approval cases took 297ms and 6ms; hosted CI seconds remain pending.
  • After the two lint corrections, history/subscription and suppression checks passed 81 tests (wrapper 381.40s); formatting and focused type-aware lint passed. A fresh isolated review of those corrections was scoped-clean.
  • Six Talk failures are retained, with unchanged assertions and budgets: two incognito replacement timeouts, native registration readiness, and three cancellation variants. A clean independently installed baseline at c55ca8ce465f73f52bc879dd5b33812914ebca8a reproduced five target case names (887.38s): incognito revoked=false, registration readiness, and all three cancellation cases. The revoked=true variant was not independently replayed. Rejection cancellation failed at missing activeRun on the candidate and at zero abort calls on baseline, so identical root cause is not claimed. The isolated candidate incognito replay also timed out. These failures are unresolved, not hidden or claimed fixed.
  • Full runtime build passed in 15m54.1s, including native declarations and CLI bootstrap checks. The config-schema RPC composition attempt timed out in its unchanged 180-second suite startup hook before assertions; the first startup import marker appeared at about 233 seconds. This is a proof gap, not a passing RPC result or a proven baseline failure. The focused config handler suite passed in the broad run.
  • The separate managed-image Gateway E2E run passed retained-image/document downloads with stale-ID rejection and the single-transcript-ticket full/thumbnail case. Fresh image/document downloads timed out at the unchanged 120-second budget (2 passed, 1 failed; Vitest 440.48s, wrapper 833.99s). The first Gateway startup marker appeared at 268 seconds. The fresh-media timeout is unresolved and is not claimed to reproduce on baseline; focused managed-image byte, authorization, visibility, and retention tests passed in the broad run.

Every build/test invocation uses task-owned HOME, OPENCLAW and XDG directories. No operator Gateway or real OpenClaw state was used. The first E2E preparation found and led to a fixed optional-value type error before collecting tests; initial concurrent preparations and obsolete shrink-only baseline entries are recorded rather than counted as passes. No timeout increases, added retries, new skips, or lint suppressions. No hosted reruns or re-pushes for green are requested.

Conflict-only integration

Rebased onto a9b40cf325e8dfd3540200b6ac95aae740a324b4 because GitHub reported conflicts. The one textual conflict was Talk session creation; retained main's async credential/provider preparation and post-await requester authority check alongside the shared error mapping. Other upstream changes merged automatically. Net reduction remains 507 production lines.

The post-rebase suppression guard fails on the newly introduced src/state/json-predicate-fields.ts|no-control-regex|1 entry from #169315. A clean checkout of that exact main SHA reproduces the same failure (98.80s); both the test and named source are byte-identical between main and this branch. No suppression or allowlist was added by this PR.

At rebased head 4d72e03c0e316dc757c73fd00f919b3f28b54fdd, production types and focused type-aware lint pass; runtime and static cycle checks both report zero. All six affected functional suites pass: 274 tests, 1 existing skip (Gateway group 1077.67s, agent group 648.84s; wrapper 1911.31s). Hosted checks must attach to this head; earlier-head results are not substituted.

Exact-head hosted result

CI run 38187881910 succeeded on 4d72e03c0e316dc757c73fd00f919b3f28b54fdd: 582 seconds wall time and 9,926 summed job elapsed seconds (not CPU/billing time). Both required CI gates are successful; the PR reports 82 passed checks, intentional skips, no failures and no pending checks. Security review passed. No rerun, dispatch, or push for green was used, and no inherited-red/admin exception is needed.

@clawsweeper

clawsweeper Bot commented Oct 11, 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 app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates Gateway session reads, MCP approval preparation, asset loading, and live presentation while removing coordination for explicitly accepted edge cases.

Example: Two identical refresh requests arrive for session agent:main:demo during one shared pull-request load.

  • Before: Separate acknowledgment identities track each refresh request.
  • After: A pending flag allows identical refresh acknowledgments to coalesce.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The inspected consolidation has no actionable finding and substantial reported boundary validation, but current shipped-entry-point evidence is limited.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; reported validation exercises production owners and retained-media Gateway paths, while inspected screenshots show earlier plugin UI work and do not prove the current refactor.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
User problem: No ordinary user-facing failure is claimed; duplicated Gateway implementations and coordination increase maintenance complexity.
Reason: The maintainer-directed change removes substantial duplicate machinery and records its accepted tradeoffs without introducing configuration or public APIs.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: the maintainer-directed consolidation has distinct value, explains its accepted tradeoffs, and has no concrete introduced defect identified; the previous conflict and draft blockers are resolved.

Priority: P3
Reviewed head: 4d72e03c0e316dc757c73fd00f919b3f28b54fdd

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Successful post-refactor config-schema RPC and fresh-media download traces are not supplied; the reported integration attempts timed out during startup.
Agent review details

How this fits together

Gateway RPC and HTTP handlers consume session facts, plugin records, transcripts, and current authority to return authorized assets, media, session information, and live events.

flowchart LR
Clients[Gateway clients] --> Handlers[RPC and HTTP handlers]
Handlers --> Preparation[Shared read preparation]
Preparation --> Owners[Session and plugin owners]
Owners --> Workers[Storage reader workers]
Preparation --> Authority[Current authority checks]
Authority --> Responses[Assets and presentation responses]
Responses --> Clients
Loading

Technical review

Best possible solution:

Retain the shared owners and recorded best-effort tradeoffs while preserving current authorization, transcript durability, bounded work, and existing stored formats.

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

This refactor addresses duplicated implementation and deliberately retired guarantees; the source establishes that scope, and no failing run was attempted during this read-only review.

Is this the best way to solve the issue?

Consolidating existing owners fits repository policy, and the maintainer body explains the reduced edge-case guarantees while the inspected paths retain ordinary authorization and delivery checks.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Claude CLI fallback history keeps the original intent (a96f1fa: Preserve prior conversation context when Claude CLI falls back to another provider; the asynchronous lookup retains parsing, summary selection, and prompt-budget behavior.)
  • Prepared sharing and reaction authority keeps the original intent (8ecd925: refactor(gateway): sharing member authority from prepared facts (S33 cohort 2) #163572 prepared sharing facts away from caller-thread SQLite while rejecting revoked managers and replaced sessions at effects.)
  • PR subscription custody and acknowledgments changes intended behavior with a stated reason (0bbad56: fix(sessions): keep session results current during cold reads #156121 introduced worker-prepared reads and generation-bound delivery; this PR explicitly accepts redundant replacement loads and coalesced identical acknowledgments.)
  • Session-facts reconciliation and clock handling changes intended behavior with a stated reason (70cfa76: perf(workboard): speed up sessions board revision reads #165896 retained unchanged rows and reconciled concurrent snapshots; this PR accepts differing concurrent revision tokens and delayed cold-build invalidation.)
  • Live chat occurrence bookkeeping changes intended behavior with a stated reason (af210e1: fix: Control UI shows run commentary twice during long tool runs #167054 prevents repeated committed commentary; this PR preserves ordinary filtering while reducing guarantees for reused identities and ambiguous capped corrections.)
  • MCP runtime selection and public renderer reloads changes intended behavior with a stated reason (6046d4f: feat: use MCP plugin apps across conversations and workspace files #161747 bound Apps to their conversation-owned transport; the current change retains open transports across model selection changes while preserving credential, sandbox, permission, and session checks.)
  • Control UI asset lifecycle changes intended behavior with a stated reason (6a97159: feat: add experimental plugin UI customization #134943 introduced plugin UI builds; this PR accepts completion against a selected old record while subsequent access selects current owners and retains private HTTP authorization.)
  • Artifact foreign-writer refresh changes intended behavior with a stated reason (23dae69: The previous path refreshed backing entries through another worker read; removal follows the current single-Gateway database-owner contract and retains owner-published revocation.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction and current-main context: Reviewed the verified merge-base-to-head changes. Current-main changes do not overlap the changed production paths, and final Git status remains clean; no target code or second reviewer was run. (4d72e03c0e31)
  • Recorded owner direction: The maintainer-authored body explicitly accepts reduced reload, cache, refresh-acknowledgment, presentation, and cleanup guarantees while retaining security and durability boundaries; those choices need no renewed product approval. (4d72e03c0e31)
  • Shared session authority: The shared preparation retains caller, projection, profile, configuration, and run-authority checks; reactions still prepare membership eagerly, and consumers retain selected-session and operation-specific authorization. (src/gateway/server-methods/sessions-sharing-authority.ts:71, 4d72e03c0e31)
  • MCP execution boundary: Approval preparation preserves request and retained-view checks after approval; the returned policy assertion reaches runtime.callTool through callMcpAppToolWithElicitation. (src/gateway/mcp-app-extension-runtime.ts:307, 4d72e03c0e31)
  • Private media disclosure: Thumbnail opening and reading remain inside the transcript-authorized lifetime, with current authority and cancellation checked before returning bytes; artifact reads retain owner-published visibility checks. (src/gateway/managed-image-attachments.ts:937, 4d72e03c0e31)
  • Imported filesystem dependency contract: The changed worker staging code invokes @openclaw/fs-safe 0.26.0, establishing applicability of its repository security policy. Its root reader rejects parent symlinks and retains descriptor, root-confinement, and identity admission checks, supporting removal of duplicate caller checks. (src/root-impl.ts:618, 8c9dc979b91c)

Likely related people:

  • Peter Steinberger: Raw commit e94d0e9 adds src/gateway/talk-session-registry.ts:119 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e94d0e97a6b9; files: src/gateway/talk-session-registry.ts)
  • Galin Iliev: Raw commit 0bbad56 adds src/gateway/control-ui-session-pr-subscriptions.ts:179 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0bbad56fa809; files: src/gateway/control-ui-session-pr-subscriptions.ts)
  • stainlu: Raw commit a96f1fa adds src/gateway/cli-session-history.claude.ts:408 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a96f1fa5ef66; files: src/gateway/cli-session-history.claude.ts)

PR surface

Source -507, Tests -909, Other -5. Total -1421 across 41 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 26 977 1484 -507
Tests 13 83 992 -909
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 5 -5
Total 41 1060 2481 -1421

Review metrics

Metric Value Why it matters
Production versus test/support delta Production +976/-1483; tests/support +84/-993. The verified reductions are 507 production lines and 909 test/support lines, consistent with consolidating existing owners and retiring explicitly accepted edge-case machinery.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is maintainer-directed internal cleanup with documented tradeoffs, rather than an urgent user-facing regression repair.
  • 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.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture successful config.schema.lookup and fresh-media download results through the shipped Gateway paths to strengthen behavior confidence.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T23:48:41.160Z sha 358ad0284fc307e50d0a0b63d680ea44ab3a0de4 :: needs changes before merge. :: none

Reviewed October 11, 2026, 8:31 PM ET / October 12, 2026, 00:31 UTC (Revision 2).

@steipete
steipete force-pushed the deslop/w07-gateway-new-20261011 branch from 358ad02 to 4d72e03 Compare October 12, 2026 00:22
@steipete
steipete marked this pull request as ready for review October 12, 2026 00:24
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 4d72e03c0e316dc757c73fd00f919b3f28b54fdd
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/mcp-app-sandbox-http.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/server-methods/sessions-sharing-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
@steipete
steipete merged commit 8db1c35 into main Oct 12, 2026
229 of 230 checks passed
@steipete
steipete deleted the deslop/w07-gateway-new-20261011 branch October 12, 2026 00:42
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…169449)

* refactor(gateway): simplify read and presentation ownership

* style(gateway): resolve focused lint findings
DasX added a commit to DasX/openclaw that referenced this pull request Oct 12, 2026
Integrate origin/main f13b3cd (533 commits after d220cac).

Four production files conflicted:
- attempt-auth-selection.ts: take main's async credential store
  (ensureAuthProfileStoreAsync, openclaw#169111) and keep this branch's import for
  the CLI auth-forwarding helper.
- attempt-execution.ts: runAgentAttempt becomes async as on main (openclaw#169111,
  openclaw#169449) and keeps its RunAgentAttemptParams type; main's inline parameter
  type is otherwise unchanged since the previous merge.
- sessions-patch.ts: keep the fallback policy patch step ahead of main's
  narrower explicit-thinkingLevel validation (openclaw#169435).
- model-overrides.ts: keep the session fallback policy block and take main's
  bookkeeping simplification and comment removal (openclaw#169458).

docs/.generated/config-baseline.{counts.json,sha256} were regenerated with
pnpm config:docs:gen instead of merged by hand: core 2507 -> 2511, the four
added entries are this branch's fallbackPriority paths.
steipete added a commit that referenced this pull request Oct 14, 2026
Share completion projection and settlement, reuse existing command gates and
session-source preparation, and remove duplicate response/receipt mirrors.
Keep private-source authority, approvals, FIFO, transcript durability, bounded
retry behavior, and write-capable shutdown settlement at their existing owners.

Best-effort tradeoffs accepted:
- Idle source/config changes may retain unused capacity until expiry; allocation
  and private-source transfer still authorize use (#143372, #143410).
- Mid-read model configuration and native availability may keep prepared display
  facts for that read; catalog/account authority remains (#169253).
- Cosmetic health topology and clock rollback use normal refresh or an explicit
  probe; live lifecycle mismatch checks remain (#128222, #128503).
- Bootstrap enrollment overlapping shutdown/reload may fail and retry rather than
  reject every post-await close interleaving (#133037).
- Late internal completion reducers are not persisted; completion stays idempotent
  and final-intent receipt validation remains (#168592).
- An in-flight plugin UI catalog may finish against its selected registry;
  HTTP asset disclosure still checks current authority (#134943, #169449).

These removed guards have speculative/synthetic provenance, not cited human
actual-use incidents. Keep the human-reported memory-flush retry bound (#85645).
The Phase E standalone session memory backend and its tests are untouched.
steipete added a commit that referenced this pull request Oct 14, 2026
* refactor(gateway): consolidate reply and worker preparation paths

Share completion projection and settlement, reuse existing command gates and
session-source preparation, and remove duplicate response/receipt mirrors.
Keep private-source authority, approvals, FIFO, transcript durability, bounded
retry behavior, and write-capable shutdown settlement at their existing owners.

Best-effort tradeoffs accepted:
- Idle source/config changes may retain unused capacity until expiry; allocation
  and private-source transfer still authorize use (#143372, #143410).
- Mid-read model configuration and native availability may keep prepared display
  facts for that read; catalog/account authority remains (#169253).
- Cosmetic health topology and clock rollback use normal refresh or an explicit
  probe; live lifecycle mismatch checks remain (#128222, #128503).
- Bootstrap enrollment overlapping shutdown/reload may fail and retry rather than
  reject every post-await close interleaving (#133037).
- Late internal completion reducers are not persisted; completion stays idempotent
  and final-intent receipt validation remains (#168592).
- An in-flight plugin UI catalog may finish against its selected registry;
  HTTP asset disclosure still checks current authority (#134943, #169449).

These removed guards have speculative/synthetic provenance, not cited human
actual-use incidents. Keep the human-reported memory-flush retry bound (#85645).
The Phase E standalone session memory backend and its tests are untouched.

* refactor(gateway): consolidate dispatch and trusted result projections

* refactor(workers): trust admitted preparation facts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…2342)

* refactor(gateway): consolidate reply and worker preparation paths

Share completion projection and settlement, reuse existing command gates and
session-source preparation, and remove duplicate response/receipt mirrors.
Keep private-source authority, approvals, FIFO, transcript durability, bounded
retry behavior, and write-capable shutdown settlement at their existing owners.

Best-effort tradeoffs accepted:
- Idle source/config changes may retain unused capacity until expiry; allocation
  and private-source transfer still authorize use (openclaw#143372, openclaw#143410).
- Mid-read model configuration and native availability may keep prepared display
  facts for that read; catalog/account authority remains (openclaw#169253).
- Cosmetic health topology and clock rollback use normal refresh or an explicit
  probe; live lifecycle mismatch checks remain (openclaw#128222, openclaw#128503).
- Bootstrap enrollment overlapping shutdown/reload may fail and retry rather than
  reject every post-await close interleaving (openclaw#133037).
- Late internal completion reducers are not persisted; completion stays idempotent
  and final-intent receipt validation remains (openclaw#168592).
- An in-flight plugin UI catalog may finish against its selected registry;
  HTTP asset disclosure still checks current authority (openclaw#134943, openclaw#169449).

These removed guards have speculative/synthetic provenance, not cited human
actual-use incidents. Keep the human-reported memory-flush retry bound (openclaw#85645).
The Phase E standalone session memory backend and its tests are untouched.

* refactor(gateway): consolidate dispatch and trusted result projections

* refactor(workers): trust admitted preparation facts
steipete added a commit that referenced this pull request Oct 15, 2026
Use Node's maintained deep comparator for MCP JSON schemas and remove defensive
throwing-getter readers plus their synthetic-only fixture. Keep schema input
validation, advertised-schema invocation membership, normalization, top-level
copies and the equal-schema warning/deduplication behavior from human issue #98437.

Inline Talk's sole-caller storage resolver and forwarding assertion adapter.
All four callers still assert the exact prepared target at the original effect.
Trust Rastermill's dimension fitting instead of rechecking encoder output; retain
input limits and the byte-limit check/error. Drop the optional initial metadata
catch-up event version fence; retain actual model readiness and runtime authority.

Best-effort tradeoffs accepted

- Throwing in-process tool metadata getters/spread (#88410, 705bdce): the
  introducing PR explicitly used synthetic fuzzplugin/mockplugin fixtures, not
  a live client report. A broken plugin getter now fails the request clearly
  rather than silently omitting that tool. Security and schema shape checks stay.
- Exotic non-JSON schema objects: the custom comparator from #103171 now uses
  isDeepStrictEqual with skipPrototype. Valid JSON schema equivalence, including
  insertion order, stays; symbol-bearing or exotic JS objects may warn differently.
  Preserve the real issue #98437 warning reduction and process-lifetime dedupe.
- Encoder output dimension recheck (#169449, 8db1c35): the introducing cutover
  explicitly made Rastermill own fitting, confirmed in its implementation. A
  future encoder contract bug can produce an oversized-dimension image; repair
  that owner rather than validate its output again in Gateway. Input/byte bounds stay.
- Initial chat metadata catch-up versions (#123433, f3db7fe): synthetic
  restart/Testbox provenance without a linked human incident. Overlapping initial
  catch-up and model invalidation can briefly mark display availability and cause
  an optional refresh warning; the next publication converges. Current model
  readiness, runtime authority/failure handling and write settlement stay.

Second-pass production reduction: 127 LOC; cumulative lane reduction: 344 LOC.
Phase E standalone memory backend, machinery and tests are untouched.
Same branch, no conflict/rebase, no PR at the below-500 ending threshold.

Provenance

#88410
#103171
#98437
#169449
#123433
#169622

Proof

- Fresh full core production types, targeted core type-aware lint, formatter and
  diff checks passed. Changed-check classification completed.
- Fresh runtime cycles: 0; Madge cycles: 0; no new component.
- Fresh four-file selection passed 70 tests across lint-suppressions (3), Talk
  voice (20), chat metadata (20) and Talk target (27); all kept tests unchanged.
  Loaded-host wall time: 1711.09s including cold preparation; no before/after
  performance claim.
- Independent review completed scoped-clean P0-P2; no actionable findings.
- Final MCP schema/image selection passed all 5 chosen cases in 269.92s wall:
  union/prototype properties, malformed/boolean variants, literal constraints,
  real HTTP equal-schema warning dedupe, and orientation-aware resized delivery.
  The name filter left 96 unrelated cases unrun; no test skips were added.
- Initial root-config lint failed before linting while unrelated plugin SDK
  declarations timed out at 300000ms. Correct source-backed core-config routing
  passed without skipping preparation or increasing any timeout.

Earlier packet gaps remain: server.hooks.test.ts timed out during Gateway startup
without conclusive head-vs-main attribution; a later successful startup is not a
claimed repair. Earlier expanded local selections and full check-changed were
stopped under load. The earlier env-var budget failure reproduced on its untouched
base, not current-main CI. No timeout increase, retry, skip, assertion weakening,
or baseline change was used. Full Gateway/integration proof belongs to bundle CI.

No standalone PR or hosted CI for this below-500 lane packet. Detailed coverage,
provenance, rejected candidates and proof are retained in .local/y06-ledger.md.
steipete added a commit that referenced this pull request Oct 15, 2026
* refactor(gateway): simplify diagnostic state and internal metadata paths

Consolidate worker catalog loading and remove duplicate internal copies,
metadata reconstruction, cleanup, and speculative diagnostic ordering machinery.
Keep authentication, live effect authority, persisted shapes, shutdown write
settlement, bounded caches, and terminal admission/spawn limits.

Best-effort tradeoffs accepted

Provenance below identifies synthetic/speculative introduction evidence, not a
linked human actual-use incident. Security, durability and real resource limits
remain independently protected.

- Health publication generations (#116681, synthetic overlap reproduction):
  overlapping passive/probe samples now publish in completion order; next refresh
  replaces stale diagnostics. Separate probe work and public/admin audiences stay.
- Observer request generations (#112958, structured-review race): an A-B-A model
  change during one in-flight digest can accept that digest; cancellation, current
  session/model checks and disclosure authorization remain.
- GitHub target early registry invalidation (#167189, synthetic invalidation test):
  discovery may be stale for its existing 15-second TTL; publication verifies Git
  afresh and cached reads still check current connection/source authority.
- Automation badge build epochs (#104730, structured review): latest completed
  service start supplies display facts; scheduling and stale-owner unregister stay.
- Terminal victim claim/release protocol (#116101, synthetic autoreview
  interleavings): reserve pooled free+idle capacity instead, then select the actual
  unviewed idle victim at registration. Newly viewed victims survive; a replacement
  without an eligible victim fails and kills its backend. Both hard limits remain.
- Launch JSON snapshot/revalidation (#123033, synthetic caller mutation): trust the
  tunnel-owned prepared descriptor; a caller violating ownership can mutate it.
  Negotiated options still use a shallow copy and node input validation remains.
- Worker catalog output copies (#142095, schema mirrors) and display settings
  clone: trust closed-schema-validated, documented process-stable metadata and
  internally owned settings. A future provider violating that contract can mutate
  cosmetic metadata or miss notifications until a later row/config refresh or
  restart; live allocation validation remains.
- Artifact descriptor freezing/refreezing (#163446, immutable-result assertion):
  readonly types govern internal consumers; an internal type-contract violation
  can mutate shared metadata. Archive verification and worker-close ordering stay.
- Post-fetch CI summary reread (#160108, synthetic identity review): exact selected
  head diagnostics may finish while the PR summary refreshes; UI selected-head
  matching, upstream identity and live disclosure/credential checks remain.
- Startup-log generation switching (#141736/#126627, synthetic supersession behind
  startup admission): a queued boot log may describe boot rather than replacement
  facts. Plugin attachment, trust enforcement and service ownership stay current.
- Hook replay promise/object identity checks (#139155): private writers cannot
  replace or prune pending/active entries. If a future writer breaks that invariant,
  completion may overwrite it; current idempotency, terminal TTL/LRU and auth stay.
- Boxed-primitive JSON coercion probes (#158572, synthetic boxed-value cases):
  ordinary tool payloads retain measured early budget rejection. Exotic boxed
  strings may serialize before rejection by the unchanged final exact byte cap;
  native JSON owns their coercion instead of custom per-value probes.

Model detail reads use the exact configured inventory already built in the same
synchronous request frame instead of resolving agent membership a second time
(#114388/#159177). Syntax, authentication, read scope and exact membership stay.
GitHub publication keeps its covering finally release instead of releasing twice.
The attempted prepared-workspace cache substitution was dropped: ordinary late
ACK publications can hide live authority while durable staged facts still exist.

Phase E standalone session memory and its tests are untouched.

BELOW-500 lane packet for coordinator bundling; no standalone PR.
Net production LOC: 217 removed (109 added / 326 removed, 20 files).
Net test LOC: 114 removed. Three-day and fourteen-day history inspection plus
largest-first owner sweeps exhausted sound candidates; rejected cuts stay out.

Local proof

- Full core production types and all four Gateway test-type graphs passed.
- Runtime value cycles: 0. Madge cycles: 0; no import edge added afterward.
- Changed-file format, diff checks, targeted production/test lint passed after
  correcting the terminal selector to toSorted. No new suppression.
- Lint-suppressions: 3 tests passed on the settled source.
- Startup post-attach owner: 88 tests passed in the final isolated run.
- Focused runs reported passing terminal lifecycle/eviction/detach, health,
  hook fanout, catalog/launch/validation/bootstrap, PR details, automation/cron,
  chat state, observers, real models HTTP e2e, publication database/provisioning/
  availability and GitHub read/target-discovery cases. The aggregate selections
  were intentionally stopped, so this is not a full-suite pass claim.
- Independent review completed. Two final findings were declined with source
  evidence: the retained unconditional finally releases the sole publication
  acquisition, and closed metadata schemas still reject unknown properties.

Proof gaps

- server.hooks.test.ts / handles auth, wake, and agent flows timed out at
  120000ms during Gateway startup (207133ms reported elapsed). Its requests have
  no idempotency key and bypass the removed replay checks, but no conclusive
  head-vs-main attribution was established. Later successful Gateway startups
  are not a claimed repair. No retry, timeout increase, skip, or weaker assertion.
- Expanded local selections were stopped rather than running more unchanged
  guest/integration variants on the loaded host. Bundle CI remains broad proof.
- Full check-changed was stopped during the broad SQLite inventory. Preceding
  conflict/line/assertion ratchets passed; env-var budget 455 vs 454 failed and
  reproduced on the untouched base index. No budget was changed. This is base
  evidence, not current-main CI attribution.
- No qualified before/after timing comparison or performance claim. No hosted
  PR CI exists for this branch-only lane packet.

* refactor(gateway): consolidate MCP schemas and Talk target ownership

Use Node's maintained deep comparator for MCP JSON schemas and remove defensive
throwing-getter readers plus their synthetic-only fixture. Keep schema input
validation, advertised-schema invocation membership, normalization, top-level
copies and the equal-schema warning/deduplication behavior from human issue #98437.

Inline Talk's sole-caller storage resolver and forwarding assertion adapter.
All four callers still assert the exact prepared target at the original effect.
Trust Rastermill's dimension fitting instead of rechecking encoder output; retain
input limits and the byte-limit check/error. Drop the optional initial metadata
catch-up event version fence; retain actual model readiness and runtime authority.

Best-effort tradeoffs accepted

- Throwing in-process tool metadata getters/spread (#88410, 705bdce): the
  introducing PR explicitly used synthetic fuzzplugin/mockplugin fixtures, not
  a live client report. A broken plugin getter now fails the request clearly
  rather than silently omitting that tool. Security and schema shape checks stay.
- Exotic non-JSON schema objects: the custom comparator from #103171 now uses
  isDeepStrictEqual with skipPrototype. Valid JSON schema equivalence, including
  insertion order, stays; symbol-bearing or exotic JS objects may warn differently.
  Preserve the real issue #98437 warning reduction and process-lifetime dedupe.
- Encoder output dimension recheck (#169449, 8db1c35): the introducing cutover
  explicitly made Rastermill own fitting, confirmed in its implementation. A
  future encoder contract bug can produce an oversized-dimension image; repair
  that owner rather than validate its output again in Gateway. Input/byte bounds stay.
- Initial chat metadata catch-up versions (#123433, f3db7fe): synthetic
  restart/Testbox provenance without a linked human incident. Overlapping initial
  catch-up and model invalidation can briefly mark display availability and cause
  an optional refresh warning; the next publication converges. Current model
  readiness, runtime authority/failure handling and write settlement stay.

Second-pass production reduction: 127 LOC; cumulative lane reduction: 344 LOC.
Phase E standalone memory backend, machinery and tests are untouched.
Same branch, no conflict/rebase, no PR at the below-500 ending threshold.

Provenance

#88410
#103171
#98437
#169449
#123433
#169622

Proof

- Fresh full core production types, targeted core type-aware lint, formatter and
  diff checks passed. Changed-check classification completed.
- Fresh runtime cycles: 0; Madge cycles: 0; no new component.
- Fresh four-file selection passed 70 tests across lint-suppressions (3), Talk
  voice (20), chat metadata (20) and Talk target (27); all kept tests unchanged.
  Loaded-host wall time: 1711.09s including cold preparation; no before/after
  performance claim.
- Independent review completed scoped-clean P0-P2; no actionable findings.
- Final MCP schema/image selection passed all 5 chosen cases in 269.92s wall:
  union/prototype properties, malformed/boolean variants, literal constraints,
  real HTTP equal-schema warning dedupe, and orientation-aware resized delivery.
  The name filter left 96 unrelated cases unrun; no test skips were added.
- Initial root-config lint failed before linting while unrelated plugin SDK
  declarations timed out at 300000ms. Correct source-backed core-config routing
  passed without skipping preparation or increasing any timeout.

Earlier packet gaps remain: server.hooks.test.ts timed out during Gateway startup
without conclusive head-vs-main attribution; a later successful startup is not a
claimed repair. Earlier expanded local selections and full check-changed were
stopped under load. The earlier env-var budget failure reproduced on its untouched
base, not current-main CI. No timeout increase, retry, skip, assertion weakening,
or baseline change was used. Full Gateway/integration proof belongs to bundle CI.

No standalone PR or hosted CI for this below-500 lane packet. Detailed coverage,
provenance, rejected candidates and proof are retained in .local/y06-ledger.md.

* refactor(codex): simplify transport and catalog bookkeeping

Remove malformed JSON reconstruction and its continuation-only bookkeeping,
redundant config copies, post-write rereads and duplicate internal checks.
Reuse the existing final-config hook builder. Preserve valid JSON framing,
external input validation, redaction, live effect authority, resource bounds,
normal concurrent sessions, persisted shapes and write settlement.

Best-effort tradeoffs accepted

- Raw LF inside JSON strings is no longer reconstructed. Direct commit
  6fd35f6 and follow-ups #101221,
  #151399 and #162559 use synthetic malformed frames, not a cited human
  incident. Such frames warn/drop; later valid frames continue. A missing
  RPC reply can reach the existing request timeout. This also removes the
  recovery-only pending-route and per-request row-budget snapshots.
- Unsupported in-place mutation of published config/start objects may become
  visible to a request. Ordinary reload replaces the config object. #162912
  fixed human heap-OOM #162802 by sharing clones; removing copying preserves
  that allocation protection without another snapshot cache.
- A node finalization commit followed by a rejected promise now surfaces the
  error. #106927's lost-receipt path was synthetic, with no cited human
  incident. The durable binding stays installed; next Continue retries the
  same deterministic session. Same-session/home/harness write checks stay.
- Invalid numeric waiter facts from a trusted internal producer are no longer
  discarded by redundant diagnostics validation. #149616 supplied synthetic
  correlation proof, not a human incident. Egress string allowlists and all
  resource bounds remain; catalog results are unaffected.
- An unsupported offline writer changing a row immediately after successful
  CAS/ownership recording is no longer caught by another reread. #168479,
  #166575 and #170511 supplied synthetic migration machinery, not a cited
  competing-writer human report. CAS conflicts, initial/post-register checks,
  leases and retained-sidecar recovery stay. Next migration reconciles it.
- An impossible-on-wire cyclic/BigInt tool value now throws rather than
  silently omitting output. #70966/#107680 cite no human serialization
  incident; protocol payloads are JSON values and local records use those
  values/primitives. Network validation remains at the transport boundary.
- Already-validated binding hashes are not parsed again after normalization
  (#164197/283d5e6fe37). Initial persisted-input validation and the human
  fingerprint-overflow fix #104503 remain intact.
- The bootstrap decision no longer accepts a duplicate projection input
  (a4c2e7f): its only production caller already puts the same projection
  into expectedBinding, whose canonical comparator checks it. No separate
  recoverable scenario or public reason contract is lost.

Sibling Codex source contract inspected:
codex-rs/app-server-transport/src/transport/mod.rs:272-284 uses
serde_json::to_string; transport/stdio.rs:82-96 writes those serialized bytes.
codex-rs/app-server-protocol/src/protocol/v2/item.rs:333-352 and
v2/mcp.rs:208-224 define JSON MCP results and string errors.

Net production reduction: 249 lines (+97/-346), excluding tests, fixtures,
test support, generated files and declarations. Phase E memory is untouched.
Detailed scope/provenance coverage remains in the requested .local/y12 ledgers.

Proof so far: independent P0-P2 review scoped-clean, targeted source-graph
typecheck exit 0, runtime value cycles 0, lint-suppressions 3/3, oxfmt and
git diff --check pass. Post-review edits only remove an unused test import
and mechanically migrate one remaining decoder spy without weakening its
assertion. Focused tests, canonical typed lint and static cycles remain
pending; this is not an all-green or merged claim. Package SDK declaration
preparation timed out under load and the selector dry-run exited SIGILL.

Out-of-lane coordinator follow-up: docs/plugins/codex-harness.md:67-69 still
describes incomplete-frame recovery. Replace that description with malformed
frames producing a redacted diagnostic and being dropped while subsequent
valid frames continue normally.

* refactor(codex): remove duplicate approval and projection machinery

Use the standard deep comparator at the existing approval rewrite-denial
boundary, trust the typed host approval result, reuse collected assistant
fallbacks and prepared catalog connection options, remove redundant internal
metadata copies and normalized agent-directory fallback, and inline the sole
account-usage registrar while retaining lazy loading and administrator scope.
Forward optional release arguments once without changing ownership/settlement.

The first focused run exposed cursor retargeting after cache removal. Retain
the existing regression test and carry the resident's captured requestOptions
to every hydration page. Published config can be edited in place; the original
commit's blanket immutable-config description was too strong. No cloning or
global snapshot cache is restored.

Best-effort tradeoffs accepted

- A typed host approval result with a getter/proxy decision can now throw or
  be read normally, rather than receive descriptor inspection. #70751 added
  synthetic defenses, not a cited human incident. The production host returns
  authenticated Gateway JSON. Null-unavailable, cancellation and two-phase
  decision settlement remain unchanged.
- Non-JSON hook replacements may be conservatively denied by deep comparison
  rather than canonical JSON text. #82496 protects a real rewrite-denial
  boundary, which remains; the private recursive serializer is not a contract.
- Internal cached session metadata is returned without defensive cloning.
  #134660 introduced the copies without a metadata-mutation human incident;
  #164197 moved them unchanged. The sole parser only reads metadata and still
  clones exposed tool input schemas. A future mutating internal consumer must
  own its copy instead of requiring every read to clone the full object.
- The agent directory no longer has a second fallback after connection setup
  already resolved it (#120366, owner split #151753). Invalid hand-constructed
  internal runtime objects are unsupported; production always supplies it.

Catalog hydration retains source.assertCurrent before using captured connection
options: WebSocket start options may contain credentials. Source authority is
not an accepted best-effort tradeoff. Opaque cursors still stay with their
selected home's prepared connection options.

Exact sibling Codex contract personally inspected at
8f38d5a877da8c5c2c0b5158e72bb5f2290a3157:
codex-rs/app-server-transport/src/transport/mod.rs:272-282 serializes every
outgoing message with serde_json::to_string. transport/stdio.rs:136-143 only
adds the LF delimiter, and :87-93 writes those serialized bytes directly.
transport/websocket.rs:313-320 sends the same serializer result unchanged.
This confirms the earlier malformed raw-LF reconstruction removal; external
JSON parsing, warn/drop diagnostics and subsequent valid frames remain.

Branch total: 330 net production LOC removed (+125/-455), excluding tests,
fixtures, test support, generated files and declarations. Phase E memory,
inactive foundations, public contracts, live authority, resource limits and
write settlement remain untouched. Detailed requested coverage/provenance is
in the task-local y12 ledgers.

Proof: the 30-suite focused run passed 533 cases and failed one unchanged
native-hook fallback case at its existing five-second execution budget. A
failed-case-only replay hit the same deadline (95s case wall time under load).
No main-side test replay establishes attribution; do not call it main-red or
claim fully green focused proof. Retained cursor regression passed 9/9;
lint-suppressions passed 3/3. Expanded lint's 20 SDK-resolution diagnostics
all reproduce on independently installed pinned main 7878a57 with matching
unprepared SDK artifacts (0 introduced, 0 unknown); this is not main CI proof.

Independent final-input review's only finding incorrectly requires a boolean
third deep-comparison argument. Pinned @types/node 26.6.4 explicitly declares
the options object, and isolated Node 26.5 confirms skipPrototype:true behavior.
Reject that finding on source/runtime evidence, not with a cast or suppression.
Earlier full-candidate review's sole index-only cursor finding was resolved by
staging the repair. No remaining accepted actionable finding.

Canonical Madge and SDK-artifact lint preparation remain unproven after prior
load-limited attempts; changed-selector preparation failed with native SIGILL.
Runtime value cycles are zero. The only new import edge is a Node builtin;
account registration contracts index-to-registrar-to-runtime to index-to-runtime.

Final-source catalog proof: 25/25 pass, including obsolete-source list/pin
rejection and cursor affinity. Final targeted source-backed typecheck exits0,
including the exact comparison call questioned by review. Format and diff
checks pass. No public SDK export, schema, protocol, dependency, permission,
durability or retention change. Below500 branch-only handoff; no PR or merge.

* docs: align Codex framing and worktree cache behavior

* fix: preserve MCP schema filtering and release assertions

Retain filtering of unreadable parameter schemas before MCP automation authority capture. Align three Codex sibling assertions with forwarded optional release arguments while preserving their target, count, and lifecycle contracts.
steipete added a commit that referenced this pull request Oct 15, 2026
* test(ui): migrate message and pane fixtures to Solid

* test(ui): mount queue and prediction fixtures with Solid

* test(ui): provide application context to native chat goal fixtures

* test(ui): report packaged Workboard startup failures

* refactor: deslop gateway and Codex extension (wave-5 bundle D) (#173092)

* refactor(gateway): simplify diagnostic state and internal metadata paths

Consolidate worker catalog loading and remove duplicate internal copies,
metadata reconstruction, cleanup, and speculative diagnostic ordering machinery.
Keep authentication, live effect authority, persisted shapes, shutdown write
settlement, bounded caches, and terminal admission/spawn limits.

Best-effort tradeoffs accepted

Provenance below identifies synthetic/speculative introduction evidence, not a
linked human actual-use incident. Security, durability and real resource limits
remain independently protected.

- Health publication generations (#116681, synthetic overlap reproduction):
  overlapping passive/probe samples now publish in completion order; next refresh
  replaces stale diagnostics. Separate probe work and public/admin audiences stay.
- Observer request generations (#112958, structured-review race): an A-B-A model
  change during one in-flight digest can accept that digest; cancellation, current
  session/model checks and disclosure authorization remain.
- GitHub target early registry invalidation (#167189, synthetic invalidation test):
  discovery may be stale for its existing 15-second TTL; publication verifies Git
  afresh and cached reads still check current connection/source authority.
- Automation badge build epochs (#104730, structured review): latest completed
  service start supplies display facts; scheduling and stale-owner unregister stay.
- Terminal victim claim/release protocol (#116101, synthetic autoreview
  interleavings): reserve pooled free+idle capacity instead, then select the actual
  unviewed idle victim at registration. Newly viewed victims survive; a replacement
  without an eligible victim fails and kills its backend. Both hard limits remain.
- Launch JSON snapshot/revalidation (#123033, synthetic caller mutation): trust the
  tunnel-owned prepared descriptor; a caller violating ownership can mutate it.
  Negotiated options still use a shallow copy and node input validation remains.
- Worker catalog output copies (#142095, schema mirrors) and display settings
  clone: trust closed-schema-validated, documented process-stable metadata and
  internally owned settings. A future provider violating that contract can mutate
  cosmetic metadata or miss notifications until a later row/config refresh or
  restart; live allocation validation remains.
- Artifact descriptor freezing/refreezing (#163446, immutable-result assertion):
  readonly types govern internal consumers; an internal type-contract violation
  can mutate shared metadata. Archive verification and worker-close ordering stay.
- Post-fetch CI summary reread (#160108, synthetic identity review): exact selected
  head diagnostics may finish while the PR summary refreshes; UI selected-head
  matching, upstream identity and live disclosure/credential checks remain.
- Startup-log generation switching (#141736/#126627, synthetic supersession behind
  startup admission): a queued boot log may describe boot rather than replacement
  facts. Plugin attachment, trust enforcement and service ownership stay current.
- Hook replay promise/object identity checks (#139155): private writers cannot
  replace or prune pending/active entries. If a future writer breaks that invariant,
  completion may overwrite it; current idempotency, terminal TTL/LRU and auth stay.
- Boxed-primitive JSON coercion probes (#158572, synthetic boxed-value cases):
  ordinary tool payloads retain measured early budget rejection. Exotic boxed
  strings may serialize before rejection by the unchanged final exact byte cap;
  native JSON owns their coercion instead of custom per-value probes.

Model detail reads use the exact configured inventory already built in the same
synchronous request frame instead of resolving agent membership a second time
(#114388/#159177). Syntax, authentication, read scope and exact membership stay.
GitHub publication keeps its covering finally release instead of releasing twice.
The attempted prepared-workspace cache substitution was dropped: ordinary late
ACK publications can hide live authority while durable staged facts still exist.

Phase E standalone session memory and its tests are untouched.

BELOW-500 lane packet for coordinator bundling; no standalone PR.
Net production LOC: 217 removed (109 added / 326 removed, 20 files).
Net test LOC: 114 removed. Three-day and fourteen-day history inspection plus
largest-first owner sweeps exhausted sound candidates; rejected cuts stay out.

Local proof

- Full core production types and all four Gateway test-type graphs passed.
- Runtime value cycles: 0. Madge cycles: 0; no import edge added afterward.
- Changed-file format, diff checks, targeted production/test lint passed after
  correcting the terminal selector to toSorted. No new suppression.
- Lint-suppressions: 3 tests passed on the settled source.
- Startup post-attach owner: 88 tests passed in the final isolated run.
- Focused runs reported passing terminal lifecycle/eviction/detach, health,
  hook fanout, catalog/launch/validation/bootstrap, PR details, automation/cron,
  chat state, observers, real models HTTP e2e, publication database/provisioning/
  availability and GitHub read/target-discovery cases. The aggregate selections
  were intentionally stopped, so this is not a full-suite pass claim.
- Independent review completed. Two final findings were declined with source
  evidence: the retained unconditional finally releases the sole publication
  acquisition, and closed metadata schemas still reject unknown properties.

Proof gaps

- server.hooks.test.ts / handles auth, wake, and agent flows timed out at
  120000ms during Gateway startup (207133ms reported elapsed). Its requests have
  no idempotency key and bypass the removed replay checks, but no conclusive
  head-vs-main attribution was established. Later successful Gateway startups
  are not a claimed repair. No retry, timeout increase, skip, or weaker assertion.
- Expanded local selections were stopped rather than running more unchanged
  guest/integration variants on the loaded host. Bundle CI remains broad proof.
- Full check-changed was stopped during the broad SQLite inventory. Preceding
  conflict/line/assertion ratchets passed; env-var budget 455 vs 454 failed and
  reproduced on the untouched base index. No budget was changed. This is base
  evidence, not current-main CI attribution.
- No qualified before/after timing comparison or performance claim. No hosted
  PR CI exists for this branch-only lane packet.

* refactor(gateway): consolidate MCP schemas and Talk target ownership

Use Node's maintained deep comparator for MCP JSON schemas and remove defensive
throwing-getter readers plus their synthetic-only fixture. Keep schema input
validation, advertised-schema invocation membership, normalization, top-level
copies and the equal-schema warning/deduplication behavior from human issue #98437.

Inline Talk's sole-caller storage resolver and forwarding assertion adapter.
All four callers still assert the exact prepared target at the original effect.
Trust Rastermill's dimension fitting instead of rechecking encoder output; retain
input limits and the byte-limit check/error. Drop the optional initial metadata
catch-up event version fence; retain actual model readiness and runtime authority.

Best-effort tradeoffs accepted

- Throwing in-process tool metadata getters/spread (#88410, 705bdce): the
  introducing PR explicitly used synthetic fuzzplugin/mockplugin fixtures, not
  a live client report. A broken plugin getter now fails the request clearly
  rather than silently omitting that tool. Security and schema shape checks stay.
- Exotic non-JSON schema objects: the custom comparator from #103171 now uses
  isDeepStrictEqual with skipPrototype. Valid JSON schema equivalence, including
  insertion order, stays; symbol-bearing or exotic JS objects may warn differently.
  Preserve the real issue #98437 warning reduction and process-lifetime dedupe.
- Encoder output dimension recheck (#169449, 8db1c35): the introducing cutover
  explicitly made Rastermill own fitting, confirmed in its implementation. A
  future encoder contract bug can produce an oversized-dimension image; repair
  that owner rather than validate its output again in Gateway. Input/byte bounds stay.
- Initial chat metadata catch-up versions (#123433, f3db7fe): synthetic
  restart/Testbox provenance without a linked human incident. Overlapping initial
  catch-up and model invalidation can briefly mark display availability and cause
  an optional refresh warning; the next publication converges. Current model
  readiness, runtime authority/failure handling and write settlement stay.

Second-pass production reduction: 127 LOC; cumulative lane reduction: 344 LOC.
Phase E standalone memory backend, machinery and tests are untouched.
Same branch, no conflict/rebase, no PR at the below-500 ending threshold.

Provenance

#88410
#103171
#98437
#169449
#123433
#169622

Proof

- Fresh full core production types, targeted core type-aware lint, formatter and
  diff checks passed. Changed-check classification completed.
- Fresh runtime cycles: 0; Madge cycles: 0; no new component.
- Fresh four-file selection passed 70 tests across lint-suppressions (3), Talk
  voice (20), chat metadata (20) and Talk target (27); all kept tests unchanged.
  Loaded-host wall time: 1711.09s including cold preparation; no before/after
  performance claim.
- Independent review completed scoped-clean P0-P2; no actionable findings.
- Final MCP schema/image selection passed all 5 chosen cases in 269.92s wall:
  union/prototype properties, malformed/boolean variants, literal constraints,
  real HTTP equal-schema warning dedupe, and orientation-aware resized delivery.
  The name filter left 96 unrelated cases unrun; no test skips were added.
- Initial root-config lint failed before linting while unrelated plugin SDK
  declarations timed out at 300000ms. Correct source-backed core-config routing
  passed without skipping preparation or increasing any timeout.

Earlier packet gaps remain: server.hooks.test.ts timed out during Gateway startup
without conclusive head-vs-main attribution; a later successful startup is not a
claimed repair. Earlier expanded local selections and full check-changed were
stopped under load. The earlier env-var budget failure reproduced on its untouched
base, not current-main CI. No timeout increase, retry, skip, assertion weakening,
or baseline change was used. Full Gateway/integration proof belongs to bundle CI.

No standalone PR or hosted CI for this below-500 lane packet. Detailed coverage,
provenance, rejected candidates and proof are retained in .local/y06-ledger.md.

* refactor(codex): simplify transport and catalog bookkeeping

Remove malformed JSON reconstruction and its continuation-only bookkeeping,
redundant config copies, post-write rereads and duplicate internal checks.
Reuse the existing final-config hook builder. Preserve valid JSON framing,
external input validation, redaction, live effect authority, resource bounds,
normal concurrent sessions, persisted shapes and write settlement.

Best-effort tradeoffs accepted

- Raw LF inside JSON strings is no longer reconstructed. Direct commit
  6fd35f6 and follow-ups #101221,
  #151399 and #162559 use synthetic malformed frames, not a cited human
  incident. Such frames warn/drop; later valid frames continue. A missing
  RPC reply can reach the existing request timeout. This also removes the
  recovery-only pending-route and per-request row-budget snapshots.
- Unsupported in-place mutation of published config/start objects may become
  visible to a request. Ordinary reload replaces the config object. #162912
  fixed human heap-OOM #162802 by sharing clones; removing copying preserves
  that allocation protection without another snapshot cache.
- A node finalization commit followed by a rejected promise now surfaces the
  error. #106927's lost-receipt path was synthetic, with no cited human
  incident. The durable binding stays installed; next Continue retries the
  same deterministic session. Same-session/home/harness write checks stay.
- Invalid numeric waiter facts from a trusted internal producer are no longer
  discarded by redundant diagnostics validation. #149616 supplied synthetic
  correlation proof, not a human incident. Egress string allowlists and all
  resource bounds remain; catalog results are unaffected.
- An unsupported offline writer changing a row immediately after successful
  CAS/ownership recording is no longer caught by another reread. #168479,
  #166575 and #170511 supplied synthetic migration machinery, not a cited
  competing-writer human report. CAS conflicts, initial/post-register checks,
  leases and retained-sidecar recovery stay. Next migration reconciles it.
- An impossible-on-wire cyclic/BigInt tool value now throws rather than
  silently omitting output. #70966/#107680 cite no human serialization
  incident; protocol payloads are JSON values and local records use those
  values/primitives. Network validation remains at the transport boundary.
- Already-validated binding hashes are not parsed again after normalization
  (#164197/283d5e6fe37). Initial persisted-input validation and the human
  fingerprint-overflow fix #104503 remain intact.
- The bootstrap decision no longer accepts a duplicate projection input
  (a4c2e7f): its only production caller already puts the same projection
  into expectedBinding, whose canonical comparator checks it. No separate
  recoverable scenario or public reason contract is lost.

Sibling Codex source contract inspected:
codex-rs/app-server-transport/src/transport/mod.rs:272-284 uses
serde_json::to_string; transport/stdio.rs:82-96 writes those serialized bytes.
codex-rs/app-server-protocol/src/protocol/v2/item.rs:333-352 and
v2/mcp.rs:208-224 define JSON MCP results and string errors.

Net production reduction: 249 lines (+97/-346), excluding tests, fixtures,
test support, generated files and declarations. Phase E memory is untouched.
Detailed scope/provenance coverage remains in the requested .local/y12 ledgers.

Proof so far: independent P0-P2 review scoped-clean, targeted source-graph
typecheck exit 0, runtime value cycles 0, lint-suppressions 3/3, oxfmt and
git diff --check pass. Post-review edits only remove an unused test import
and mechanically migrate one remaining decoder spy without weakening its
assertion. Focused tests, canonical typed lint and static cycles remain
pending; this is not an all-green or merged claim. Package SDK declaration
preparation timed out under load and the selector dry-run exited SIGILL.

Out-of-lane coordinator follow-up: docs/plugins/codex-harness.md:67-69 still
describes incomplete-frame recovery. Replace that description with malformed
frames producing a redacted diagnostic and being dropped while subsequent
valid frames continue normally.

* refactor(codex): remove duplicate approval and projection machinery

Use the standard deep comparator at the existing approval rewrite-denial
boundary, trust the typed host approval result, reuse collected assistant
fallbacks and prepared catalog connection options, remove redundant internal
metadata copies and normalized agent-directory fallback, and inline the sole
account-usage registrar while retaining lazy loading and administrator scope.
Forward optional release arguments once without changing ownership/settlement.

The first focused run exposed cursor retargeting after cache removal. Retain
the existing regression test and carry the resident's captured requestOptions
to every hydration page. Published config can be edited in place; the original
commit's blanket immutable-config description was too strong. No cloning or
global snapshot cache is restored.

Best-effort tradeoffs accepted

- A typed host approval result with a getter/proxy decision can now throw or
  be read normally, rather than receive descriptor inspection. #70751 added
  synthetic defenses, not a cited human incident. The production host returns
  authenticated Gateway JSON. Null-unavailable, cancellation and two-phase
  decision settlement remain unchanged.
- Non-JSON hook replacements may be conservatively denied by deep comparison
  rather than canonical JSON text. #82496 protects a real rewrite-denial
  boundary, which remains; the private recursive serializer is not a contract.
- Internal cached session metadata is returned without defensive cloning.
  #134660 introduced the copies without a metadata-mutation human incident;
  #164197 moved them unchanged. The sole parser only reads metadata and still
  clones exposed tool input schemas. A future mutating internal consumer must
  own its copy instead of requiring every read to clone the full object.
- The agent directory no longer has a second fallback after connection setup
  already resolved it (#120366, owner split #151753). Invalid hand-constructed
  internal runtime objects are unsupported; production always supplies it.

Catalog hydration retains source.assertCurrent before using captured connection
options: WebSocket start options may contain credentials. Source authority is
not an accepted best-effort tradeoff. Opaque cursors still stay with their
selected home's prepared connection options.

Exact sibling Codex contract personally inspected at
8f38d5a877da8c5c2c0b5158e72bb5f2290a3157:
codex-rs/app-server-transport/src/transport/mod.rs:272-282 serializes every
outgoing message with serde_json::to_string. transport/stdio.rs:136-143 only
adds the LF delimiter, and :87-93 writes those serialized bytes directly.
transport/websocket.rs:313-320 sends the same serializer result unchanged.
This confirms the earlier malformed raw-LF reconstruction removal; external
JSON parsing, warn/drop diagnostics and subsequent valid frames remain.

Branch total: 330 net production LOC removed (+125/-455), excluding tests,
fixtures, test support, generated files and declarations. Phase E memory,
inactive foundations, public contracts, live authority, resource limits and
write settlement remain untouched. Detailed requested coverage/provenance is
in the task-local y12 ledgers.

Proof: the 30-suite focused run passed 533 cases and failed one unchanged
native-hook fallback case at its existing five-second execution budget. A
failed-case-only replay hit the same deadline (95s case wall time under load).
No main-side test replay establishes attribution; do not call it main-red or
claim fully green focused proof. Retained cursor regression passed 9/9;
lint-suppressions passed 3/3. Expanded lint's 20 SDK-resolution diagnostics
all reproduce on independently installed pinned main 7878a57 with matching
unprepared SDK artifacts (0 introduced, 0 unknown); this is not main CI proof.

Independent final-input review's only finding incorrectly requires a boolean
third deep-comparison argument. Pinned @types/node 26.6.4 explicitly declares
the options object, and isolated Node 26.5 confirms skipPrototype:true behavior.
Reject that finding on source/runtime evidence, not with a cast or suppression.
Earlier full-candidate review's sole index-only cursor finding was resolved by
staging the repair. No remaining accepted actionable finding.

Canonical Madge and SDK-artifact lint preparation remain unproven after prior
load-limited attempts; changed-selector preparation failed with native SIGILL.
Runtime value cycles are zero. The only new import edge is a Node builtin;
account registration contracts index-to-registrar-to-runtime to index-to-runtime.

Final-source catalog proof: 25/25 pass, including obsolete-source list/pin
rejection and cursor affinity. Final targeted source-backed typecheck exits0,
including the exact comparison call questioned by review. Format and diff
checks pass. No public SDK export, schema, protocol, dependency, permission,
durability or retention change. Below500 branch-only handoff; no PR or merge.

* docs: align Codex framing and worktree cache behavior

* fix: preserve MCP schema filtering and release assertions

Retain filtering of unreadable parameter schemas before MCP automation authority capture. Align three Codex sibling assertions with forwarded optional release arguments while preserving their target, count, and lifecycle contracts.

* fix: remote model catalogs stop refreshing on newer modalities (#173038)

* fix: keep remote model catalogs refreshing across releases

Project both hosted formats to released input modalities and isolate malformed remote model rows. Preserve strict generator validation and transport sanitization. Fixes #173027.

* test: cover catalog row isolation through refresh and publication

Narrow dynamically loaded parser functions for script typechecking. Update integration expectations to preserve valid rows instead of rejecting entire downloads, as required by #173027.

* fix: retain the last catalog when no valid model rows survive

* fix: preserve standalone pricing-only v1 catalogs

* fix: omit catalog models with no supported input modalities

* fix: preserve catalog publication gates after modality filtering

* fix: omit empty inputs produced by catalog hydration

* perf(models): preserve catalog sanitizer entry compaction

* test(gateway,media,secrets,browser,agents,otel): remove low-value tests (batch d123) (#173141)

* test(gateway): deslop x4070 tests

* test(media-understanding): deslop x4071 tests

* test(secrets): deslop x4072 tests

* test(browser): deslop x4074 tests

* test(agents): deslop x4073 tests

* test(diagnostics-otel): deslop x4077 tests

* test: retain distinct session and credential rollback coverage
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…law#173092)

* refactor(gateway): simplify diagnostic state and internal metadata paths

Consolidate worker catalog loading and remove duplicate internal copies,
metadata reconstruction, cleanup, and speculative diagnostic ordering machinery.
Keep authentication, live effect authority, persisted shapes, shutdown write
settlement, bounded caches, and terminal admission/spawn limits.

Best-effort tradeoffs accepted

Provenance below identifies synthetic/speculative introduction evidence, not a
linked human actual-use incident. Security, durability and real resource limits
remain independently protected.

- Health publication generations (openclaw#116681, synthetic overlap reproduction):
  overlapping passive/probe samples now publish in completion order; next refresh
  replaces stale diagnostics. Separate probe work and public/admin audiences stay.
- Observer request generations (openclaw#112958, structured-review race): an A-B-A model
  change during one in-flight digest can accept that digest; cancellation, current
  session/model checks and disclosure authorization remain.
- GitHub target early registry invalidation (openclaw#167189, synthetic invalidation test):
  discovery may be stale for its existing 15-second TTL; publication verifies Git
  afresh and cached reads still check current connection/source authority.
- Automation badge build epochs (openclaw#104730, structured review): latest completed
  service start supplies display facts; scheduling and stale-owner unregister stay.
- Terminal victim claim/release protocol (openclaw#116101, synthetic autoreview
  interleavings): reserve pooled free+idle capacity instead, then select the actual
  unviewed idle victim at registration. Newly viewed victims survive; a replacement
  without an eligible victim fails and kills its backend. Both hard limits remain.
- Launch JSON snapshot/revalidation (openclaw#123033, synthetic caller mutation): trust the
  tunnel-owned prepared descriptor; a caller violating ownership can mutate it.
  Negotiated options still use a shallow copy and node input validation remains.
- Worker catalog output copies (openclaw#142095, schema mirrors) and display settings
  clone: trust closed-schema-validated, documented process-stable metadata and
  internally owned settings. A future provider violating that contract can mutate
  cosmetic metadata or miss notifications until a later row/config refresh or
  restart; live allocation validation remains.
- Artifact descriptor freezing/refreezing (openclaw#163446, immutable-result assertion):
  readonly types govern internal consumers; an internal type-contract violation
  can mutate shared metadata. Archive verification and worker-close ordering stay.
- Post-fetch CI summary reread (openclaw#160108, synthetic identity review): exact selected
  head diagnostics may finish while the PR summary refreshes; UI selected-head
  matching, upstream identity and live disclosure/credential checks remain.
- Startup-log generation switching (openclaw#141736/openclaw#126627, synthetic supersession behind
  startup admission): a queued boot log may describe boot rather than replacement
  facts. Plugin attachment, trust enforcement and service ownership stay current.
- Hook replay promise/object identity checks (openclaw#139155): private writers cannot
  replace or prune pending/active entries. If a future writer breaks that invariant,
  completion may overwrite it; current idempotency, terminal TTL/LRU and auth stay.
- Boxed-primitive JSON coercion probes (openclaw#158572, synthetic boxed-value cases):
  ordinary tool payloads retain measured early budget rejection. Exotic boxed
  strings may serialize before rejection by the unchanged final exact byte cap;
  native JSON owns their coercion instead of custom per-value probes.

Model detail reads use the exact configured inventory already built in the same
synchronous request frame instead of resolving agent membership a second time
(openclaw#114388/openclaw#159177). Syntax, authentication, read scope and exact membership stay.
GitHub publication keeps its covering finally release instead of releasing twice.
The attempted prepared-workspace cache substitution was dropped: ordinary late
ACK publications can hide live authority while durable staged facts still exist.

Phase E standalone session memory and its tests are untouched.

BELOW-500 lane packet for coordinator bundling; no standalone PR.
Net production LOC: 217 removed (109 added / 326 removed, 20 files).
Net test LOC: 114 removed. Three-day and fourteen-day history inspection plus
largest-first owner sweeps exhausted sound candidates; rejected cuts stay out.

Local proof

- Full core production types and all four Gateway test-type graphs passed.
- Runtime value cycles: 0. Madge cycles: 0; no import edge added afterward.
- Changed-file format, diff checks, targeted production/test lint passed after
  correcting the terminal selector to toSorted. No new suppression.
- Lint-suppressions: 3 tests passed on the settled source.
- Startup post-attach owner: 88 tests passed in the final isolated run.
- Focused runs reported passing terminal lifecycle/eviction/detach, health,
  hook fanout, catalog/launch/validation/bootstrap, PR details, automation/cron,
  chat state, observers, real models HTTP e2e, publication database/provisioning/
  availability and GitHub read/target-discovery cases. The aggregate selections
  were intentionally stopped, so this is not a full-suite pass claim.
- Independent review completed. Two final findings were declined with source
  evidence: the retained unconditional finally releases the sole publication
  acquisition, and closed metadata schemas still reject unknown properties.

Proof gaps

- server.hooks.test.ts / handles auth, wake, and agent flows timed out at
  120000ms during Gateway startup (207133ms reported elapsed). Its requests have
  no idempotency key and bypass the removed replay checks, but no conclusive
  head-vs-main attribution was established. Later successful Gateway startups
  are not a claimed repair. No retry, timeout increase, skip, or weaker assertion.
- Expanded local selections were stopped rather than running more unchanged
  guest/integration variants on the loaded host. Bundle CI remains broad proof.
- Full check-changed was stopped during the broad SQLite inventory. Preceding
  conflict/line/assertion ratchets passed; env-var budget 455 vs 454 failed and
  reproduced on the untouched base index. No budget was changed. This is base
  evidence, not current-main CI attribution.
- No qualified before/after timing comparison or performance claim. No hosted
  PR CI exists for this branch-only lane packet.

* refactor(gateway): consolidate MCP schemas and Talk target ownership

Use Node's maintained deep comparator for MCP JSON schemas and remove defensive
throwing-getter readers plus their synthetic-only fixture. Keep schema input
validation, advertised-schema invocation membership, normalization, top-level
copies and the equal-schema warning/deduplication behavior from human issue openclaw#98437.

Inline Talk's sole-caller storage resolver and forwarding assertion adapter.
All four callers still assert the exact prepared target at the original effect.
Trust Rastermill's dimension fitting instead of rechecking encoder output; retain
input limits and the byte-limit check/error. Drop the optional initial metadata
catch-up event version fence; retain actual model readiness and runtime authority.

Best-effort tradeoffs accepted

- Throwing in-process tool metadata getters/spread (openclaw#88410, ad9acf4): the
  introducing PR explicitly used synthetic fuzzplugin/mockplugin fixtures, not
  a live client report. A broken plugin getter now fails the request clearly
  rather than silently omitting that tool. Security and schema shape checks stay.
- Exotic non-JSON schema objects: the custom comparator from openclaw#103171 now uses
  isDeepStrictEqual with skipPrototype. Valid JSON schema equivalence, including
  insertion order, stays; symbol-bearing or exotic JS objects may warn differently.
  Preserve the real issue openclaw#98437 warning reduction and process-lifetime dedupe.
- Encoder output dimension recheck (openclaw#169449, ce6a64f): the introducing cutover
  explicitly made Rastermill own fitting, confirmed in its implementation. A
  future encoder contract bug can produce an oversized-dimension image; repair
  that owner rather than validate its output again in Gateway. Input/byte bounds stay.
- Initial chat metadata catch-up versions (openclaw#123433, 1ae5f94): synthetic
  restart/Testbox provenance without a linked human incident. Overlapping initial
  catch-up and model invalidation can briefly mark display availability and cause
  an optional refresh warning; the next publication converges. Current model
  readiness, runtime authority/failure handling and write settlement stay.

Second-pass production reduction: 127 LOC; cumulative lane reduction: 344 LOC.
Phase E standalone memory backend, machinery and tests are untouched.
Same branch, no conflict/rebase, no PR at the below-500 ending threshold.

Provenance

openclaw#88410
openclaw#103171
openclaw#98437
openclaw#169449
openclaw#123433
openclaw#169622

Proof

- Fresh full core production types, targeted core type-aware lint, formatter and
  diff checks passed. Changed-check classification completed.
- Fresh runtime cycles: 0; Madge cycles: 0; no new component.
- Fresh four-file selection passed 70 tests across lint-suppressions (3), Talk
  voice (20), chat metadata (20) and Talk target (27); all kept tests unchanged.
  Loaded-host wall time: 1711.09s including cold preparation; no before/after
  performance claim.
- Independent review completed scoped-clean P0-P2; no actionable findings.
- Final MCP schema/image selection passed all 5 chosen cases in 269.92s wall:
  union/prototype properties, malformed/boolean variants, literal constraints,
  real HTTP equal-schema warning dedupe, and orientation-aware resized delivery.
  The name filter left 96 unrelated cases unrun; no test skips were added.
- Initial root-config lint failed before linting while unrelated plugin SDK
  declarations timed out at 300000ms. Correct source-backed core-config routing
  passed without skipping preparation or increasing any timeout.

Earlier packet gaps remain: server.hooks.test.ts timed out during Gateway startup
without conclusive head-vs-main attribution; a later successful startup is not a
claimed repair. Earlier expanded local selections and full check-changed were
stopped under load. The earlier env-var budget failure reproduced on its untouched
base, not current-main CI. No timeout increase, retry, skip, assertion weakening,
or baseline change was used. Full Gateway/integration proof belongs to bundle CI.

No standalone PR or hosted CI for this below-500 lane packet. Detailed coverage,
provenance, rejected candidates and proof are retained in .local/y06-ledger.md.

* refactor(codex): simplify transport and catalog bookkeeping

Remove malformed JSON reconstruction and its continuation-only bookkeeping,
redundant config copies, post-write rereads and duplicate internal checks.
Reuse the existing final-config hook builder. Preserve valid JSON framing,
external input validation, redaction, live effect authority, resource bounds,
normal concurrent sessions, persisted shapes and write settlement.

Best-effort tradeoffs accepted

- Raw LF inside JSON strings is no longer reconstructed. Direct commit
  67de049 and follow-ups openclaw#101221,
  openclaw#151399 and openclaw#162559 use synthetic malformed frames, not a cited human
  incident. Such frames warn/drop; later valid frames continue. A missing
  RPC reply can reach the existing request timeout. This also removes the
  recovery-only pending-route and per-request row-budget snapshots.
- Unsupported in-place mutation of published config/start objects may become
  visible to a request. Ordinary reload replaces the config object. openclaw#162912
  fixed human heap-OOM openclaw#162802 by sharing clones; removing copying preserves
  that allocation protection without another snapshot cache.
- A node finalization commit followed by a rejected promise now surfaces the
  error. openclaw#106927's lost-receipt path was synthetic, with no cited human
  incident. The durable binding stays installed; next Continue retries the
  same deterministic session. Same-session/home/harness write checks stay.
- Invalid numeric waiter facts from a trusted internal producer are no longer
  discarded by redundant diagnostics validation. openclaw#149616 supplied synthetic
  correlation proof, not a human incident. Egress string allowlists and all
  resource bounds remain; catalog results are unaffected.
- An unsupported offline writer changing a row immediately after successful
  CAS/ownership recording is no longer caught by another reread. openclaw#168479,
  openclaw#166575 and openclaw#170511 supplied synthetic migration machinery, not a cited
  competing-writer human report. CAS conflicts, initial/post-register checks,
  leases and retained-sidecar recovery stay. Next migration reconciles it.
- An impossible-on-wire cyclic/BigInt tool value now throws rather than
  silently omitting output. openclaw#70966/openclaw#107680 cite no human serialization
  incident; protocol payloads are JSON values and local records use those
  values/primitives. Network validation remains at the transport boundary.
- Already-validated binding hashes are not parsed again after normalization
  (openclaw#164197/ffd07590546). Initial persisted-input validation and the human
  fingerprint-overflow fix openclaw#104503 remain intact.
- The bootstrap decision no longer accepts a duplicate projection input
  (21b8ae5): its only production caller already puts the same projection
  into expectedBinding, whose canonical comparator checks it. No separate
  recoverable scenario or public reason contract is lost.

Sibling Codex source contract inspected:
codex-rs/app-server-transport/src/transport/mod.rs:272-284 uses
serde_json::to_string; transport/stdio.rs:82-96 writes those serialized bytes.
codex-rs/app-server-protocol/src/protocol/v2/item.rs:333-352 and
v2/mcp.rs:208-224 define JSON MCP results and string errors.

Net production reduction: 249 lines (+97/-346), excluding tests, fixtures,
test support, generated files and declarations. Phase E memory is untouched.
Detailed scope/provenance coverage remains in the requested .local/y12 ledgers.

Proof so far: independent P0-P2 review scoped-clean, targeted source-graph
typecheck exit 0, runtime value cycles 0, lint-suppressions 3/3, oxfmt and
git diff --check pass. Post-review edits only remove an unused test import
and mechanically migrate one remaining decoder spy without weakening its
assertion. Focused tests, canonical typed lint and static cycles remain
pending; this is not an all-green or merged claim. Package SDK declaration
preparation timed out under load and the selector dry-run exited SIGILL.

Out-of-lane coordinator follow-up: docs/plugins/codex-harness.md:67-69 still
describes incomplete-frame recovery. Replace that description with malformed
frames producing a redacted diagnostic and being dropped while subsequent
valid frames continue normally.

* refactor(codex): remove duplicate approval and projection machinery

Use the standard deep comparator at the existing approval rewrite-denial
boundary, trust the typed host approval result, reuse collected assistant
fallbacks and prepared catalog connection options, remove redundant internal
metadata copies and normalized agent-directory fallback, and inline the sole
account-usage registrar while retaining lazy loading and administrator scope.
Forward optional release arguments once without changing ownership/settlement.

The first focused run exposed cursor retargeting after cache removal. Retain
the existing regression test and carry the resident's captured requestOptions
to every hydration page. Published config can be edited in place; the original
commit's blanket immutable-config description was too strong. No cloning or
global snapshot cache is restored.

Best-effort tradeoffs accepted

- A typed host approval result with a getter/proxy decision can now throw or
  be read normally, rather than receive descriptor inspection. openclaw#70751 added
  synthetic defenses, not a cited human incident. The production host returns
  authenticated Gateway JSON. Null-unavailable, cancellation and two-phase
  decision settlement remain unchanged.
- Non-JSON hook replacements may be conservatively denied by deep comparison
  rather than canonical JSON text. openclaw#82496 protects a real rewrite-denial
  boundary, which remains; the private recursive serializer is not a contract.
- Internal cached session metadata is returned without defensive cloning.
  openclaw#134660 introduced the copies without a metadata-mutation human incident;
  openclaw#164197 moved them unchanged. The sole parser only reads metadata and still
  clones exposed tool input schemas. A future mutating internal consumer must
  own its copy instead of requiring every read to clone the full object.
- The agent directory no longer has a second fallback after connection setup
  already resolved it (openclaw#120366, owner split openclaw#151753). Invalid hand-constructed
  internal runtime objects are unsupported; production always supplies it.

Catalog hydration retains source.assertCurrent before using captured connection
options: WebSocket start options may contain credentials. Source authority is
not an accepted best-effort tradeoff. Opaque cursors still stay with their
selected home's prepared connection options.

Exact sibling Codex contract personally inspected at
8f38d5a877da8c5c2c0b5158e72bb5f2290a3157:
codex-rs/app-server-transport/src/transport/mod.rs:272-282 serializes every
outgoing message with serde_json::to_string. transport/stdio.rs:136-143 only
adds the LF delimiter, and :87-93 writes those serialized bytes directly.
transport/websocket.rs:313-320 sends the same serializer result unchanged.
This confirms the earlier malformed raw-LF reconstruction removal; external
JSON parsing, warn/drop diagnostics and subsequent valid frames remain.

Branch total: 330 net production LOC removed (+125/-455), excluding tests,
fixtures, test support, generated files and declarations. Phase E memory,
inactive foundations, public contracts, live authority, resource limits and
write settlement remain untouched. Detailed requested coverage/provenance is
in the task-local y12 ledgers.

Proof: the 30-suite focused run passed 533 cases and failed one unchanged
native-hook fallback case at its existing five-second execution budget. A
failed-case-only replay hit the same deadline (95s case wall time under load).
No main-side test replay establishes attribution; do not call it main-red or
claim fully green focused proof. Retained cursor regression passed 9/9;
lint-suppressions passed 3/3. Expanded lint's 20 SDK-resolution diagnostics
all reproduce on independently installed pinned main 377d73b with matching
unprepared SDK artifacts (0 introduced, 0 unknown); this is not main CI proof.

Independent final-input review's only finding incorrectly requires a boolean
third deep-comparison argument. Pinned @types/node 26.6.4 explicitly declares
the options object, and isolated Node 26.5 confirms skipPrototype:true behavior.
Reject that finding on source/runtime evidence, not with a cast or suppression.
Earlier full-candidate review's sole index-only cursor finding was resolved by
staging the repair. No remaining accepted actionable finding.

Canonical Madge and SDK-artifact lint preparation remain unproven after prior
load-limited attempts; changed-selector preparation failed with native SIGILL.
Runtime value cycles are zero. The only new import edge is a Node builtin;
account registration contracts index-to-registrar-to-runtime to index-to-runtime.

Final-source catalog proof: 25/25 pass, including obsolete-source list/pin
rejection and cursor affinity. Final targeted source-backed typecheck exits0,
including the exact comparison call questioned by review. Format and diff
checks pass. No public SDK export, schema, protocol, dependency, permission,
durability or retention change. Below500 branch-only handoff; no PR or merge.

* docs: align Codex framing and worktree cache behavior

* fix: preserve MCP schema filtering and release assertions

Retain filtering of unreadable parameter schemas before MCP automation authority capture. Align three Codex sibling assertions with forwarded optional release arguments while preserving their target, count, and lifecycle contracts.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
* test(ui): migrate message and pane fixtures to Solid

* test(ui): mount queue and prediction fixtures with Solid

* test(ui): provide application context to native chat goal fixtures

* test(ui): report packaged Workboard startup failures

* refactor: deslop gateway and Codex extension (wave-5 bundle D) (openclaw#173092)

* refactor(gateway): simplify diagnostic state and internal metadata paths

Consolidate worker catalog loading and remove duplicate internal copies,
metadata reconstruction, cleanup, and speculative diagnostic ordering machinery.
Keep authentication, live effect authority, persisted shapes, shutdown write
settlement, bounded caches, and terminal admission/spawn limits.

Best-effort tradeoffs accepted

Provenance below identifies synthetic/speculative introduction evidence, not a
linked human actual-use incident. Security, durability and real resource limits
remain independently protected.

- Health publication generations (openclaw#116681, synthetic overlap reproduction):
  overlapping passive/probe samples now publish in completion order; next refresh
  replaces stale diagnostics. Separate probe work and public/admin audiences stay.
- Observer request generations (openclaw#112958, structured-review race): an A-B-A model
  change during one in-flight digest can accept that digest; cancellation, current
  session/model checks and disclosure authorization remain.
- GitHub target early registry invalidation (openclaw#167189, synthetic invalidation test):
  discovery may be stale for its existing 15-second TTL; publication verifies Git
  afresh and cached reads still check current connection/source authority.
- Automation badge build epochs (openclaw#104730, structured review): latest completed
  service start supplies display facts; scheduling and stale-owner unregister stay.
- Terminal victim claim/release protocol (openclaw#116101, synthetic autoreview
  interleavings): reserve pooled free+idle capacity instead, then select the actual
  unviewed idle victim at registration. Newly viewed victims survive; a replacement
  without an eligible victim fails and kills its backend. Both hard limits remain.
- Launch JSON snapshot/revalidation (openclaw#123033, synthetic caller mutation): trust the
  tunnel-owned prepared descriptor; a caller violating ownership can mutate it.
  Negotiated options still use a shallow copy and node input validation remains.
- Worker catalog output copies (openclaw#142095, schema mirrors) and display settings
  clone: trust closed-schema-validated, documented process-stable metadata and
  internally owned settings. A future provider violating that contract can mutate
  cosmetic metadata or miss notifications until a later row/config refresh or
  restart; live allocation validation remains.
- Artifact descriptor freezing/refreezing (openclaw#163446, immutable-result assertion):
  readonly types govern internal consumers; an internal type-contract violation
  can mutate shared metadata. Archive verification and worker-close ordering stay.
- Post-fetch CI summary reread (openclaw#160108, synthetic identity review): exact selected
  head diagnostics may finish while the PR summary refreshes; UI selected-head
  matching, upstream identity and live disclosure/credential checks remain.
- Startup-log generation switching (openclaw#141736/openclaw#126627, synthetic supersession behind
  startup admission): a queued boot log may describe boot rather than replacement
  facts. Plugin attachment, trust enforcement and service ownership stay current.
- Hook replay promise/object identity checks (openclaw#139155): private writers cannot
  replace or prune pending/active entries. If a future writer breaks that invariant,
  completion may overwrite it; current idempotency, terminal TTL/LRU and auth stay.
- Boxed-primitive JSON coercion probes (openclaw#158572, synthetic boxed-value cases):
  ordinary tool payloads retain measured early budget rejection. Exotic boxed
  strings may serialize before rejection by the unchanged final exact byte cap;
  native JSON owns their coercion instead of custom per-value probes.

Model detail reads use the exact configured inventory already built in the same
synchronous request frame instead of resolving agent membership a second time
(openclaw#114388/openclaw#159177). Syntax, authentication, read scope and exact membership stay.
GitHub publication keeps its covering finally release instead of releasing twice.
The attempted prepared-workspace cache substitution was dropped: ordinary late
ACK publications can hide live authority while durable staged facts still exist.

Phase E standalone session memory and its tests are untouched.

BELOW-500 lane packet for coordinator bundling; no standalone PR.
Net production LOC: 217 removed (109 added / 326 removed, 20 files).
Net test LOC: 114 removed. Three-day and fourteen-day history inspection plus
largest-first owner sweeps exhausted sound candidates; rejected cuts stay out.

Local proof

- Full core production types and all four Gateway test-type graphs passed.
- Runtime value cycles: 0. Madge cycles: 0; no import edge added afterward.
- Changed-file format, diff checks, targeted production/test lint passed after
  correcting the terminal selector to toSorted. No new suppression.
- Lint-suppressions: 3 tests passed on the settled source.
- Startup post-attach owner: 88 tests passed in the final isolated run.
- Focused runs reported passing terminal lifecycle/eviction/detach, health,
  hook fanout, catalog/launch/validation/bootstrap, PR details, automation/cron,
  chat state, observers, real models HTTP e2e, publication database/provisioning/
  availability and GitHub read/target-discovery cases. The aggregate selections
  were intentionally stopped, so this is not a full-suite pass claim.
- Independent review completed. Two final findings were declined with source
  evidence: the retained unconditional finally releases the sole publication
  acquisition, and closed metadata schemas still reject unknown properties.

Proof gaps

- server.hooks.test.ts / handles auth, wake, and agent flows timed out at
  120000ms during Gateway startup (207133ms reported elapsed). Its requests have
  no idempotency key and bypass the removed replay checks, but no conclusive
  head-vs-main attribution was established. Later successful Gateway startups
  are not a claimed repair. No retry, timeout increase, skip, or weaker assertion.
- Expanded local selections were stopped rather than running more unchanged
  guest/integration variants on the loaded host. Bundle CI remains broad proof.
- Full check-changed was stopped during the broad SQLite inventory. Preceding
  conflict/line/assertion ratchets passed; env-var budget 455 vs 454 failed and
  reproduced on the untouched base index. No budget was changed. This is base
  evidence, not current-main CI attribution.
- No qualified before/after timing comparison or performance claim. No hosted
  PR CI exists for this branch-only lane packet.

* refactor(gateway): consolidate MCP schemas and Talk target ownership

Use Node's maintained deep comparator for MCP JSON schemas and remove defensive
throwing-getter readers plus their synthetic-only fixture. Keep schema input
validation, advertised-schema invocation membership, normalization, top-level
copies and the equal-schema warning/deduplication behavior from human issue openclaw#98437.

Inline Talk's sole-caller storage resolver and forwarding assertion adapter.
All four callers still assert the exact prepared target at the original effect.
Trust Rastermill's dimension fitting instead of rechecking encoder output; retain
input limits and the byte-limit check/error. Drop the optional initial metadata
catch-up event version fence; retain actual model readiness and runtime authority.

Best-effort tradeoffs accepted

- Throwing in-process tool metadata getters/spread (openclaw#88410, ad9acf4): the
  introducing PR explicitly used synthetic fuzzplugin/mockplugin fixtures, not
  a live client report. A broken plugin getter now fails the request clearly
  rather than silently omitting that tool. Security and schema shape checks stay.
- Exotic non-JSON schema objects: the custom comparator from openclaw#103171 now uses
  isDeepStrictEqual with skipPrototype. Valid JSON schema equivalence, including
  insertion order, stays; symbol-bearing or exotic JS objects may warn differently.
  Preserve the real issue openclaw#98437 warning reduction and process-lifetime dedupe.
- Encoder output dimension recheck (openclaw#169449, ce6a64f): the introducing cutover
  explicitly made Rastermill own fitting, confirmed in its implementation. A
  future encoder contract bug can produce an oversized-dimension image; repair
  that owner rather than validate its output again in Gateway. Input/byte bounds stay.
- Initial chat metadata catch-up versions (openclaw#123433, 1ae5f94): synthetic
  restart/Testbox provenance without a linked human incident. Overlapping initial
  catch-up and model invalidation can briefly mark display availability and cause
  an optional refresh warning; the next publication converges. Current model
  readiness, runtime authority/failure handling and write settlement stay.

Second-pass production reduction: 127 LOC; cumulative lane reduction: 344 LOC.
Phase E standalone memory backend, machinery and tests are untouched.
Same branch, no conflict/rebase, no PR at the below-500 ending threshold.

Provenance

openclaw#88410
openclaw#103171
openclaw#98437
openclaw#169449
openclaw#123433
openclaw#169622

Proof

- Fresh full core production types, targeted core type-aware lint, formatter and
  diff checks passed. Changed-check classification completed.
- Fresh runtime cycles: 0; Madge cycles: 0; no new component.
- Fresh four-file selection passed 70 tests across lint-suppressions (3), Talk
  voice (20), chat metadata (20) and Talk target (27); all kept tests unchanged.
  Loaded-host wall time: 1711.09s including cold preparation; no before/after
  performance claim.
- Independent review completed scoped-clean P0-P2; no actionable findings.
- Final MCP schema/image selection passed all 5 chosen cases in 269.92s wall:
  union/prototype properties, malformed/boolean variants, literal constraints,
  real HTTP equal-schema warning dedupe, and orientation-aware resized delivery.
  The name filter left 96 unrelated cases unrun; no test skips were added.
- Initial root-config lint failed before linting while unrelated plugin SDK
  declarations timed out at 300000ms. Correct source-backed core-config routing
  passed without skipping preparation or increasing any timeout.

Earlier packet gaps remain: server.hooks.test.ts timed out during Gateway startup
without conclusive head-vs-main attribution; a later successful startup is not a
claimed repair. Earlier expanded local selections and full check-changed were
stopped under load. The earlier env-var budget failure reproduced on its untouched
base, not current-main CI. No timeout increase, retry, skip, assertion weakening,
or baseline change was used. Full Gateway/integration proof belongs to bundle CI.

No standalone PR or hosted CI for this below-500 lane packet. Detailed coverage,
provenance, rejected candidates and proof are retained in .local/y06-ledger.md.

* refactor(codex): simplify transport and catalog bookkeeping

Remove malformed JSON reconstruction and its continuation-only bookkeeping,
redundant config copies, post-write rereads and duplicate internal checks.
Reuse the existing final-config hook builder. Preserve valid JSON framing,
external input validation, redaction, live effect authority, resource bounds,
normal concurrent sessions, persisted shapes and write settlement.

Best-effort tradeoffs accepted

- Raw LF inside JSON strings is no longer reconstructed. Direct commit
  67de049 and follow-ups openclaw#101221,
  openclaw#151399 and openclaw#162559 use synthetic malformed frames, not a cited human
  incident. Such frames warn/drop; later valid frames continue. A missing
  RPC reply can reach the existing request timeout. This also removes the
  recovery-only pending-route and per-request row-budget snapshots.
- Unsupported in-place mutation of published config/start objects may become
  visible to a request. Ordinary reload replaces the config object. openclaw#162912
  fixed human heap-OOM openclaw#162802 by sharing clones; removing copying preserves
  that allocation protection without another snapshot cache.
- A node finalization commit followed by a rejected promise now surfaces the
  error. openclaw#106927's lost-receipt path was synthetic, with no cited human
  incident. The durable binding stays installed; next Continue retries the
  same deterministic session. Same-session/home/harness write checks stay.
- Invalid numeric waiter facts from a trusted internal producer are no longer
  discarded by redundant diagnostics validation. openclaw#149616 supplied synthetic
  correlation proof, not a human incident. Egress string allowlists and all
  resource bounds remain; catalog results are unaffected.
- An unsupported offline writer changing a row immediately after successful
  CAS/ownership recording is no longer caught by another reread. openclaw#168479,
  openclaw#166575 and openclaw#170511 supplied synthetic migration machinery, not a cited
  competing-writer human report. CAS conflicts, initial/post-register checks,
  leases and retained-sidecar recovery stay. Next migration reconciles it.
- An impossible-on-wire cyclic/BigInt tool value now throws rather than
  silently omitting output. openclaw#70966/openclaw#107680 cite no human serialization
  incident; protocol payloads are JSON values and local records use those
  values/primitives. Network validation remains at the transport boundary.
- Already-validated binding hashes are not parsed again after normalization
  (openclaw#164197/ffd07590546). Initial persisted-input validation and the human
  fingerprint-overflow fix openclaw#104503 remain intact.
- The bootstrap decision no longer accepts a duplicate projection input
  (21b8ae5): its only production caller already puts the same projection
  into expectedBinding, whose canonical comparator checks it. No separate
  recoverable scenario or public reason contract is lost.

Sibling Codex source contract inspected:
codex-rs/app-server-transport/src/transport/mod.rs:272-284 uses
serde_json::to_string; transport/stdio.rs:82-96 writes those serialized bytes.
codex-rs/app-server-protocol/src/protocol/v2/item.rs:333-352 and
v2/mcp.rs:208-224 define JSON MCP results and string errors.

Net production reduction: 249 lines (+97/-346), excluding tests, fixtures,
test support, generated files and declarations. Phase E memory is untouched.
Detailed scope/provenance coverage remains in the requested .local/y12 ledgers.

Proof so far: independent P0-P2 review scoped-clean, targeted source-graph
typecheck exit 0, runtime value cycles 0, lint-suppressions 3/3, oxfmt and
git diff --check pass. Post-review edits only remove an unused test import
and mechanically migrate one remaining decoder spy without weakening its
assertion. Focused tests, canonical typed lint and static cycles remain
pending; this is not an all-green or merged claim. Package SDK declaration
preparation timed out under load and the selector dry-run exited SIGILL.

Out-of-lane coordinator follow-up: docs/plugins/codex-harness.md:67-69 still
describes incomplete-frame recovery. Replace that description with malformed
frames producing a redacted diagnostic and being dropped while subsequent
valid frames continue normally.

* refactor(codex): remove duplicate approval and projection machinery

Use the standard deep comparator at the existing approval rewrite-denial
boundary, trust the typed host approval result, reuse collected assistant
fallbacks and prepared catalog connection options, remove redundant internal
metadata copies and normalized agent-directory fallback, and inline the sole
account-usage registrar while retaining lazy loading and administrator scope.
Forward optional release arguments once without changing ownership/settlement.

The first focused run exposed cursor retargeting after cache removal. Retain
the existing regression test and carry the resident's captured requestOptions
to every hydration page. Published config can be edited in place; the original
commit's blanket immutable-config description was too strong. No cloning or
global snapshot cache is restored.

Best-effort tradeoffs accepted

- A typed host approval result with a getter/proxy decision can now throw or
  be read normally, rather than receive descriptor inspection. openclaw#70751 added
  synthetic defenses, not a cited human incident. The production host returns
  authenticated Gateway JSON. Null-unavailable, cancellation and two-phase
  decision settlement remain unchanged.
- Non-JSON hook replacements may be conservatively denied by deep comparison
  rather than canonical JSON text. openclaw#82496 protects a real rewrite-denial
  boundary, which remains; the private recursive serializer is not a contract.
- Internal cached session metadata is returned without defensive cloning.
  openclaw#134660 introduced the copies without a metadata-mutation human incident;
  openclaw#164197 moved them unchanged. The sole parser only reads metadata and still
  clones exposed tool input schemas. A future mutating internal consumer must
  own its copy instead of requiring every read to clone the full object.
- The agent directory no longer has a second fallback after connection setup
  already resolved it (openclaw#120366, owner split openclaw#151753). Invalid hand-constructed
  internal runtime objects are unsupported; production always supplies it.

Catalog hydration retains source.assertCurrent before using captured connection
options: WebSocket start options may contain credentials. Source authority is
not an accepted best-effort tradeoff. Opaque cursors still stay with their
selected home's prepared connection options.

Exact sibling Codex contract personally inspected at
8f38d5a877da8c5c2c0b5158e72bb5f2290a3157:
codex-rs/app-server-transport/src/transport/mod.rs:272-282 serializes every
outgoing message with serde_json::to_string. transport/stdio.rs:136-143 only
adds the LF delimiter, and :87-93 writes those serialized bytes directly.
transport/websocket.rs:313-320 sends the same serializer result unchanged.
This confirms the earlier malformed raw-LF reconstruction removal; external
JSON parsing, warn/drop diagnostics and subsequent valid frames remain.

Branch total: 330 net production LOC removed (+125/-455), excluding tests,
fixtures, test support, generated files and declarations. Phase E memory,
inactive foundations, public contracts, live authority, resource limits and
write settlement remain untouched. Detailed requested coverage/provenance is
in the task-local y12 ledgers.

Proof: the 30-suite focused run passed 533 cases and failed one unchanged
native-hook fallback case at its existing five-second execution budget. A
failed-case-only replay hit the same deadline (95s case wall time under load).
No main-side test replay establishes attribution; do not call it main-red or
claim fully green focused proof. Retained cursor regression passed 9/9;
lint-suppressions passed 3/3. Expanded lint's 20 SDK-resolution diagnostics
all reproduce on independently installed pinned main 377d73b with matching
unprepared SDK artifacts (0 introduced, 0 unknown); this is not main CI proof.

Independent final-input review's only finding incorrectly requires a boolean
third deep-comparison argument. Pinned @types/node 26.6.4 explicitly declares
the options object, and isolated Node 26.5 confirms skipPrototype:true behavior.
Reject that finding on source/runtime evidence, not with a cast or suppression.
Earlier full-candidate review's sole index-only cursor finding was resolved by
staging the repair. No remaining accepted actionable finding.

Canonical Madge and SDK-artifact lint preparation remain unproven after prior
load-limited attempts; changed-selector preparation failed with native SIGILL.
Runtime value cycles are zero. The only new import edge is a Node builtin;
account registration contracts index-to-registrar-to-runtime to index-to-runtime.

Final-source catalog proof: 25/25 pass, including obsolete-source list/pin
rejection and cursor affinity. Final targeted source-backed typecheck exits0,
including the exact comparison call questioned by review. Format and diff
checks pass. No public SDK export, schema, protocol, dependency, permission,
durability or retention change. Below500 branch-only handoff; no PR or merge.

* docs: align Codex framing and worktree cache behavior

* fix: preserve MCP schema filtering and release assertions

Retain filtering of unreadable parameter schemas before MCP automation authority capture. Align three Codex sibling assertions with forwarded optional release arguments while preserving their target, count, and lifecycle contracts.

* fix: remote model catalogs stop refreshing on newer modalities (openclaw#173038)

* fix: keep remote model catalogs refreshing across releases

Project both hosted formats to released input modalities and isolate malformed remote model rows. Preserve strict generator validation and transport sanitization. Fixes openclaw#173027.

* test: cover catalog row isolation through refresh and publication

Narrow dynamically loaded parser functions for script typechecking. Update integration expectations to preserve valid rows instead of rejecting entire downloads, as required by openclaw#173027.

* fix: retain the last catalog when no valid model rows survive

* fix: preserve standalone pricing-only v1 catalogs

* fix: omit catalog models with no supported input modalities

* fix: preserve catalog publication gates after modality filtering

* fix: omit empty inputs produced by catalog hydration

* perf(models): preserve catalog sanitizer entry compaction

* test(gateway,media,secrets,browser,agents,otel): remove low-value tests (batch d123) (openclaw#173141)

* test(gateway): deslop x4070 tests

* test(media-understanding): deslop x4071 tests

* test(secrets): deslop x4072 tests

* test(browser): deslop x4074 tests

* test(agents): deslop x4073 tests

* test(diagnostics-otel): deslop x4077 tests

* test: retain distinct session and credential rollback coverage
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 20, 2026
First-parent upstream 84a834e..2b9aa2e (112 commits, including
openclaw#169327 actor memory storage for incognito consumers, openclaw#169458 session
bookkeeping/transcript workers, openclaw#169449 gateway read paths, openclaw#169364 cron
worker queue, openclaw#168401 remote compaction V2, openclaw#169467 transcript backlog).

Conflicts:
- session-reset-service.ts: upstream moved ensureSessionRuntimeCleanup into
  session-reset-runtime-cleanup.ts. Took upstream's form and ported our
  delta into the new module: the `reason` parameter and the awaited
  clearSessionScopeRuntimeState (continuation cancellation that cannot
  persist returns UNAVAILABLE). Callers keep passing `reason`.
- attempt-execution.ts: upstream made the Claude CLI fallback prelude async;
  ported the await into our extracted resolveClaudeCliFallbackPrelude.
- session-accessor.sqlite-lifecycle.ts: upstream's two actor-storage
  imports; the eviction kick import stays where the fork moved its caller.
- status-message.ts: upstream threads preparedTtsPreferences into the voice
  line; ported into our status-session-lines.ts helper.
- plugin-sdk-surface-report.mts budgets; worker inventory regenerated.

Also: session-actor-memory-collaboration-contract.ts (new upstream file)
excludes the fork's sharing `authority.capture` op from actor memory
commands (it runs only on the sharing writer's owner), as at step 26.

Refs #1475

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: XL 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