feat: keep the tool trace visible after a run completes - #12
Merged
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #9.
Why
Errand's core promise is that you can hand an agent a task, close the laptop, and come back later. But anyone who wasn't watching the screen during the run can never see what the agent actually did. The tool trace unmounts the moment a run completes, and it's discarded on agent switch, reload, and replay. The result of a run is only half the answer; the trace is the receipt. This PR keeps that receipt, so "every task leaves a trace you can read" (from the Errand launch post) holds after the run finishes, not just during it.
Before
The tool activity list exists only while a run is streaming.
WorkingActivityunmounts the moment the agent message settles,activitiesstate is cleared on send and agent-switch, andreplayRunMessagesconsumes only text deltas so ten seconds after a run finishes (or after switching agents, or reopening the app) there is no way to see what the agent actually did.After
Completed agent messages keep their trace as a collapsed
Worked · N stepsrow, the same<details>block, tool rows, icons, and expand behavior as the live view, minus the timer. It survives run completion, agent switches, and app restarts (reconstructed from the run's event stream during the existing replay). Runs with no tool calls render exactly as before.How
Messagegains an optionalactivitiesfield, so traces ride the existing snapshot /mergeVisualMessagereconciliation instead of new state.replayRunMessagescollectstool_execution_*events with the sameactivityFromPiEventhelper the live subscription uses, instead of discarding them, and attaches them to the replayed agent message.useCrewControllermoves the live activity pool onto the message that stops streaming (completion, terminal update, or interruption), then clears it — the pool is never shared across runs or agents..agent-worked-details … {background:none;animation:none;color:var(--muted)}) stops the working shimmer on settled summaries. No new visual elements or borders otherwise.Verification
npm run typecheck,npm run lint,npm run buildare clean.npm test, all suites pass except the pre-existing win32 path-separator assertion inappBranding.test.ts(fails identically on unmodifiedmain; fixed separately in fix: ensure clean installs and tests on Windows and Linux #8).Happy to reshape any of this, the summary copy, where the trace sits relative to the reply, or splitting the replay change from the UI change whatever fits your direction for the activity surface.