.qwen/e2e-tests/2026-08-12-daemon-acp-http-pre-attach-bounds.md
Verify that connection/session responses produced before an ACP HTTP SSE or WebSocket owner is ready are bounded by serialized bytes and frame count across every workspace mount. The test does not claim to bound ordinary live transport queues or transient JSON.stringify amplification.
Run the harness against the parent of this change. Initialize one ACP HTTP connection without attaching its response stream, then make the fake bridge produce 128 distinct 1 MiB results. Confirm retained heap/RSS grows with every payload and that the connection remains registered. Repeat with primary and dynamic workspace connections to confirm their retained buffers add together without a daemon-global boundary.
qwen serve with ACP HTTP enabled, one primary workspace, and one dynamically registered trusted workspace.usedFrames and usedBytes remain charged. Close the socket, settle the write, and confirm all counters return to the pre-test baseline.session/new, session/load, session/resume, or session/fork results, then close or overflow the connection before delivery. Confirm fresh sessions and persisted forks are removed, newly attached clients are detached, existing ownership remains intact, and none of the provisional sessions accept a prompt before response delivery.session/new, session/load, session/resume, and session/fork. Confirm no session is created, restored, attached, or forked.GET /daemon/status?detail=full. Verify fixed limits, global current/high-water count and bytes, pending-delivery frames, guard failures, per-mount failure attribution, and per-connection owned count/bytes.(cd packages/acp-bridge && npx vitest run src/bridge.test.ts src/spawnChannel.test.ts)
(cd packages/cli && npx vitest run src/serve/acp-http/pre-attach-budget.test.ts src/serve/acp-http/connection-registry.test.ts src/serve/acp-http/sse-stream.test.ts src/serve/acp-http/ws-stream.test.ts src/serve/acp-http/transport.test.ts src/serve/daemon-status.test.ts)
(cd packages/sdk-typescript && npx vitest run test/unit/daemon-public-surface.test.ts)
npm run build && npm run typecheck && npm run lint
git diff --check