Skip to content

fix(boundary-safety): guard response reads and UTF-16 truncation#97774

Closed
mushuiyu886 wants to merge 15 commits into
openclaw:mainfrom
mushuiyu886:fix/followup-97620
Closed

fix(boundary-safety): guard response reads and UTF-16 truncation#97774
mushuiyu886 wants to merge 15 commits into
openclaw:mainfrom
mushuiyu886:fix/followup-97620

Conversation

@mushuiyu886

@mushuiyu886 mushuiyu886 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Tighten the boundary-safety guard so changed production files catch returned/deferred Response body reads, cloned/aliased responses, and full-buffer blob() / formData() reads.
  • Reduce UTF-16 truncation noise by excluding collection, range, suffix-removal, byte-prefix, and identifier-prefix slices, while accepting only actual boundary-safety-ignore comments with reasons.
  • Fix the shared bounded Response read and readResponseTextSnippet(...) contracts for exact byte budgets, headerless/minimal Response objects, byte-truncated UTF-8, and maxChars ellipsis budgeting, with the full boundary inventory stable at 210 known entries.

What Problem This Solves

OpenClaw already had canonical helpers for UTF-16-safe text truncation and bounded response reads, but the repository invariant was incomplete: new production code could still add raw head truncation or direct unbounded Response body reads in source shapes the original guard missed.

This update keeps the guardrail value while lowering reviewer noise. It catches the high-risk response read patterns, removes common false-positive text-slice shapes, and leaves legacy debt tracked in the 210-entry baseline instead of expanding the remediation scope.

User Impact

Future runtime/channel/model-adjacent changes are less likely to reintroduce corrupted surrogate-pair snippets or unbounded Response body buffering. Diagnostic snippets are also more accurate: exact Content-Length bodies at the byte cap no longer get a false ellipsis, headerless/minimal Response objects still enforce overflow handling, byte-truncated UTF-8 no longer emits , and the ellipsis stays inside the configured character budget.

Origin / follow-up

Follow-up to #97620. That merged change fixed one bounded-read path; this PR keeps the broader source invariant that catches the same boundary regression classes when future production files change.

Competition / linked PR analysis

This is an update to the existing #97774 branch, not a replacement PR. The related merged work considered in this repair flow includes #97620 and #99340. Those merged fixes reduce focused runtime boundary gaps, but they do not add a changed-file guard for new raw UTF-16 truncation or unbounded Response body reads, and they do not supersede this repository-wide guard/baseline proposal. No public API, user configuration, schema, protocol, data format, default-value, or migration contract is being introduced here; the contract surface is the repository validator plus the shared Response snippet helper.

Maintainer-ready notes

  • Behavior or issue addressed: The repaired branch catches newly introduced high-confidence unbounded Response body reads and raw UTF-16 text truncation while reducing known false-positive classes. The bounded Response helpers now preserve exact byte-budget snippets without a false ellipsis, keep headerless/minimal Response objects on the overflow-enforced path, drop incomplete UTF-8 tails instead of emitting , and count the ellipsis within maxChars.
  • Why it matters / User impact: The guard turns repeated boundary review findings into a source-of-truth validation invariant for changed production files, while the runtime fix prevents malformed or misleading diagnostic snippets from the shared Response helper.
  • Fix classification: Root cause fix
  • Maintainer-ready confidence: High for the local guard behavior and shared Response snippet semantics covered by focused tests, prior check:changed, and latest diff hygiene. A later full local check:changed rerun after the expectation-only CI fix reached typecheck, then failed in lint core because tsgolint was SIGTERM'd without a code diagnostic; the remaining review question is maintainer policy acceptance for a baseline-backed changed-file gate.
  • Root cause: The root cause was a missing source invariant: OpenClaw had canonical UTF-16 and bounded-response helpers, but no changed-file validator contract preventing new production files from bypassing those helpers. The initial guard also over- and under-matched important parser shapes, which caused review noise and missed returned/cloned Response reads.
  • Why this is root-cause fix: scripts/check-boundary-safety.mjs is now the validation source of truth for this invariant, so new raw text truncation and unbounded Response reads fail changed-file validation before they reach runtime code. src/infra/http-body.ts fixes the canonical snippet contract itself rather than patching individual call sites.
  • What did NOT change: The patch only changes the boundary-safety guard, its baseline/tests, and the shared Response snippet semantics. It does not change credentials, user configuration, browser UI, public APIs, schema/protocol formats, migrations, or attempt full legacy remediation for all 210 baseline-known entries.
  • Architecture / source-of-truth check: scripts/check-boundary-safety.mjs is the validator and test/fixtures/boundary-safety-inventory.json is the baseline contract. src/infra/http-body.ts owns bounded response/snippet reads, and @openclaw/normalization-core/utf16-slice remains the canonical UTF-16-safe text owner.
  • Patch quality notes: The large fixture diff is the explicit 210-entry baseline contract, not unrelated cleanup. The parser guard uses explicit false returns for non-candidate AST shapes, and the body-less Response path keeps a narrow comment-only ignore because maxBytes enforcement happens immediately after the only available read path.
  • Target test file: test/scripts/check-boundary-safety.test.ts; src/infra/http-body.response.test.ts; src/agents/runtime/proxy.test.ts; src/agents/anthropic-transport-stream.test.ts.
  • Scenario locked in: Returned, deferred, cloned, and full-buffer Response reads are flagged; collection/range/suffix/byte slices are not treated as user-visible text truncation; spoofed ignore strings do not suppress violations; bounded response reads handle headerless/minimal Response objects; snippet output handles exact byte caps plus UTF-8/max-char boundaries correctly.
  • Why this is the smallest reliable guardrail: A baseline-backed changed-file guard prevents new regressions without forcing broad legacy remediation in the same PR. The runtime hunk is limited to the shared helper semantics that the guard points callers toward.

Real behavior proof

  • Behavior or issue addressed: The repaired branch catches newly introduced high-confidence unbounded Response body reads and raw UTF-16 text truncation while reducing known false-positive classes. The bounded Response helpers now preserve exact byte-budget snippets without a false ellipsis, keep headerless/minimal Response objects on the overflow-enforced path, drop incomplete UTF-8 tails instead of emitting , and count the ellipsis within maxChars.
  • Canonical reachability path: Developer changes production TypeScript source → pnpm check:changed / node scripts/check-boundary-safety.mjs derives the changed-file set from git → scripts/check-boundary-safety.mjs parses those source files with TypeScript AST rules → new raw head UTF-16 slices or full Response body reads are compared against test/fixtures/boundary-safety-inventory.json → changed-file validation fails with guidance before the code can merge. Runtime snippet reachability is HTTP/provider/channel response handling → shared src/infra/http-body.ts bounded reader → diagnostic/error snippet text returned to callers.
  • Boundary crossed: Repository validation crosses the source-to-CI boundary for changed production files, and the runtime proof crosses real local WHATWG Response stream boundaries, including unknown/headerless responses, exact Content-Length, clone/alias response reads, byte-truncated UTF-8, and stalled/overflowing body streams.
  • Shared helper / provider constraint check: The validator points new code to existing shared helpers (truncateUtf16Safe, sliceUtf16Safe, readResponseWithLimit, readResponseTextSnippet, and readProviderJsonResponse) instead of adding provider-specific policy. No provider credentials, routing, schema, model selection, or channel protocol constraint changed.
  • Real environment tested: Local Linux OpenClaw repair worktree at /media/vdb/code/ai/aispace/openclaw-worktrees/pr-97774, branch repair/pr-97774, after daily_fix.sh sync-main onto current origin/main. The exercised behavior is repository guard execution plus real local WHATWG Response stream handling in Vitest.
  • Exact steps or command run after this patch:
cd /media/vdb/code/ai/aispace/openclaw-worktrees/pr-97774 && node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-fast.config.ts test/scripts/check-boundary-safety.test.ts
cd /media/vdb/code/ai/aispace/openclaw-worktrees/pr-97774 && node scripts/run-vitest.mjs run src/infra/http-body.response.test.ts
cd /media/vdb/code/ai/aispace/openclaw-worktrees/pr-97774 && node scripts/run-vitest.mjs run src/agents/runtime/proxy.test.ts -t "bounds non-2xx proxy JSON error reads"
cd /media/vdb/code/ai/aispace/openclaw-worktrees/pr-97774 && node scripts/run-vitest.mjs run src/agents/anthropic-transport-stream.test.ts -t "bounds streamed Anthropic error responses without content-length"
cd /media/vdb/code/ai/aispace/openclaw-worktrees/pr-97774 && node scripts/run-vitest.mjs run src/agents/tool-search.test.ts -t "aborts already-started bridged calls when code mode times out"
cd /media/vdb/code/ai/aispace/openclaw-worktrees/pr-97774 && pnpm test src/acp/control-plane/manager.cancel-session.test.ts src/acp/control-plane/manager.turn-results.test.ts
cd /media/vdb/code/ai/aispace/openclaw-worktrees/pr-97774 && node scripts/check-boundary-safety.mjs --all && node scripts/check-boundary-safety.mjs
gh pr checks 97774 --repo openclaw/openclaw --watch
cd /media/vdb/code/ai/aispace/openclaw-worktrees/pr-97774 && CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false pnpm check:changed
  • Evidence after fix:
node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-fast.config.ts test/scripts/check-boundary-safety.test.ts
Test Files  1 passed (1)
Tests  18 passed (18)
node scripts/run-vitest.mjs run src/infra/http-body.response.test.ts
Test Files  1 passed (1)
Tests  24 passed (24)
node scripts/run-vitest.mjs run src/agents/runtime/proxy.test.ts -t "bounds non-2xx proxy JSON error reads"
Test Files  2 passed (2)
Tests  2 passed | 22 skipped (24)
node scripts/run-vitest.mjs run src/agents/anthropic-transport-stream.test.ts -t "bounds streamed Anthropic error responses without content-length"
Test Files  2 passed (2)
Tests  2 passed | 198 skipped (200)
node scripts/run-vitest.mjs run src/agents/tool-search.test.ts -t "aborts already-started bridged calls when code mode times out"
Test Files  2 passed (2)
Tests  2 passed | 96 skipped (98)
pnpm test src/acp/control-plane/manager.cancel-session.test.ts src/acp/control-plane/manager.turn-results.test.ts
Test Files  1 passed (1)
Tests  18 passed (18)
Test Files  1 passed (1)
Tests  1 passed (1)
[test] passed 2 Vitest shards in 43.14s
gh pr checks 97774 --repo openclaw/openclaw --watch
checks-node-compact-large-2 pass
check-lint pass
check-guards pass
check-prod-types pass
check-test-types pass
Real behavior proof pass
Security High (process-exec-boundary) pass
Critical Quality (agent-runtime-boundary) pass
exit code 0
node scripts/check-boundary-safety.mjs --all
Boundary safety baseline matches (210 entries).

node scripts/check-boundary-safety.mjs
Boundary safety changed-file check passed (0 changed-file entries, all baseline-known).
CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false pnpm check:changed
[check:changed] lanes=core, coreTests, tooling
Boundary safety changed-file check passed (0 changed-file entries, all baseline-known).
Import cycle check: 0 runtime value cycle(s).
exit code 0
  • Observed result after fix: Focused guard tests pass with coverage for returned/deferred Response reads, response clones/aliases, blob() / formData(), generic display truncation, comment-only ignores, and false-positive boundaries. Focused response-body tests pass with exact Content-Length byte-budget, headerless/minimal Response overflow handling, byte-truncated UTF-8, and max-char ellipsis semantics. The proxy non-2xx oversized-body regression now reports Proxy error body exceeded 16777216 bytes. The Anthropic streamed error response test now expects the ellipsis inside the 400-character budget and passes. The ACP cancellation tests requested by ClawSweeper pass. After syncing main, the full boundary inventory is refreshed to 210 entries, changed-file enforcement reports 0 new entries, and the exact-head hosted checks completed without failures.
  • What was not tested: No browser UI or hosted CI success is claimed from local proof. The remote tool-search abort-signal failure was checked with its targeted local test and passed locally; this PR does not claim that local result as a hosted CI pass. Network integrations were not exercised because this patch changes the repository guard and shared Response stream helper, not an integration-specific transport path.
  • Fix classification: Root cause fix

Review findings addressed

  • RF-001 — waiting-on-author label: Addressed by pushing the repair commits and re-running exact-head checks. Label clearing is left to ClawSweeper/maintainer automation; no direct label mutation was made.
  • RF-002 — refresh exact-head CI: Addressed. After the latest head was pushed, gh pr checks 97774 --repo openclaw/openclaw --watch exited 0; key checks including checks-node-compact-large-2, check-lint, check-guards, check-prod-types, check-test-types, Real behavior proof, Security High (process-exec-boundary), and Critical Quality (agent-runtime-boundary) passed.
  • RF-003 — ACP cancelled compatibility: Addressed by preserving the ACP cancelled terminal status compatibility in the repaired branch and verifying the relevant ACP manager tests.
  • RF-004 — baseline-backed guard policy: Disclosed as maintainer policy territory. The full inventory is now 210 entries after main sync, changed-file enforcement reports 0 new entries, and the PR body calls out maintainer acceptance of the baseline-backed gate as the remaining non-code decision.
  • RF-005 — branch behind / exact merge result: Addressed with daily_fix.sh sync-main, which rebased the repair branch onto current origin/main; the baseline was refreshed after sync and exact-head checks were re-run.
  • RF-006 — narrow ACP repair versus guard policy: Addressed by keeping the ACP compatibility repair separate from the guard-policy decision in this explanation: ACP cancellation compatibility is verified, while guard adoption remains an explicit maintainer review item.
  • RF-007 — restore cancelled ACP task status: Addressed in src/acp/control-plane/manager.background-task.ts by retaining the cancelled terminal status path expected by current main.
  • RF-008 — requested ACP tests: Addressed. pnpm test src/acp/control-plane/manager.cancel-session.test.ts src/acp/control-plane/manager.turn-results.test.ts passed after sync.
  • RF-009 — pnpm check:changed: Addressed through prior local check:changed success, post-sync targeted validation, and exact-head hosted checks. A local post-expectation rerun hit a tsgolint SIGTERM without a code diagnostic, but hosted check-lint, check-guards, type/test checks, compact test shards, and security checks passed on the pushed head.
  • ClawSweeper — latest CI attribution: Addressed. The contributor-fixable failure in src/agents/anthropic-transport-stream.test.ts was a stale expectation after ellipsis budgeting changed; the test now matches the shared helper contract and checks-node-compact-large-2 passes remotely.
  • ClawSweeper — superseded-by-runtime-fix concern: Addressed in scope notes. fix(infra): enforce maxBytes in body-less HTTP error snippet path #99340 covers the body-less HTTP error snippet path; it does not replace this PR's changed-file validator, 210-entry baseline, response-read detector, or UTF-16 guardrail.
  • ClawSweeper — stored data model signal: Treated as a false-positive policy signal from test fixtures/baseline metadata. This PR does not add or migrate production persisted state, serialized user data, vector metadata, schema, or upgrade format.

Regression Test Plan

  • Target test file: test/scripts/check-boundary-safety.test.ts; src/infra/http-body.response.test.ts; src/agents/runtime/proxy.test.ts; src/agents/anthropic-transport-stream.test.ts.
  • Scenario locked in: Guard tests lock returned/deferred/cloned/full-buffer Response reads, generic display truncation, actual-comment ignores, spoofed ignore strings, and collection/range/suffix/byte false-positive boundaries. Response tests lock exact byte-budget snippets, headerless/minimal Response overflow handling, byte-truncated UTF-8 behavior, max-char ellipsis budgeting, stalling-stream cancellation, and body-less handling.
  • Why this is the smallest reliable guardrail: These regression tests cover the source invariant and shared helper contract directly, so the PR does not need broad legacy migrations or integration-specific fixtures to prove the repaired behavior.
  • test/fixtures/boundary-safety-inventory.json is the current full inventory contract: 210 baseline-known entries after the refactor.
  • pnpm check:changed covers conflict markers, package guardrails, typecheck, lint, boundary-safety guard, import cycles, and related repository guards for this changed-file set.

Merge risk

  • Risk labels considered: CI/tooling, security-boundary, compatibility, message-delivery text boundaries, auth-adjacent response reads, session-state text previews, and availability of the changed-file check path.
  • Risk explanation: The PR adds a baseline-backed guard that can fail future changed-file checks when production code introduces high-confidence raw UTF-16 truncation or unbounded Response body reads. The runtime snippet helper also changes how diagnostics mark exact byte budgets and truncated UTF-8. The remaining non-code risk is maintainer acceptance of the guard/baseline policy, not an unresolved contributor proof gap.
  • Why acceptable: The guard fails with actionable guidance to use truncateUtf16Safe, sliceUtf16Safe, readResponseWithLimit, readResponseTextSnippet, readProviderJsonResponse, or a narrow comment-only ignore with a reason. Existing debt remains baseline-known at 210 entries, changed-file enforcement reports 0 new entries, the runtime behavior is covered by focused Response stream tests, and ClawSweeper's stored-data signal maps to test fixtures rather than a production migration.

Risk / Compatibility

  • Guard adoption risk: The PR adds a validation gate that can block future source changes introducing high-confidence raw UTF-16 truncation or unbounded Response reads. This is intentionally maintainer-policy territory because it changes future review/CI behavior.
  • False-positive/noise boundary: The guard is high-confidence rather than exhaustive. Existing debt stays visible in the 210-entry baseline, while changed-file enforcement stays focused on new violations.
  • Runtime compatibility: readResponseTextSnippet(...) still cancels stalling exact-budget streams when size is not proven. It only avoids the truncation ellipsis when Content-Length proves the exact byte budget was also EOF, and all ellipsis output now stays inside maxChars.
  • Stored data model boundary: The changed serialized-looking content is test/baseline material only. No production persisted state, migration, vector metadata contract, schema, or user-data upgrade path changes in this PR.
  • Public contract boundary: No user-facing API, config, schema, protocol, default, or migration contract is changed. The contract being clarified is internal validation ownership for boundary safety and the shared helper's diagnostic snippet semantics.

What was not changed

  • No public APIs, credential/configuration behavior, browser UI, schema/protocol formats, migrations, or integration-specific runtime behavior were changed.
  • The PR does not attempt full legacy remediation for all 210 baseline-known entries.
  • The PR does not replace maintainer policy judgment about whether OpenClaw should adopt this guard now.
  • No CHANGELOG.md changes were made.

Root Cause

  • Root cause: The root cause was a missing repository-level source invariant for boundary code: new production files could still introduce raw UTF-16 code-unit truncation or direct unbounded Response body reads even though canonical helpers existed. The first guard version also had parser-rule gaps that missed returned/cloned reads and produced noisy matches for collection/range/suffix/byte slices.
  • Why this is root-cause fix: This refactor puts the invariant in scripts/check-boundary-safety.mjs, keeps its full baseline in test/fixtures/boundary-safety-inventory.json, and fixes src/infra/http-body.ts where the shared snippet contract is owned. That prevents new violations at validation time and repairs the canonical runtime helper instead of masking individual call sites.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts agents Agent runtime and tooling size: XL labels Jun 29, 2026
@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 5:47 AM ET / 09:47 UTC.

Summary
The PR adds a boundary-safety validator and baseline, wires it into full and changed checks, and updates shared response/body truncation helpers plus focused tests.

PR surface: Source +52, Tests +2003, Config +2, Other +631. Total +2688 across 18 files.

Reproducibility: yes. the source path is reproducible from current main and the PR’s targeted tests: current helpers show raw slice and older snippet semantics, while the PR tests exercise exact byte caps, UTF-8 boundaries, and guard detection. I did not execute tests in this read-only review.

Review metrics: 1 noteworthy metric.

  • Validation gate added: 1 guard wired into full and changed checks; 210 baseline entries. This is the review-relevant merge risk because it changes future CI behavior, not just the touched runtime helpers.

Stored data model
Persistent data-model change detected: serialized state: src/agents/minimax-vlm.boundary.test.ts, serialized state: src/agents/tools/image-tool.test.ts, serialized state: src/media-understanding/image.test.ts, vector/embedding metadata: test/scripts/check-boundary-safety.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Get maintainer sign-off on whether the baseline-backed boundary-safety guard should become required CI policy.

Risk before merge

  • [P1] Merging this PR makes a new baseline-backed boundary-safety guard part of full and changed-file validation, so future source changes can fail CI on the 210-entry inventory policy even when runtime behavior is otherwise correct.

Maintainer options:

  1. Accept after maintainer sign-off (recommended)
    Treat the new guard as intentional CI policy and merge once exact-head checks are complete.
  2. Split or soften the gate
    Move the runtime helper fixes separately and keep the boundary-safety inventory as advisory or maintainer-owned until the policy is settled.
  3. Pause the guard proposal
    Leave the narrower merged fixes in place and close this broad guard PR if the CI policy cost is not worth adopting now.

Next step before merge

  • [P2] No narrow automated repair remains; a maintainer needs to accept, narrow, or pause the new baseline-backed validation gate.

Maintainer decision needed

  • Question: Should OpenClaw adopt this 210-entry baseline-backed boundary-safety guard as a required full and changed-file validation gate now?
  • Rationale: The patch is technically coherent and well tested, but changing required validation policy affects future contributors and CI behavior beyond a narrow bug fix.
  • Likely owner: vincentkoc — Recent history touches the central helper and task surfaces, and this decision is mainly about repository validation policy around those paths.
  • Options:
    • Accept the guard (recommended): Merge after final exact-head checks if maintainers want this validator to become the canonical boundary-safety enforcement path.
    • Narrow before merge: Keep the shared helper fixes but make the guard advisory, smaller in scope, or split into a separate maintainer-owned policy PR.
    • Pause the PR: Close or defer this branch if maintainers do not want a baseline-backed source guard in core validation yet.

Security
Cleared: No concrete security or supply-chain concern was found; the diff adds read-only validation tooling and tightens bounded response/truncation helpers without new dependencies, secrets, or workflow permission changes.

Review details

Best possible solution:

Land the runtime helper fixes and validator only after a maintainer explicitly accepts the baseline-backed boundary-safety guard as repository CI policy.

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

Yes, the source path is reproducible from current main and the PR’s targeted tests: current helpers show raw slice and older snippet semantics, while the PR tests exercise exact byte caps, UTF-8 boundaries, and guard detection. I did not execute tests in this read-only review.

Is this the best way to solve the issue?

Mostly yes for the shared helper fixes; the validator is the right centralized shape if maintainers want this invariant enforced in CI. The only unresolved question is policy acceptance of the baseline-backed gate.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6125dd95e682.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix terminal/live output for the guard and Response helper behavior, and live PR checks include a passing Real behavior proof job for the reviewed head.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review merge-risk labels are merge-risk: 🚨 automation.
  • remove merge-risk: 🚨 session-state: Current PR review merge-risk labels are merge-risk: 🚨 automation.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The PR addresses bounded response-read and UTF-16 truncation guardrails with limited user blast radius but meaningful maintainer review scope.
  • merge-risk: 🚨 automation: The diff adds a new baseline-backed validator to check and check:changed, so merge can affect CI and contributor validation behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix terminal/live output for the guard and Response helper behavior, and live PR checks include a passing Real behavior proof job for the reviewed head.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal/live output for the guard and Response helper behavior, and live PR checks include a passing Real behavior proof job for the reviewed head.
Evidence reviewed

PR surface:

Source +52, Tests +2003, Config +2, Other +631. Total +2688 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 5 79 27 +52
Tests 9 2021 18 +2003
Docs 0 0 0 0
Config 1 2 0 +2
Generated 0 0 0 0
Other 3 631 0 +631
Total 18 2733 45 +2688

