Skip to content

feat(write-to-file): per-task partial stream state + cleanup primitives (split 2/6 of #1066) - #65

Closed
easonLiangWorldedtech wants to merge 2 commits into
p1066/u1-task-save-stages-and-partial-askfrom
p1066/u4-per-task-stream-state
Closed

easonLiangWorldedtech wants to merge 2 commits into
p1066/u1-task-save-stages-and-partial-askfrom
p1066/u4-per-task-stream-state

Conversation

@easonLiangWorldedtech

Copy link
Copy Markdown
Owner

U4 — per-task partial stream state + cleanup primitives

Part of the PR Zoo-Code-Org#1066 split (tracking issue Zoo-Code-Org#703) split (content source of record: 72143527fd33306e5541116093c2cbf803cce9e0..pr-1066-audit).

Why this unit exists: Per-task partial stream state keyed by taskId.instanceId, the TaskAborted listener, clearTaskState(), per-task path stabilization and the cleanup primitives, plus the ClineProvider disposal wiring. Accepted divergence: sibling streaming tools (ApplyDiffTool, EditFileTool, SearchReplaceTool, EditTool) still use BaseTool's singleton lastSeenPartialPath/resetPartialState; lifting the per-task keying to BaseTool is a follow-up PR. The focused cleanup spec is sanctioned new content (allowNew): the primitives' catch arms are only reachable by calling them directly at this layer.

Boundaries

  • base: 5223a10dc342
  • head: 9d78a76b8e6b
  • content source: 72143527fd33306e5541116093c2cbf803cce9e0..pr-1066-audit (local)

Fidelity (machine-verified)

zdt split verify --contract U4.json --worktree <wt> --head 9d78a76b8e6b

Result: PASS — standalone 428 a+d / 5 files (SOFT-OVERSHOOT (rationale required in PR body))

  • src/__tests__/removeClineFromStack-delegation.spec.ts: OK (content subset of source)
  • src/core/tools/WriteToFileTool.ts: OK (content subset of source)
  • src/core/tools/__tests__/writeToFileTool-partial-state-cleanup.spec.ts: NEW (allowNew)
  • src/core/tools/__tests__/writeToFileTool.spec.ts: OK (content subset of source)
  • src/core/webview/ClineProvider.ts: OK (content subset of source)

Budget rationale (soft overshoot): see the deviations list

Design contract

Verification (this unit, as pushed)

  • Tests: 230 passed / 5 skipped (narrowest suites: writeToFileTool.spec, writeToFileTool-partial-state-cleanup.spec, removeClineFromStack-delegation.spec, Task.spec, presentAssistantMessage-custom-tool.spec)
  • changed-line coverage: 34 covered / 0 uncovered — PASS
  • ESLint (--prune-suppressions --max-warnings=0): clean on every touched file; suppression counts unchanged
  • No .changeset file, no CHANGELOG edit.

Recreate policy

If the bot stalls on a pre-merge check and the existing head cannot obtain bot review/approval (empty-commit re-trigger attempted and failed), the unit is recreated from the tagged content source of record — never from a per-PR head. At most 1 PR per issue.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review status

Thanks for contributing. This comment tracks the review sequence and the next action.

Current step: Required CI passed. Waiting for automated review of the latest commit.

If automated review does not start, a maintainer must restart it.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@easonLiangWorldedtech

Copy link
Copy Markdown
Owner Author

Moved to the upstream repo (base = main); the split chain is tracked in Zoo-Code-Org#703.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit coderabbit-review-active Required CI passed; CodeRabbit review is active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant