Skip to content

refactor(packages): consolidate protocol and stream ownership - #172991

Merged
steipete merged 2 commits into
mainfrom
deslop/y17-packages-20261015
Oct 15, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/y17-packages-20261015

Conversation

@steipete

@steipete steipete commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Related: #114386, #139935, #162491, #168834

What Problem This Solves

Maintainer-requested packages cleanup removes duplicated construction and stream bookkeeping; it also fixes Completions' stale Unicode input-budget estimator.

User Impact

Halfwidth, rare-BMP, and supplementary Unicode prompts receive more conservative automatic output caps on compatible Completions endpoints. Other changes are internal simplifications. Gateway schema JSON, static types, SDK/config surfaces, security checks, and transcript durability are preserved. No migration or operator action is required. The standalone Phase E session-memory backend and its tests are untouched.

Why This Change Was Made

One private tuple-preserving helper replaces 285 ordered literal-union constructors. Anthropic's SDK/fetch adapters share lifecycle ownership while keeping their existing profiles. Stream reducers retain authoritative cleanup; duplicate outer cleanup and write-only scratch indices are removed. Compaction, Markdown annotation, table rendering, and Agent snapshots reuse prepared facts instead of repeating work.

Completions retained a CJK estimator extracted before #114386 established the calibrated shared owner. It now consumes that owner rather than maintaining an older, underweighted copy. For a 10,000-token context with 1,000 repeated characters, the real request builder's output caps change from 9,686 to 7,499 for halfwidth text, and from 8,749 to 6,249 / 4,999 for rare BMP / supplementary ideographs. ASCII/common-Han behavior remains unchanged. These are budgeting estimates, not new live-provider or tokenizer measurements.

Net production reduction: 503 lines (981 additions, 1,484 deletions), excluding tests, fixtures, test support, generated files, declarations, and shrink-only assertion-baseline edits.

Best-effort tradeoffs accepted

  • Compaction no longer checks that a typed assistant's content is an array: malformed internal AgentMessage values may throw instead of being ignored. The guard came from extraction work refactor: internalize OpenClaw agent runtime #85341/fix: retain file changes across conversation compaction #123467, with no cited human actual-use malformed-message incident; external arguments and patch-result details remain validated.
  • Compaction no longer coerces each already-typed content block through a record guard: a null/malformed internal block may throw instead of being skipped. Same extraction provenance, with no cited human incident; external trust boundaries are unchanged.
  • File-operation extraction trusts typed tool names: a non-string internal name may throw instead of silently producing no metadata. Same extraction provenance, with no cited human incident; the type and all normal callers provide strings.
  • Table rendering no longer throws a custom error for a missing parallel width entry: the columns and widths come from the same ordered allocation, so the mismatch requires corrupted internal state. feat(tooling): adopt noUncheckedIndexedAccess via a strict-ratchet lane (phase 1) #104577 introduced the guard for a strict-index ratchet, not an actual-use report. Normal rendering is unchanged; there is no separate recovery path for such corruption.

Evidence

  • Final full core typecheck, production typed lint, line-cap ratchet, assertion-safety ratchet, lint-suppression tests, and runtime cycle gate passed. Zero runtime value cycles; 6,293 grandfathered assertions, with shrink-only allowances.
  • Direct before/after request-builder proof covers all three corrected Unicode caps plus unchanged ASCII/common-Han controls. The existing output-budget suite gains three independent numeric regression cases.
  • Protocol scope: 90 files / 628 tests passed. Exact serialization/export parity covered 2,248 values across 58 modules, including ProtocolSchemas; emitted consumer checks preserve exact literal unions and registry mutability. Later helper corrections were type-only and separately checked.
  • Earlier focused owner/sibling proof: 22 files / 310 tests passed; final compaction replay passed 30 tests. Agent lifecycle/steering/continuation reported 53 passing cases.
  • Final focused batch so far: Markdown 4 files / 87 tests and provider/transport 13 files / 368 tests passed, including all three Unicode regressions. Fresh independent Codex review is scoped-clean through P2. Madge reports zero cycles; the new budget test's typed lint passed.
  • AI package declaration/bundle build passed. The final literal-union helper suite passed all 3 tests, closing the earlier killed-shard coverage gap. Final batch so far: 18 files / 458 tests passing.
  • Memory session-files infra shard passed all 14 tests. Final focused batch completed successfully: 19 files / 472 tests across four Vitest shards (1,477.02s wrapper time on the loaded host).
  • First-head CI run 38713648791 completed with every selected job passing except UI E2E 3/4, Node compact-large 9, and the aggregate gate. The UI label mismatch is identical on scheduled main run 38713991924, head db0369215d8b35e17c72cebffcb59306899d3dbb, job 116352521404 (UI 8/9): expected #103469, received openclaw/openclaw#103469 at the unchanged E2E line 167.
  • CI exposed a timing-dependent Anthropic cancellation fixture: fetch could error its wrapped stream before the custom cancellation callback accepted any work, while the test required that callback to start. Its second pull now waits on the existing cleanup gate, deterministically exercising parser-origin cancellation and drainage from fix: retain Anthropic requests through cancellation cleanup #143377. All ownership, drainage, lifetime, and reuse assertions remain unchanged; no production change, timeout, retry, or skip is involved. The full owner file passed all 25 tests under CI's Node 24.19.0: 727.96s Vitest (82% transform), 835.83s wrapper on the loaded host. This existing integration file proves actual plugin/runtime ownership across HTTP, cancellation, and resource disposal; mocks of the ownership decisions would not establish that contract. Fresh independent delta review is scoped-clean through P2; typed lint, formatting, and mandatory suppressions (3 tests) passed again.
  • Corrective-head CI run 38717584131, exact head 7de4cdc590e939acf2945d1aac6e3f2f3f69591b, completed. Every selected Node shard, types/lint, budgets, build, protocol, security and other selected job passed except the two nonaggregate jobs below. CI was not rerun, and the failed aggregate gate is not claimed green.
Failed job Attribution and evidence
UI E2E 3/4, 116364651770 Inherited: unchanged E2E line 167 expects #103469, while rendering now returns openclaw/openclaw#103469. Identical failure on main run 38713991924, head db0369215d8b35e17c72cebffcb59306899d3dbb, job 116352521404; unrelated #172836 updated rendering but missed this E2E expectation. No UI edits.
Extension package boundary, first-attempt job 116364652101 Diagnosed infra, authorized rerun PASSED: full SDK declaration emission initially hit its existing 300,000ms limit without a compiler diagnostic. The coordinator-directed cold declaration comparison below shows no material type/inference growth. The one authorized rerun, job 116387294571 in attempt 2 on the unchanged exact head, passed at 11:09:29 UTC. No source fix or green-chasing push. Main's WhatsApp TS4058 is a different signature and is not used as matching inherited proof for the timeout.
Aggregate openclaw/ci-gate, 116370925616 Consequence of the two jobs above. No independent product finding.

An earlier isolated full-SDK preparation replay also hit the unchanged 300,000ms limit on the heavily loaded local host (Node 26.5.0, not CI's Node 24/Linux). It emitted no source diagnostic. That wall-time replay alone was inconclusive and is not the basis of attribution.

SDK compiler-work diagnosis

At the coordinator's direction, the same pinned native TypeScript 7.1.0-dev.20260928.1 compiler behind plugin-sdk boundary dts ran full cold declaration builds with --extendedDiagnostics, first at head 7de4cdc590e939acf2945d1aac6e3f2f3f69591b, then at merge-base 9e3e16c224697b9a5cb24e7ede12ac4992a97a87. Both passed. Same full project, declaration-only single-threaded emit, frozen dependencies and compiler options; incremental reuse disabled on both. Both commands use isolated HOME/OpenClaw/XDG state. Manifest, lockfile and project configs are identical. Baseline membership was checked; its three shared session-url-contract source files are byte-identical, and no changed lane source is shared.

Metric Merge-base Head Head/base
Types 2,542,748 2,544,448 1.000669 (+0.0669%)
Instantiations 10,180,649 10,185,887 1.000515 (+0.0515%)
Symbols 6,769,460 6,788,850 1.002864 (+0.2864%)
Check time 251.749s 220.020s 0.873966

Both programs contain 16,506 files. Types/Instantiations are comparable, far below the coordinator's material-growth threshold. Check time remains load-sensitive. Under the explicit ruling, the timeout is diagnosed infra and one SDK-job rerun was authorized. No timeout, retry, skip, dependency, baseline or compiler setting was changed. The first protected API request was definitively rejected by GitHub's REST quota before starting a rerun; the run remained on attempt 1. After the reported reset, quota/head/attempt were revalidated and GitHub accepted the single SDK-job rerun: run 38717584131, attempt 2, unchanged exact head 7de4cdc590e939acf2945d1aac6e3f2f3f69591b. That SDK job 116387294571 passed at 11:09:29 UTC. No second rerun will be requested.

Known local gaps remain visible: the broader changed checker was stopped in its expensive SQLite inventory, so its umbrella result is not green. Its environment-name budget failure reproduces on the clean base (455 versus 454); this patch adds no environment names. A mixed focused run's gateway-client shard was killed with SIGKILL before assertions, leaving its later memory shard unrun. The unchanged timed Agent retention test hit its deadline; the direct retention entry point completed with no retained histories, but the timed harness route is not claimed green. No timeout, retry, skip, suppression, assertion, or retained-behavior baseline was weakened. Hosted CI on the exact pushed head is the broad gate.

Lane coverage ledger

The pass covered three-day additions, fourteen-day additions, then eligible packages largest-file-first. The complete PR-tool import closure was excluded. A whole-function clone scan and further prepared-fact/dead-cleanup passes found the following coherent cuts and retained boundaries.

Cluster Provenance and decision
gateway-protocol/src/schema/string-literal-union.ts:1 and 57 schema modules Consolidate ordered literal construction; retain exact JSON, literal order, metadata, and tuple/static types. Prior helper precedent #164286/#106441. Derive placement states from the canonical tuple rather than a mirrored vocabulary.
ai/src/providers/anthropic.ts:102, ai/src/transports/anthropic-stream-lifecycle.ts:1 Consolidate request/refusal/reducer/terminal ownership; keep SDK/fetch framing, callbacks, errors, compaction, auth/header policy, and profile differences. #111669/#162491/#167750/#167917/#168164. Reuse the existing abort-race helper without removing cancellation.
ai/src/transports/anthropic-stream-reducer.ts:50 Remove write/delete-only block indices; retain the existing routing map and every incoming index/argument/terminal validation. #139935 already contained both representations.
Completions / Responses outer scratch cleanup Remove cleanup after the owner already filtered calls or unconditionally cleaned the buffer. No remaining producer writes the obsolete index fields. #162491/#168834; owning reducer cleanup and validation remain.
ai/src/transports/openai-completions-params.ts:1 Retire stale extracted Unicode estimator; use the calibrated normalization owner established by #114386. This is a budget correctness fix, not parity-only cleanup.
agent-core/src/harness/compaction/compaction.ts, utils.ts Reuse parsed prior-summary details; trust typed internal content/tool names. Keep external argument/result metadata validation. #85341/#123467.
agent-core/src/agent.ts:555 Remove a duplicate history snapshot and one-use wrapper; runAgentLoop synchronously owns the copy before any event/await. Keep public state and tools copies.
markdown-core/src/assistant-transcript.ts:202 Prepare ordered nullable token projections once and reuse them. Preserve raw-code exclusions, role/link/image offsets, and both real installers' behavior. #99404/#161002.
memory-host-sdk/src/host/session-files.ts Shallow-copy primitive-only options instead of structured cloning; callback separated, authority checks retained. No standalone backend changes.
terminal-core/src/table.ts:517 Carry allocated content widths through wrapping and padding; remove impossible custom index error. #104577.
Tool repair / Markdown parsing and rendering KEEP bounded streaming/terminal, protected Markdown, coordinate, whitespace, and incremental-performance contracts. #169161/#169172/#172440/#168366/#168383/#167958/#154875.
Client / SDK reconnect and subscriptions KEEP ordinary concurrent-viewer ownership, approval delivery, reconnect/replay currentness, suffix baselines, and bounded resources. Prior simplifications #170800/#169375/#166333/#164707/#159933.
Tool-schema normalization / node manifests KEEP input isolation and external validation: installed TypeBox Convert mutates inputs; accepted manifests must not share caller-owned mutable declarations.
Provider compatibility and continuation KEEP auth/live-authority boundaries, real parallel tool identity, cache/resource bounds, current proxy behavior, and recent feature foundations. No removal based merely on dormancy or synthetic “unreachable” tests.
Nullable schema helper / generic parser merges Reject: nullable helper adds net code; scanners, chunkers, and style/annotation mergers preserve different public semantics.
Phase E standalone session-memory backend KEEP, including factory, registry, expiry/federation machinery and tests.

Use one tuple-preserving ordered literal-union constructor without changing
Gateway protocol JSON, exported shapes, or static inference. Share Anthropic
request, refusal, reducer, compaction and terminal ownership while preserving
the SDK/fetch adapters and their error profiles. Reuse the existing abort race.

Reuse prepared compaction details and table widths, trust typed internal file
metadata inputs, and leave the Agent loop as the sole message-snapshot owner.
Replace the primitive-only session-options deep clone with a shallow copy.
Remove write-only transport scratch indices and duplicate outer cleanup; reuse
prepared Markdown token projections. Route Completions context budgeting through
the shared calibrated CJK estimator, correcting underestimated rare/halfwidth
and supplementary input. Add request-budget regression cases.

Best-effort tradeoffs accepted:
- Malformed internal assistant/tool-name values violating AgentMessage can
  throw instead of being silently omitted. The guards came from extractions
  #85341/#123467, with no cited human malformed-message incident. External
  tool arguments and patch-result metadata remain validated.
- An impossible table column/width mismatch no longer gets a custom error.
  The removed throw came from strict-index ratchet #104577, not an actual-use
  report; columns and widths still come from the same ordered allocation.

No Phase E standalone session-memory backend, security authority, public
protocol/config/SDK contract, schema, dependency or durability change.
@clawsweeper

clawsweeper Bot commented Oct 15, 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 size: XL labels Oct 15, 2026
@steipete
steipete marked this pull request as ready for review October 15, 2026 09:32
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T09:35:46.815875Z 049e7b4 Draft marked ready
ℹ️ About Codex in GitHub

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

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

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

@github-actions

github-actions Bot commented Oct 15, 2026 •

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: 7de4cdc590e939acf2945d1aac6e3f2f3f69591b
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • packages/gateway-protocol/src/schema/exec-approvals.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • packages/gateway-protocol/src/schema/plugin-credentials.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates protocol construction and stream bookkeeping while correcting Unicode input estimates for compatible Completions endpoints.

Example: A compatible Completions endpoint has a 10,000-token context and receives a system prompt containing 1,000 halfwidth コ characters.

  • Before: The request builder permits 9,686 output tokens.
  • After: The shared Unicode estimator reduces the output cap to 7,499 tokens.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Source supports a useful, coherent consolidation with independent regression cases; supplied behavior evidence remains at the in-process boundary.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its supplied evidence covers request-budget cases, protocol parity, and focused package tests, with no material authority change requiring additional final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Unicode-heavy prompts can reserve too little input space on compatible Completions servers, while duplicated internal policy increases maintenance cost.
Reason: The maintainer-authored direction is established, and the change removes duplicate ownership while repairing a concrete budgeting discrepancy.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-directed consolidation has concrete value, including corrected Unicode budgeting, and no definite introduced defect was established; the failing Anthropic cancellation check still needs attribution.

Priority: P2
Reviewed head: 049e7b4d966626e0917dc4a1445b91d20b781b47

Before merge

  • Complete next step - Compare the failing anthropic-read-cancel case on the pinned head and base, diagnose any introduced cancellation or drainage defect, and classify the separate UI label failure without weakening either assertion.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied current-PR evidence exercises request builders and package contracts, rather than a shipped CLI or Gateway flow.
Agent review details

How this fits together

Gateway schemas validate client payloads, while AI provider adapters turn conversation context into requests and reduce provider events into assistant messages.

flowchart LR
  Clients --> ProtocolSchemas
  LiteralUnionHelper --> ProtocolSchemas
  ConversationContext --> ProviderAdapters
  UnicodeEstimator --> ProviderAdapters
  ProviderAdapters --> StreamLifecycle
  StreamLifecycle --> AssistantMessages
Loading

Technical review

Best possible solution:

Retain the consolidation and shared Unicode estimator while resolving the cancellation check's attribution through the existing stream owner.

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

Source establishes the stale estimator path and the three independent request-budget cases; no target code was executed during this read-only review.

Is this the best way to solve the issue?

Reusing the calibrated estimator and retaining distinct transport adapters is a sound ownership consolidation; source inspection found no definite regression.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Gateway literal-union construction keeps the original intent (76796d7: Earlier schema consolidation explicitly preserved wire JSON and static inference; the tuple-preserving helper retains ordered literals and schema metadata.)
  • Anthropic request and stream lifecycle keeps the original intent (87370ee: Shared orchestration retained SDK injection, fetch framing, callbacks, refusal buffering, cancellation, and provider-specific profiles; those adapters and profile distinctions remain.)
  • Streaming tool-call scratch cleanup keeps the original intent (0ebcb29: The optional partialJson field represents an in-flight buffer that must disappear from terminal messages; reducer-owned cleanup remains after redundant outer cleanup is removed.)
  • Completions Unicode budgeting changes intended behavior with a stated reason (b4e27f8: Transport extraction carried the earlier estimator; the PR explains and corrects its divergence from subsequent calibrated shared Unicode accounting.)
  • Compaction file-operation extraction changes intended behavior with a stated reason (9122db3: Preserves path aliases, namespaced tools, apply_patch metadata, and accumulated file provenance; removing malformed-internal-value guards is explicitly accepted in the maintainer-authored body.)
  • Agent context snapshot keeps the original intent (bb46b79: Internalization carried context snapshotting; runAgentLoop still copies messages synchronously before its first event or await, making the outer copy redundant.)
  • Assistant transcript projections keeps the original intent (e8ad046: Role annotation preserves visible offsets and excludes protected content; projections are now prepared once without changing those rules.)
  • Session snapshot options keeps the original intent (6881d25: Actor snapshot projection retains current-authority checks and synchronous observers; copied options contain primitives after the callback is separated.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -503, Tests +64, Other -1. Total -440 across 77 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 74 980 1483 -503
Tests 2 64 0 +64
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 5 -1
Total 77 1048 1488 -440

Labels

Label changes:

  • add P2: Corrects underestimated Unicode input budgets on compatible Completions endpoints with a limited provider-path blast radius.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Corrects underestimated Unicode input budgets on compatible Completions endpoints with a limited provider-path blast radius.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

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

Workflow

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

Reviewed October 15, 2026, 5:49 AM ET / 09:49 UTC.

Hold the Anthropic fixture's second pull on its existing cleanup gate so the
custom cancellation work is actually admitted before testing its ownership.
An upstream fetch abort may otherwise error the wrapper before cancel runs,
making the test demand settlement of work that was never accepted.

Keep every origin-context, drainage, lifetime and reuse assertion unchanged.
No production behavior, timeout, retry or skip changes.
@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head landing evidence for the coordinator-authorized inherited-red exception.

Head: 7de4cdc590e939acf2945d1aac6e3f2f3f69591b. Completed CI run 38717584131, attempt 2. The one authorized SDK-job rerun passed: job 116387294571, real emission of 13,081 SDK files, selected consumers and canary passed. No source change, timeout increase, retry/skip addition, or extra push was made.

Remaining failed job Attribution
UI E2E 3/4, 116387296168 Inherited: chat-pull-requests.e2e.test.ts:167, expected #103469, received openclaw/openclaw#103469. Identical on scheduled main job 116352521404, head db0369215d8b35e17c72cebffcb59306899d3dbb. Unrelated #172836 changed rendering and missed this E2E expectation. Coordinator confirms fix69 owns the main red. No UI changes in this PR.
Aggregate gate, 116390589555 Consequential: the log reports only checks-ui-e2e: failure; all other selected groups, including SDK and security-fast, passed.

All exact-head check runs were enumerated. Attempt-1 SDK/gate failures are historical, not hidden or relabeled green. Attempt-2 security-fast 116387296445 passed. No missing/cancelled selected proof is asserted as successful.

The retained tested merge is e3e0727012e277146f1f67ac5da81ea47916bb2c, with ordered parents a46ecb4350fc3230331ec5ac7c1def9ea9ba383a and the exact PR head. The successful SDK log attests this checkout. The failing test and renderer have identical baseline/tested-merge blobs (a604c63cd71163d5fd18b0282fb341d5e2b166f8 and cf6351bc3373d0fde322fdcef83d66f9ae19bbb4). Native admission must independently obtain current run/job/policy/authority facts; job-list API 502 responses are not replaced with fabricated inventory.

Compiler-work diagnosis: both cold full declaration builds passed using the same pinned compiler/options, head then merge-base. Types +0.0669%, Instantiations +0.0515%, Symbols +0.2864%, Check time ratio 0.874x. The PR body contains exact counts and isolated proof details. These comparable counts, followed by the one successful SDK rerun, satisfy the coordinator's infra ruling.

Net production reduction remains 503 LOC. Protocol shapes/types, security/durability contracts, and the entire named Phase E standalone session-memory KEEP surface remain preserved. Failed CI is not claimed green; merge remains pinned to the reviewed head and subject to native live admission.

@steipete

Copy link
Copy Markdown
Contributor Author

Admin merge of exact head 7de4cdc (coordinator, wave-5 deslop).

Failed check Attribution Evidence
checks-ui-e2e (3/4) Inherited Same UI label assertion fails on main; scheduled main CI 38713991924 / 38707273563 are red on UI e2e. Main repair is in progress separately.
openclaw/ci-gate Aggregate Consequence of the row above.

The earlier plugin-sdk boundary dts timeout was diagnosed as infra, not compiler growth: --extendedDiagnostics at merge-base vs head shows Types +0.067%, Instantiations +0.051%, Symbols +0.286%, check time 0.874x. The single authorized rerun of that job passed, including declaration emission and consumer compilation.

The native landing admission could not run because GitHub returned HTTP 502 for the 100-job inventory page; this merge uses the same exact-head SHA guard instead.

@steipete
steipete merged commit c022c08 into main Oct 15, 2026
311 of 318 checks passed
@steipete
steipete deleted the deslop/y17-packages-20261015 branch October 15, 2026 11:22
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…aw#172991)

* refactor(packages): consolidate protocol and stream ownership

Use one tuple-preserving ordered literal-union constructor without changing
Gateway protocol JSON, exported shapes, or static inference. Share Anthropic
request, refusal, reducer, compaction and terminal ownership while preserving
the SDK/fetch adapters and their error profiles. Reuse the existing abort race.

Reuse prepared compaction details and table widths, trust typed internal file
metadata inputs, and leave the Agent loop as the sole message-snapshot owner.
Replace the primitive-only session-options deep clone with a shallow copy.
Remove write-only transport scratch indices and duplicate outer cleanup; reuse
prepared Markdown token projections. Route Completions context budgeting through
the shared calibrated CJK estimator, correcting underestimated rare/halfwidth
and supplementary input. Add request-budget regression cases.

Best-effort tradeoffs accepted:
- Malformed internal assistant/tool-name values violating AgentMessage can
  throw instead of being silently omitted. The guards came from extractions
  openclaw#85341/openclaw#123467, with no cited human malformed-message incident. External
  tool arguments and patch-result metadata remain validated.
- An impossible table column/width mismatch no longer gets a custom error.
  The removed throw came from strict-index ratchet openclaw#104577, not an actual-use
  report; columns and widths still come from the same ordered allocation.

No Phase E standalone session-memory backend, security authority, public
protocol/config/SDK contract, schema, dependency or durability change.

* test(plugins): make cancellation ownership fixture deterministic

Hold the Anthropic fixture's second pull on its existing cleanup gate so the
custom cancellation work is actually admitted before testing its ownership.
An upstream fetch abort may otherwise error the wrapper before cancel runs,
making the test demand settlement of work that was never accepted.

Keep every origin-context, drainage, lifetime and reuse assertion unchanged.
No production behavior, timeout, retry or skip changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant