Skip to content

test(anthropic): cover repeated stdin failure notifications - #190335

Merged
vincentkoc merged 3 commits into
mainfrom
fix/anthropic-stdin-cancellation-contract-20261101
Nov 1, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
fix/anthropic-stdin-cancellation-contract-20261101

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The Anthropic diagnostic-drain cancellation test assumes exactly one raw stdin error. A closed write and the native stream's queued error can both notify the managed-stdin adapter. The original assertion fails before cancellation is requested, so it does not establish a cancellation failure.

This blocks the separate packaging work in #190030. The observed failure is CI job 124813866831.

User Impact

No production behavior changes. The tests distinguish repeated raw pipe notifications from the transport's single terminal failure, while retaining cancellation and cleanup checks.

Why This Change Was Made

Both cancellation checkpoints require at least one error and require every observed error to be EPIPE. Diagnostic barriers, exact abort-reason identity, final join, late-send identity and terminal-error singleton assertions remain intact.

A real Writable regression destroys stdin, attempts a late write and awaits native close. It checks the single write callback, both permitted adapter notifications and strict first-error reference identity. Existing EOF and ECANCELED/ERR_STREAM_DESTROYED/EIO cases remain intact. Optional indexing after the count/error assertions satisfies the services test compiler without weakening those checks.

Against frozen baseline 89ed7833, signed candidate b3b64d31 changes two tests and one LF allocation: production 0, tests +33/−2 (net +31), metadata +2/−0. No retry, timeout increase or production event suppression is introduced.

Evidence

  • Exact b3b64d31acc0969f748c4b44bf9d1044a288d047 passed independent source review and one complete structured review: zero findings, all ten preservation/settlement guards passed, all 135 observed owned processes settled.
  • Fresh Linux proof ran both complete changed suites on Node 24.22.1 and pinned Bun 191755ec11: 28 tests passed per runtime, plus two source-derived assertion controls per runtime. Controls show the old exactly-one assertion rejects the repeated-notification trace and the revised predicate rejects empty and wrong-code observations. This is assertion-control proof, not an old-baseline checkout run.
  • The exact previously failing services test typecheck passed, along with targeted formatting, oxlint, line-cap and test-line ratchets. All ten proof phases exited zero with natural process/pipe settlement; tracked source remained unchanged and task scratch was removed. The prior-head TS2532 failure is corrected, not waived.
  • The native command succeeded. Its bounded outer observer retained a cleanup-unconfirmed failure while provider release was pending. A separate read-only exact-resource native status confirmed release and completed cleanup; the original outer failure receipt remains unchanged. No test or allocation was repeated for that reconciliation.
  • Exact-head CI passed, including the previously failing services typecheck. CodeQL, Critical Quality, OpenGrep and Security Review also passed.
  • ClawSweeper reviewed exact b3b64d31: zero findings, no Before merge requests and no remaining rank-up moves. Native correction review and publication validated the same signed head.

Current-head proof, CI/security and review are qualified. Landing remains subject to native final admission; no inherited-CI exception or merge waiver is requested.

@vincentkoc vincentkoc self-assigned this Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR permits repeated raw EPIPE notifications in Anthropic cancellation tests and adds native Writable coverage for their separate delivery paths.

Example: Closed stdin produces two EPIPE notifications during diagnostic drainage.

  • Before: The exactly-one assertion fails before cancellation is requested.
  • After: Both notifications are checked as EPIPE, and cancellation must still preserve the exact abort reason.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported test repair with passing targeted CI and reported dual-runtime validation; evidence remains at the production-path test harness boundary.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only PR changes no shipped behavior; its body reports exact-head Linux Node and pinned-Bun runs through real subprocess and Writable fixtures, supported by passing current-head Node checks.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: A valid repeated-notification trace fails the cancellation test before cancellation is requested, blocking unrelated useful work.
Reason: The maintainer-authored direction matches existing adapter and transport contracts and preserves meaningful cancellation and cleanup coverage.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it corrects a source-supported test assumption without changing production behavior, and no actionable defect was found at the pinned head.

Priority: P2
Reviewed head: b3b64d31acc0969f748c4b44bf9d1044a288d047

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No original-baseline suite run is supplied; the body explicitly distinguishes assertion controls from baseline execution.
Agent review details

How this fits together

The managed stdin adapter reports write and stream failures to the Claude CLI transport, which shares terminal failure settlement and preserves cancellation through diagnostic drainage.

flowchart LR
  A[Claude CLI child] --> B[Managed stdin adapter]
  B --> C[Raw error notifications]
  C --> D[CLI transport settlement]
  E[Caller cancellation] --> D
  D --> F[Terminal result and cleanup]
Loading

Technical review

Best possible solution:

Keep the existing production owners and correct the cancellation predicate while retaining distinct native notification coverage.

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

Source shows two permitted adapter notification paths that violate the old exactly-one assertion; the reported CI failure was verified as failed, but its log was inaccessible and no target code was run.

Is this the best way to solve the issue?

The patch is the smallest complete correction: require nonempty EPIPE observations, preserve cancellation identity, and cover the separate native notification paths without altering production settlement.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6842ccd4bddf.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 89792e5 adds extensions/anthropic/cli-process.test.ts:259 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 89792e5aeb98; files: extensions/anthropic/cli-process.test.ts)
  • Dallin Romney: Raw commit 3a1232d adds src/process/supervisor/adapters/child-stdin.test.ts:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 3a1232d2bc83; files: src/process/supervisor/adapters/child-stdin.test.ts)

PR surface

Tests +31, Other +2. Total +33 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 33 2 +31
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 3 35 2 +33

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-0; tests +33/-2 The focused growth covers a distinct closed-write notification path and corrects the cancellation predicate.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: A bounded test-contract failure blocks useful packaging work without changing shipped runtime behavior.
  • 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.

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 (2 earlier review cycles)
  • reviewed 2026-11-01T13:18:36.967Z sha 25049a0 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-01T17:41:02.068Z sha 24145dd :: needs maintainer review before merge. :: none

Reviewed November 1, 2026, 2:00 PM ET / 19:00 UTC (Revision 3).

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 24145ddd6cff5b0d3b053efb04799ed29ce7ff2a. The narrow Promise-executor correction and targeted syntax/format proof are recorded in the PR body; full Node/Bun qualification is still pending.

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 1, 2026 18:16
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head b3b64d31acc0969f748c4b44bf9d1044a288d047. The type-safe strict error-identity assertion fixes the prior services compiler failure. The PR body records fresh exact-head services typecheck, both complete suites on Node 24.22.1 and pinned Bun (28 tests plus two assertion controls per runtime), targeted static checks, clean structured review and confirmed resource disposal. New-head CI remains independent and pending.

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@vincentkoc
vincentkoc merged commit 50efbfd into main Nov 1, 2026
133 checks passed
@vincentkoc
vincentkoc deleted the fix/anthropic-stdin-cancellation-contract-20261101 branch November 1, 2026 19:05
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 1, 2026
* fix(anthropic): validate cancellation across stdin notifications

* test(process): avoid returning from close promise executor

* test(process): preserve typed stdin error identity

(cherry picked from commit 50efbfd)
vincentkoc added a commit that referenced this pull request Nov 1, 2026
* fix(packaging): omit source-build ledgers from published packages

Keep source-module URL metadata in build trees for source AOT compilation, while excluding it from root and separately packed AI publication. Preserve runtime resources and canonical distribution inventories.

Allocate exactly 143 net regression-test lines for real npm/pnpm root and bundled-AI pack coverage, runtime exports, and inventory agreement; leave the shared baseline unchanged.

* test(packaging): type fixture package names

* test(packaging): complete declared publication fixture inputs