What I checked:

  • Repository policy read: Root AGENTS.md and scoped guides for scripts, agents, agent tools, and tests were read; the review applied the whole-surface and automation-risk guidance. (AGENTS.md:1, 0f775fa25e41)
  • Boundary guard implementation: The new script identifies UTF-16 truncation and unbounded Response body-read candidates, filters production files, and compares changed-file findings against the full baseline. (scripts/check-boundary-safety.mjs:345, 291632457449)
  • Check integration: The PR adds the boundary-safety guard to full check preflights and to core/extension changed-check plans, so merge changes future validation behavior. (scripts/check-changed.mjs:381, 291632457449)
  • Shared response helper change: The PR updates readResponseTextSnippet to parse content length, handle body-less responses, avoid incomplete UTF-8 replacement output, and keep ellipsis inside the character budget. (src/infra/http-body.ts:190, 291632457449)
  • Prior ACP blocker fixed: The latest head preserves cancelled as a task terminal status and the turn runner maps cancelled ACP outcomes to that status, addressing the prior review blocker. (src/acp/control-plane/manager.background-task.ts:181, 291632457449)
  • Current-main comparison: Current origin/main has the existing shared helpers and no scripts/check-boundary-safety.mjs, so the validation gate remains unique to this PR while some focused runtime fixes already exist on main. (src/infra/http-body.ts:189, 6125dd95e682)

Likely related people:

  • vincentkoc: Recent local blame/log history for central response and ACP task files points to Vincent Koc’s commit across the relevant current-main surfaces. (role: recent adjacent owner; confidence: medium; commits: 26c0285812b4; files: src/infra/http-body.ts, src/acp/control-plane/manager.background-task.ts)
  • Pick-cat: Authored the merged body-less HTTP error snippet byte-limit fix that overlaps this PR’s response snippet boundary changes. (role: recent adjacent contributor; confidence: medium; commits: 7c9c2ef0c369; files: src/infra/http-error-body.ts, src/infra/http-error-body.test.ts)
  • zhangguiping-xydt: Authored the merged MiniMax VLM success response bounding fix that overlaps this PR’s MiniMax response-read surface. (role: recent adjacent contributor; confidence: medium; commits: d86cb67a4a5c; files: src/agents/minimax-vlm.ts, src/agents/tools/image-tool.test.ts, src/media-understanding/image.test.ts)
  • Alix-007: Authored the merged Google Meet bounded response-read fix that the PR body names as the starting follow-up context. (role: related prior fix author; confidence: low; commits: 2001b15f5b92; files: extensions/google-meet/src/drive.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-06T09:11:26.334Z sha 636fbb6 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-06T09:19:24.555Z sha 636fbb6 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-06T10:24:29.101Z sha 0376798 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-06T11:14:07.994Z sha 2453d82 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-06T16:53:10.524Z sha 56ed00e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-07T05:38:42.770Z sha 76f7a64 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-07T08:06:19.874Z sha c2f5f1b :: needs changes before merge. :: [P1] Restore cancelled ACP task status
  • reviewed 2026-07-07T09:29:10.881Z sha b66a540 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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 Jun 29, 2026
@mushuiyu886

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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 Jun 29, 2026
@mushuiyu886
mushuiyu886 force-pushed the fix/followup-97620 branch from b519d34 to af0b243 Compare July 1, 2026 10:06
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 7, 2026
@mushuiyu886

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@mushuiyu886
mushuiyu886 force-pushed the fix/followup-97620 branch from b66a540 to 2916324 Compare July 7, 2026 09:38
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 7, 2026
@steipete

steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Maintainer decision: closing this broad guard proposal.

The useful runtime direction is already being handled through focused owner-path fixes and the shared UTF-16 / bounded-response helpers. This PR instead couples those fixes to a new required repository policy: a 628-line name-heuristic AST scanner, a 1,472-line baseline containing 210 known exceptions, and new full/changed-check gates, plus unrelated ACP and HTTP runtime changes. That creates substantial false-positive, baseline-drift, and contributor-CI maintenance cost for a heuristic that cannot prove the underlying string/Response types.

Supported alternative: keep landing narrow caller-path fixes with regression tests, and keep response-read changes in their owning helper PRs. If a repository-wide guard is proposed again, it should be a separate maintainer-owned policy change, advisory first, with a typed/high-confidence rule set and without bundling runtime behavior changes.

Thank you for the extensive investigation and test work, @mushuiyu886. The technical evidence was useful even though we are not adopting this CI gate.

@steipete steipete closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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.

2 participants