fix(tui): clear sticky currentFile pill when agent activity is quiet#765
Merged
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Tests assert on nonexistent "editing " prefix from missing component
- Added the missing "editing " prefix to the current-file pill rendering in RunScreen.tsx (line 504), making the component output match what the tests assert on — positive assertions now correctly verify the pill is visible, and negative assertions genuinely validate that clearing works.
Or push these changes by commenting:
@cursor push 2cfe09d64b
Preview (2cfe09d64b)
diff --git a/src/ui/tui/screens/RunScreen.tsx b/src/ui/tui/screens/RunScreen.tsx
--- a/src/ui/tui/screens/RunScreen.tsx
+++ b/src/ui/tui/screens/RunScreen.tsx
@@ -501,7 +501,7 @@
</Box>
{currentFile && (
<Text color={Colors.muted} wrap="truncate-end">
- {currentFile}
+ editing {currentFile}
</Text>
)}
</Box>You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit a184ff9. Configure here.
This was referenced May 14, 2026
kelsonpw
added a commit
that referenced
this pull request
May 14, 2026
…o 30s (#777) The "refreshes the MCP Authorization header when the token rotates between attempts" test simulates a 60s cold-start stall plus jittered backoff (2-30s) inside fake timers — up to ~90s of virtual time per attempt. The test logic is correct, but the per-test 15s real-time timeout left no headroom for the scheduler under CI load on Node 20, producing intermittent "Test timed out in 15000ms" failures across multiple PRs (#765, #766, #767, #768, #769, #771). Double the timeout to 30s. No logic change.
The "currently editing X" pill on RunScreen latched `lastFileRef` whenever
`rawFile` was truthy but had no clear path — so after the inner agent
finished its last write, the pill kept showing that file forever, into
the Finalizing phase and beyond. The header lied about what the wizard
was doing.
Clear the sticky value when either condition holds:
1. The most recent `fileWrites` entry is older than 10s AND its
status is terminal (`applied` / `failed`) — quiet enough that
"currently editing" is no longer true.
2. `postAgentSteps.length > 0` — the agent has moved past the
file-write phase entirely (commit events, create dashboard, …).
Clear immediately, no grace period needed.
The stale-time check rides the spinner's existing SPINNER_INTERVAL
re-render — no extra timer mounted. Computed inline during render
rather than through useEffect so a quiet stretch (rawFile null, last
entry timestamps unchanged) doesn't skip re-evaluation.
Tests pin both clear conditions plus a heartbeat-keepalive regression:
a new write before the stale window switches the pill to the new path
without clearing.
…rtions Same fix as PR #768. The revising-screen elapsed timer ticks every 1s via setInterval; on Node 22 under CI clock pressure the interval can fire one tick before the test's advanceTimersByTime boundary, so the rendered "elapsed:" string lands at `1m 29s` instead of `1m 30s`. Both readings are correct for the test's intent (verifying tier WIRING, not exact copy), so widen the assertions to a regex that accepts ±1s.
da8dbc2 to
c4c210e
Compare
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.


Summary
Salvaged from #738 by cherry-picking its unique commit onto a fresh branch from
main. The original PR was stacked on the closedfeat/v2-tui-redesign(#696); its git history carried ~35 commits of v2 orchestration scaffolding that couldn't be rebased onto main's parallel orchestration implementation.Original commit preserved:
fc8bc468Test plan
Generated with Claude Code
Note
Low Risk
Low risk: only adjusts TUI rendering logic for the “currently editing” indicator and adds focused tests; no auth/data-flow changes.
Overview
Fixes the Progress tab’s sticky “currently editing …” pill so it stops claiming the agent is editing a file after activity has ended.
RunScreennow clears the last shown filename when either (a) the most recentfileWritesentry is terminal (applied/failed) and older than the newSTALE_FILE_WRITE_MSgrace window, or (b) post-agent steps begin (postAgentSteps.length > 0). Adds a new vitest suite covering in-flight display, stale-time clearing, immediate clearing on post-agent steps, and “heartbeat” behavior when new writes arrive.Reviewed by Cursor Bugbot for commit e580915. Bugbot is set up for automated code reviews on this repo. Configure here.