Repository navigation
Conversation
nc-review: comments — 1 important, 1 nit@Dhirenderchoudhary — a few things worth a look, none blocking. Small, well-scoped bug fix: read_file stubs now reset (per ACP session or via read generation bump) when the history is swapped by /clear, retry, timeline revert, load from disk, resume, or TUI /resume. The ACP scope-per-session change mirrors the subagent pattern and the test coverage of the affected code paths is reasonable. The one substantive concern is that the PR is framed as 'Closes #793' even though #793 is the much larger 'Semantic Context Compiler' umbrella issue (5 stages) and this only patches a sub-bug of Stage 1; merging would auto-close the umbrella and silently lose the remaining stages. 🟠 important · The PR description says Closes #793, but issue #793 is the umbrella 'Semantic Context Compiler' tracking five stages (semantic dedup, LSP-aware trimming, tool result compression, budget enforcement, visible meter). This PR only fixes a sub-bug of Stage 1 (read-stub reset on history swap). The other four stages plus the remaining Stage 1 work are unaddressed. Per the rubric, a partial fix that auto-closes a tracking issue silently loses the rest — at minimum, drop the 'Closes #793' wording (or change it to 'Refs #793') and let the umbrella stay open until the remaining stages land. The implementation itself is correct and complete for the sub-bug it targets. ⚪ nit · In the session.messages = [];
clearAcpReadStubs(session.sessionId);The sibling sites ( 🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
nc-review: comments — 2 nits@Dhirenderchoudhary — a few things worth a look, none blocking. Scoped, well-tested fix: read_file stubs now reset on every code path that swaps the chat history (TUI /resume via Addressed since the last review
⚪ nit ·
⚪ nit · The new 🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
addyCooks
left a comment
There was a problem hiding this comment.
Thanks @Dhirenderchoudhary, this fixes the ACP and /resume cases cleanly.
I ran the specs: the 7 new stub tests fail on main and pass here, and types, lint, format and knip pass.
One gap in the same bug class: two TUI paths clear the whole history without resetting the read stubs.
useModeHandlers.tsx:360(handleTuneSelect, "Clear conversation when toggling")useModeHandlers.tsx:236(handleConfigWizardComplete, after the new client is created)
Both callsetMessages([]), andclient.clearContext()doesn't touch the stubs, so after/tuneor the config wizardread_filecan still reply "already in context" for a file the empty history never saw. Could you addbumpReadContentGeneration()at those two sites, with a test each, and add /tune and the config wizard to the list in docs/features/context-compression.md?
Tiny, optional: deleteSession isn't cleared, so a deleted ACP chat's scope stays in memory until exit; a one-line comment saying that's accepted would help.
Everything else looks good, and "Refs #793" is right for the umbrella.
…-stubs-on-history-swap # Conflicts: # source/acp/acp-conversation.spec.ts
|
@addyCooks all things addressed please have a look |
…-stubs-on-history-swap
addyCooks
left a comment
There was a problem hiding this comment.
Good Work @Dhirenderchoudhary,
Approving 🎉
Description
Refs #793. That issue tracks five stages, so it stays open. This only finishes the read stub part of stage 1, which landed in #1359 (compaction landed in #1066). This fixes the gaps left on main where
read_filecould answer "already in context" for a file the current history never saw.acp:<sessionId>), using the same scope mechanism subagents use./clear, retry, timeline revert,loadSessionfrom disk, andresumeSessioncut or replace the history without touching the stubs. They now clear that chat's scope./resumeswapped the history but kept the stubs.applySessionnow bumps the read generation, the same as compact does./tuneand finishing the config wizard clear the history the same way, so they bump the read generation too.ACP
deleteSessionalso drops that chat's scope, so deleted chats don't keep stubs in memory. The edit guard (seenFiles) is unchanged.Every new test failed on main and passes with the fix.
Type of Change
Changeset
pnpm changeset) describing this change for the changelogDocs-only or internal chores need no changeset (or run
pnpm changeset --emptyto note that intentionally).Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist