Skip to content

fix(test): isolate ACP startup output stream - #116076

Merged
vincentkoc merged 1 commit into
mainfrom
fix/acp-startup-stdout-listeners-20260729
Jul 30, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/acp-startup-stdout-listeners-20260729

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Resolves a problem where the ACP startup test attached real Node stream adapter listeners to worker stdout on every case, producing MaxListenersExceededWarning noise during the suite.

Why This Change Was Made

The startup fixture now mocks Writable.toWeb with a fresh inert web stream, matching its existing mocked stdin adapter. Production ACP stream and shutdown behavior are unchanged.

User Impact

No user-visible behavior change. Maintainers get deterministic ACP startup tests without leaked worker stdout listeners or warning-stack overhead.

Evidence

@vincentkoc
vincentkoc marked this pull request as ready for review July 29, 2026 20:38
@vincentkoc vincentkoc self-assigned this Jul 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 29, 2026
@vincentkoc
vincentkoc force-pushed the fix/acp-startup-stdout-listeners-20260729 branch from c0e6325 to 35f1a45 Compare July 29, 2026 20:39
@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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 29, 2026
@clawsweeper

clawsweeper Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 10:24 PM ET / July 30, 2026, 02:24 UTC.

ClawSweeper review

What this changes

The PR changes the ACP startup test fixture so each mocked conversion of worker stdout to a web writable stream returns a fresh inert WritableStream, preventing real Node adapter listeners from accumulating across tests.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal maintainer handling. The submitted change is a one-line, test-only stream-adapter isolation intended to remove repeat-listener warnings; the supplied focused before/after evidence and successful changed-file gate support the cleanup, while the maintainer label and member authorship require explicit maintainer judgment rather than automated cleanup.

Priority: P3
Reviewed head: 631f0169903acafb9dbe6bfcda20c56d203b36bb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) This is a focused, low-risk test-fixture cleanup with concrete reported before/after behavior and no supported correctness finding.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body provides after-fix terminal evidence for the exact focused test command, including the observed removal of listener warnings; redact any environment-specific details if additional output is posted.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides after-fix terminal evidence for the exact focused test command, including the observed removal of listener warnings; redact any environment-specific details if additional output is posted.
Evidence reviewed 3 items Focused test-fixture diff: The branch adds one mock implementation in the ACP startup test fixture: Writable.toWeb returns a fresh inert WritableStream, keeping production ACP code unchanged.
Reported after-fix behavior proof: The PR body reports that node scripts/run-vitest.mjs src/acp/server.startup.test.ts still passes all 21 tests after the change and no longer emits the previously observed MaxListenersExceededWarning variants.
Repository review state: The provided PR context shows a successful changed-file Testbox gate and no review findings across the completed ClawSweeper cycles; the current head is mergeable but blocked for maintainer review.
Findings None None.
Security None None.

How this fits together

ACP startup tests create a worker-side stdout stream and adapt it for the ACP server’s startup and shutdown path. The fixture’s Node stream mocks feed that setup, while the test assertions verify ACP startup behavior without relying on a real stdout adapter.

flowchart TD
  A[ACP startup test cases] --> B[Mocked Node stream adapters]
  B --> C[Worker stdout conversion]
  C --> D[ACP server startup fixture]
  D --> E[Startup and shutdown assertions]
  B --> F[Isolated writable web streams]
Loading

Before merge

  • Resolve merge risk (P1) - The supplied context supports the intended warning reduction, but this read-only review could not independently inspect the current-main ACP fixture and stream-lifecycle callers; maintainer acceptance should confirm the mock does not weaken any assertion that depends on Writable.toWeb semantics.
  • Complete next step (P2) - The PR is already focused and has reported proof, but its protected maintainer label and member authorship require an explicit maintainer merge decision rather than an automated repair or close.
Agent review details

Security

None.

PR surface

Tests +1. Total +1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 1 0 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 1 0 +1

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep stdout adaptation isolated at the ACP startup test boundary, retain the existing startup and shutdown assertions, and merge only after a maintainer confirms the fixture still covers the intended stream lifecycle.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep stdout adaptation isolated at the ACP startup test boundary, retain the existing startup and shutdown assertions, and merge only after a maintainer confirms the fixture still covers the intended stream lifecycle.

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

Yes, at source level: the PR identifies a focused ACP startup test command and a concrete warning pattern caused by repeated real stdout adapter attachment. The reported before/after run is credible, but this read-only pass did not execute it independently.

Is this the best way to solve the issue?

Unclear: mocking the adapter at the fixture boundary is a narrow solution consistent with the stated test-only goal, but a maintainer should confirm against the current ACP stream lifecycle that the mock preserves every relevant assertion.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 3672ab6fa15f.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix terminal evidence for the exact focused test command, including the observed removal of listener warnings; redact any environment-specific details if additional output is posted.

Label justifications:

  • P3: This is a narrowly scoped test-maintenance improvement that removes suite warning noise without changing asserted product behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides after-fix terminal evidence for the exact focused test command, including the observed removal of listener warnings; redact any environment-specific details if additional output is posted.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix terminal evidence for the exact focused test command, including the observed removal of listener warnings; redact any environment-specific details if additional output is posted.

Evidence

What I checked:

Likely related people:

  • vincentkoc: The provided PR context identifies this member as the author and assignee of the focused ACP startup test-fixture change; no broader current-main ownership history was available in the review context. (role: current ACP test contributor; confidence: low; commits: 631f0169903a; files: src/acp/server.startup.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-07-29T20:43:33.128Z sha 35f1a45 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-29T22:47:13.391Z sha 408bf80a7e61d7178ccb0c29adbc65217de86cd3 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-30T00:16:48.865Z sha 9d0a988abfd537cc54d8f69fd41d088e68b718a3 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the fix/acp-startup-stdout-listeners-20260729 branch 2 times, most recently from 408bf80 to 9d0a988 Compare July 30, 2026 00:12
@vincentkoc
vincentkoc force-pushed the fix/acp-startup-stdout-listeners-20260729 branch from 9d0a988 to 631f016 Compare July 30, 2026 02:20
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jul 30, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer merge-risk check completed: this startup suite already mocks ndJsonStream and asserts startup ordering, input replay, connection creation, and shutdown through the captured SDK stream. No assertion depends on the real Writable.toWeb(process.stdout) adapter’s backpressure or close behavior. Returning a fresh inert WritableStream therefore removes only process-global listener retention. The rebased focused suite passes 21/21, fresh autoreview is clean, exact openclaw/ci-gate is green, and current main has no ACP-file drift.

@vincentkoc
vincentkoc merged commit 3016666 into main Jul 30, 2026
97 checks passed
@vincentkoc
vincentkoc deleted the fix/acp-startup-stdout-listeners-20260729 branch July 30, 2026 02:27
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit to zhangguiping-xydt/openclaw that referenced this pull request Jul 30, 2026
* origin/main:
  fix(macos): stop canceled voice wake timers (openclaw#116189)
  fix(macos): coalesce location permission requests (openclaw#116183)
  fix(macos): guard remote tunnel restart ownership (openclaw#116172)
  fix(agents): throw CompactionError when summarization fails (openclaw#115500)
  fix(test): isolate ACP startup output stream (openclaw#116076)
  fix(agents): deny all tools when scheduled authority names a removed account (openclaw#115932)
  fix(test): stop collecting Vydra test helpers (openclaw#116139)
  fix(discord): preserve webhook deadline errors (openclaw#116155)
  fix(test): isolate Google embedding batch timeout (openclaw#116161)
  fix(cron): stop replaying old schedule slots after a cron job is edited (openclaw#115779)
  fix(plugins): report request timeouts for stalled response bodies (openclaw#116166)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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