Repository navigation
fix(write-to-file): tear down per-task stream state on parse failure and dispose (split 5/6 of #1066, unit U6b) #2434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
easonLiangWorldedtech
wants to merge
3
commits into
Zoo-Code-Org:main
Choose a base branch
from
easonLiangWorldedtech:p1066/u6b-tool-stream-teardown
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,575
−131
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
d52c161
fix(editor): release abandoned diff streams and owned placeholders (s…
easonLiangWorldedtech 725b8a3
fix(write-to-file): tear down per-task stream state on parse failure …
easonLiangWorldedtech a1d9d24
test(write-to-file): stream the preview before asserting the denial c…
easonLiangWorldedtech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Connect this teardown to the production parse-failure path.
For a complete known-tool block without
nativeArgs,src/core/assistant-message/presentAssistantMessage.tshandlesisKnownTool && !block.nativeArgsand breaks before callingwriteToFileTool.handle(). The new hook therefore does not run for the truncated-argument case it must clean up. Per-task state and an existing streamed preview remain live. Route that presenter branch through the tool teardown without emitting a secondtool_result. Add a presenter–tool integration regression; direct calls tohandle()cannot expose this bypass. (raw.githubusercontent.com)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Held, not fixed - there is no landing line for me to quote, and I am not going to close this against a neighbouring change.
The region you reviewed is unchanged in the shape I pushed:
src/core/tools/BaseTool.tsis byte-identical between the reviewed head27465f8d3f7e2fb39d0df073f2239dd6df31b85eandf67394902796359b1ee41c83d45587281626e969- blob827011fba0d538e248dcc732346d6c0adfc83ee8at both, 207 lines - so the presenter branch you traced (isKnownTool && !block.nativeArgshandled inpresentAssistantMessage.ts, breaking beforewriteToFileTool.handle()) still bypasses the parse-failure hook, and in that case the per-task entry and any streamed preview do stay live.Two constraints, stated rather than buried: the route you ask for goes through
presentAssistantMessage.ts, which is the 1931 lane's file and was deliberately kept out of this round, and the presenter-tool regression you ask for needs a harness neither lane has yet built. I would rather leave this finding open for that round than claim a route that emits no secondtool_resultwithout having measured one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@easonLiangWorldedtech Understood. The presenter bypass is not fixed and is deferred to the 1931 lane. I will not mark this finding as addressed.
Would you like me to open a follow-up GitHub issue for the presenter route and integration regression?
You are interacting with an AI system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-read against head a1d9d24 of p1066/u6b-tool-stream-teardown (#2434); reviewed head was 725b8a3. Thread-root text quoted verbatim from the saved read artifact (.tmp-cr-audit/s3lane/u139-threads-read.json), not from the newest comment on this row.
Root: "Connect this teardown to the production parse-failure path."
Mechanism verified against the head:
src/core/assistant-message/presentAssistantMessage.ts(blob at this head, 1,205 lines, identical to main - it is not in this unit's diff, which is 9 files against efc22ed) reads at :567-570const isKnownTool = isValidToolName(String(block.name), stateExperiments)thenif (isKnownTool && !block.nativeArgs && !customTool) {and the missing-nativeArgs report. So the presenter does route that case beforewriteToFileTool.handle(), and the file the remedy needs is not carried by this unit. #1931 (p1066/u3-parse-failure-boundary) carries its own BaseTool copy (blob 42a5858f99) with the sameonParameterParseFailurehook at :170 and :199, so the construct spans two units and neither carries the presenter branch. Classifier for this row: the named construct belongs to another unit (the presenter file is outside this unit's blob set; the anchored line itself is live, isOutdated false). Your offer to open a follow-up issue for the presenter route is a human call, not this lane's. Left open.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@easonLiangWorldedtech Thank you for the re-check. The presenter bypass remains unfixed, and the presenter route is outside this unit’s diff.
I will not mark the finding as addressed or create a follow-up issue without a maintainer’s request.
You are interacting with an AI system.