* test(anthropic): cover repeated stdin failure notifications (#190335)

* fix(anthropic): validate cancellation across stdin notifications

* test(process): avoid returning from close promise executor

* test(process): preserve typed stdin error identity

(cherry picked from commit 50efbfd)
vincentkoc added a commit that referenced this pull request Nov 1, 2026
* fix(packaging): omit source-build ledgers from published packages

Keep source-module URL metadata in build trees for source AOT compilation, while excluding it from root and separately packed AI publication. Preserve runtime resources and canonical distribution inventories.

Allocate exactly 143 net regression-test lines for real npm/pnpm root and bundled-AI pack coverage, runtime exports, and inventory agreement; leave the shared baseline unchanged.

* test(packaging): type fixture package names

* test(packaging): complete declared publication fixture inputs

* test(anthropic): cover repeated stdin failure notifications (#190335)

* fix(anthropic): validate cancellation across stdin notifications

* test(process): avoid returning from close promise executor

* test(process): preserve typed stdin error identity

(cherry picked from commit 50efbfd)
(cherry picked from commit 5f229e0)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…#190335)

* fix(anthropic): validate cancellation across stdin notifications

* test(process): avoid returning from close promise executor

* test(process): preserve typed stdin error identity
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…law#190030)

* fix(packaging): omit source-build ledgers from published packages

Keep source-module URL metadata in build trees for source AOT compilation, while excluding it from root and separately packed AI publication. Preserve runtime resources and canonical distribution inventories.

Allocate exactly 143 net regression-test lines for real npm/pnpm root and bundled-AI pack coverage, runtime exports, and inventory agreement; leave the shared baseline unchanged.

* test(packaging): type fixture package names

* test(packaging): complete declared publication fixture inputs

* test(anthropic): cover repeated stdin failure notifications (openclaw#190335)

* fix(anthropic): validate cancellation across stdin notifications

* test(process): avoid returning from close promise executor

* test(process): preserve typed stdin error identity

(cherry picked from commit 0285717)
vincentkoc added a commit that referenced this pull request Nov 2, 2026
* test(e2e): align legacy operator requested exec policy

* fix(doctor): preserve legacy upgrade backups and native assignments

* fix(doctor): retain opt-in backup discovery typing

* test(doctor): compare captured file bytes directly

* fix(doctor): inspect admitted state schema content

* fix: refresh the reviewed correction baseline

Baseline-Refresh: e20ab99aad2669c5ee844498d5e939d0a1031cd8

* test(doctor): avoid shadowing state descriptor

* fix(package): restore installed entry budget (#188097)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit d6d76cd)

* fix(packaging): exclude source-build ledgers from npm packages (#190030)

* fix(packaging): omit source-build ledgers from published packages

Keep source-module URL metadata in build trees for source AOT compilation, while excluding it from root and separately packed AI publication. Preserve runtime resources and canonical distribution inventories.

Allocate exactly 143 net regression-test lines for real npm/pnpm root and bundled-AI pack coverage, runtime exports, and inventory agreement; leave the shared baseline unchanged.

* test(packaging): type fixture package names

* test(packaging): complete declared publication fixture inputs

* test(anthropic): cover repeated stdin failure notifications (#190335)

* fix(anthropic): validate cancellation across stdin notifications

* test(process): avoid returning from close promise executor

* test(process): preserve typed stdin error identity

(cherry picked from commit 50efbfd)
(cherry picked from commit 5f229e0)

* fix: refresh the reviewed correction baseline

Baseline-Refresh: 131d3c9a10faf98d2bdb4e2b79051307c1e88f4f
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…186506)

* test(e2e): align legacy operator requested exec policy

* fix(doctor): preserve legacy upgrade backups and native assignments

* fix(doctor): retain opt-in backup discovery typing

* test(doctor): compare captured file bytes directly

* fix(doctor): inspect admitted state schema content

* fix: refresh the reviewed correction baseline

Baseline-Refresh: e20ab99aad2669c5ee844498d5e939d0a1031cd8

* test(doctor): avoid shadowing state descriptor

* fix(package): restore installed entry budget (openclaw#188097)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 1864046)

* fix(packaging): exclude source-build ledgers from npm packages (openclaw#190030)

* fix(packaging): omit source-build ledgers from published packages

Keep source-module URL metadata in build trees for source AOT compilation, while excluding it from root and separately packed AI publication. Preserve runtime resources and canonical distribution inventories.

Allocate exactly 143 net regression-test lines for real npm/pnpm root and bundled-AI pack coverage, runtime exports, and inventory agreement; leave the shared baseline unchanged.

* test(packaging): type fixture package names

* test(packaging): complete declared publication fixture inputs

* test(anthropic): cover repeated stdin failure notifications (openclaw#190335)

* fix(anthropic): validate cancellation across stdin notifications

* test(process): avoid returning from close promise executor

* test(process): preserve typed stdin error identity

(cherry picked from commit 0285717)
(cherry picked from commit dcfd10f)

* fix: refresh the reviewed correction baseline

Baseline-Refresh: 131d3c9a10faf98d2bdb4e2b79051307c1e88f4f
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: anthropic P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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