Skip to content

Fix failing cursor-cli E2E tests#1101

Merged
Soph merged 3 commits intomainfrom
soph/fix-cursor-e2e
May 4, 2026
Merged

Fix failing cursor-cli E2E tests#1101
Soph merged 3 commits intomainfrom
soph/fix-cursor-e2e

Conversation

@Soph
Copy link
Copy Markdown
Collaborator

@Soph Soph commented May 4, 2026

https://entire.io/gh/entireio/cli/trails/282

Two fixes:

  • now filters all agent ProtectedDirs/Files that cursor might touch
  • cursor RunPrompt also waits for "ctrl+c to stop" to disappear, so cursor finishes its turn and fires the stop hook before tmux is torn down.

Note

Medium Risk
Medium risk because it changes how files_touched is derived during fallback condensation, which can affect checkpoint attribution/metadata; the Cursor E2E wait logic also changes timing and could introduce new timeouts.

Overview
Fixes checkpoint files_touched fallback to exclude all agent-owned paths, not just .entire/, by filtering protected dirs (e.g. .cursor/, .claude/, .git/) and registered protected files (e.g. opencode.json) from committedFilesExcludingMetadata.

Stabilizes Cursor CLI E2E runs by waiting for Cursor to become truly idle (the "ctrl+c to stop" busy hint disappears) before tearing down tmux, ensuring the stop hook fires and SaveStep populates FilesTouched; updates the related unit test expectations accordingly.

Reviewed by Cursor Bugbot for commit 7f7db0b. Configure here.

Soph added 2 commits May 4, 2026 13:48
When sessionData.FilesTouched is empty, condensation falls back to the
committed-files set. The previous filter only stripped .entire/ and the
metadata dir, so agent config that gets staged by 'git add .' (.cursor/
hooks.json, .claude/settings.json, opencode.json) leaked into the
checkpoint's files_touched. Use the strategy's existing isProtectedPath
plus agent.AllProtectedFiles() so the fallback respects every registered
agent's ProtectedDirs/ProtectedFiles.

Entire-Checkpoint: 47e92cbead89
The WaitFor pattern 'Add a follow-up' matches Cursor's input placeholder,
which renders while the agent is still editing — alongside a busy-state
hint 'ctrl+c to stop' and an 'Editing N tokens' spinner. When this
returned mid-turn, the caller's defer s.Close() killed tmux before
cursor's stop hook fired, so SaveStep never recorded FilesTouched and
the resulting checkpoint relied on a fallback that swept up
.cursor/hooks.json. Add a second wait for the busy hint to disappear so
the stop hook gets a chance to fire.

Entire-Checkpoint: a03dcbad0304
Copilot AI review requested due to automatic review settings May 4, 2026 11:49
@Soph Soph requested a review from a team as a code owner May 4, 2026 11:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Cursor CLI E2E reliability and attribution accuracy by (1) making Cursor E2E prompts wait for the agent to become idle before tearing down tmux, and (2) expanding the fallback “committed files” filter to exclude agent-managed config dirs/files so files_touched doesn’t get polluted by agent infrastructure.

Changes:

  • Cursor E2E RunPrompt now waits for the “ctrl+c to stop” busy hint to disappear after the “Add a follow-up” marker appears.
  • committedFilesExcludingMetadata now excludes agent ProtectedDirs (via isProtectedPath) and agent ProtectedFiles (via agent.AllProtectedFiles()), not just .entire/.
  • Unit test updated to cover .cursor/ and opencode.json exclusions (and to exclude .claude/ as an agent-protected dir).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
e2e/agents/cursor_cli.go Adds an idle/wait loop after the “Add a follow-up” marker to prevent tmux teardown mid-turn so Cursor’s stop hook can fire.
cmd/entire/cli/strategy/manual_commit_condensation.go Expands fallback committed-file filtering to exclude agent-protected dirs/files from attribution files_touched.
cmd/entire/cli/strategy/manual_commit_test.go Updates tests to assert agent-protected paths/files are excluded from the committed-file fallback result.

Comment thread e2e/agents/cursor_cli.go Outdated
@Soph Soph changed the title Soph/fix cursor e2e Fix failing cursor-cli E2E tests May 4, 2026
The previous busy-hint poll started its own time.Now().Add(timeout) after
WaitFor had already potentially consumed the full timeout, so the call
could block for up to ~2x the caller's budget. It also ignored ctx
cancellation while sleeping. Track a single absolute deadline that
covers both stages, pass the remaining budget to WaitFor, and use a
select on ctx.Done() so cancellation interrupts the busy-wait.

Entire-Checkpoint: f9a1b68793d5
@Soph Soph merged commit 3a8273e into main May 4, 2026
9 checks passed
@Soph Soph deleted the soph/fix-cursor-e2e branch May 4, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants