Skip to content

Refresh an open output tab when its execution leaves history - #26

Open
Chirag6722 wants to merge 1 commit into
thegoodengineer:mainfrom
Chirag6722:fix/output-tab-refresh
Open

Refresh an open output tab when its execution leaves history#26
Chirag6722 wants to merge 1 commit into
thegoodengineer:mainfrom
Chirag6722:fix/output-tab-refresh

Conversation

@Chirag6722

Copy link
Copy Markdown
Collaborator

Fixes #3, per your direction: fire from store.onDidChange for the affected ids.

OutputFileSystemProvider declared _onDidChangeFile and never fired it, so VS Code had no reason to call readFile again. A tab left open across Clear History, or across a maxEntries trim, kept rendering an execution that was gone.

readFile already answers for a missing id with "no longer in history (history was cleared or trimmed)". It just never got asked.

Now the provider tracks the ids it has actually served and, on store change, fires for any that have since left. The set stays bounded: an id is dropped as soon as it leaves the store, and is otherwise capped by maxEntries.

One judgment call I made, easy to reverse if you disagree. I fire Changed rather than Deleted. Deleted would close the editor out from under someone mid-read; Changed makes the tab re-read and show the explanation that was already written for this exact case. Explaining the absence rather than making it disappear seemed like the same stance the codebase already takes with disabled shell integration and cmd.exe.

A recorded execution never changes once stored, so removal is the only content change that can happen. That is why this fires only for departures rather than for every store change.

Verified end to end rather than by inspection: open a tab on a recorded execution, clear history, and the same document object now reads

TruthLog: execution "output-refresh-1786944250306" is no longer in history (history was cleared or trimmed).

49 passing on Windows, including the new test.

Fixes thegoodengineer#3

OutputFileSystemProvider declared _onDidChangeFile and never fired it, so
VS Code had no reason to call readFile again. An output tab left open
across Clear History, or across a maxEntries trim, kept rendering an
execution that was no longer there.

readFile already answers for a missing id with "no longer in history
(history was cleared or trimmed)". It just never got asked.

Track the ids actually served, and on store change fire for any that have
since left. Changed rather than Deleted on purpose: the tab re-reads and
displays that explanation, instead of the editor being closed under
someone who was mid-read. Explaining the absence is the same stance the
rest of the codebase takes.

The served set stays bounded, since an id is dropped as soon as it leaves
the store and is otherwise capped by maxEntries.

Verified end to end: open a tab on a recorded execution, clear history,
and the same document now reads

    TruthLog: execution "..." is no longer in history (history was
    cleared or trimmed).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

An already-open output tab keeps showing an execution that was cleared

1 participant