Conversation
The hardcoded 15s checkpoint polling timeout was too short for slower agents like Copilot CLI. Add RepoState.CheckpointTimeout() that scales the base 15s by each agent's TimeoutMultiplier, and bump Copilot CLI from 1.5x to 2.5x. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: e6d21f633a5a
There was a problem hiding this comment.
Pull request overview
This PR updates the E2E harness to accommodate Copilot CLI v1.0.8+ requiring folder trust before repo-level hooks load (notably in -p non-interactive mode), and makes checkpoint polling timeouts scale with each agent’s speed.
Changes:
- Add
RepoState.CheckpointTimeout()and update E2E tests to use it instead of a hard-coded 15s. - Increase the Copilot CLI agent timeout multiplier and pre-seed Copilot’s trusted folder config before
-pprompts. - Replace several checkpoint wait calls across E2E tests to use the new scaled timeout helper.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| e2e/testutil/repo.go | Adds CheckpointTimeout() helper to scale polling timeouts by agent multiplier. |
| e2e/agents/copilot-cli.go | Ensures Copilot folder trust for -p mode, increases multiplier, and adds config-writing helper. |
| e2e/tests/subagent_commit_flow_test.go | Uses s.CheckpointTimeout() for checkpoint polling. |
| e2e/tests/stash_workflows_test.go | Uses s.CheckpointTimeout() for checkpoint polling/advance waits. |
| e2e/tests/split_commits_test.go | Uses s.CheckpointTimeout() for checkpoint polling/advance waits. |
| e2e/tests/single_session_test.go | Uses s.CheckpointTimeout() for checkpoint polling. |
| e2e/tests/session_lifecycle_test.go | Uses s.CheckpointTimeout() for checkpoint polling/advance waits. |
| e2e/tests/rewind_test.go | Uses s.CheckpointTimeout() for checkpoint polling/advance waits. |
| e2e/tests/resume_test.go | Uses s.CheckpointTimeout() for checkpoint polling/advance waits. |
| e2e/tests/resume_remote_test.go | Uses s.CheckpointTimeout() for checkpoint polling. |
| e2e/tests/multi_session_test.go | Uses s.CheckpointTimeout() for checkpoint polling. |
| e2e/tests/mid_turn_commit_test.go | Uses s.CheckpointTimeout() for checkpoint polling. |
| e2e/tests/interactive_test.go | Uses s.CheckpointTimeout() for checkpoint polling. |
| e2e/tests/external_agent_test.go | Uses s.CheckpointTimeout() for checkpoint polling. |
| e2e/tests/existing_files_test.go | Uses s.CheckpointTimeout() for checkpoint polling and session-idle wait. |
| e2e/tests/edge_cases_test.go | Uses s.CheckpointTimeout() for checkpoint polling and manual deadline loop. |
| e2e/tests/deleted_files_test.go | Uses s.CheckpointTimeout() for checkpoint polling. |
| e2e/tests/checkpoint_metadata_test.go | Uses s.CheckpointTimeout() for checkpoint polling. |
| e2e/tests/attribution_test.go | Uses s.CheckpointTimeout() for checkpoint polling/advance waits. |
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: Race condition on shared config file in concurrent tests
- Added a sync.Mutex (copilotTrustMu) to serialize the read-modify-write cycle in ensureCopilotTrust, preventing concurrent goroutines from overwriting each other's trusted_folders entries.
Or push these changes by commenting:
@cursor push e3a5d8c319
Preview (e3a5d8c319)
diff --git a/e2e/agents/copilot-cli.go b/e2e/agents/copilot-cli.go
--- a/e2e/agents/copilot-cli.go
+++ b/e2e/agents/copilot-cli.go
@@ -9,6 +9,7 @@
"os/exec"
"path/filepath"
"strings"
+ "sync"
"syscall"
"time"
)
@@ -186,10 +187,15 @@
return s, nil
}
+var copilotTrustMu sync.Mutex
+
// ensureCopilotTrust adds dir to ~/.copilot/config.json trusted_folders if not
// already present. Copilot CLI v1.0.8+ requires folder trust before loading
// repo-level hooks; without this, hooks silently don't fire in -p mode.
func ensureCopilotTrust(dir string) error {
+ copilotTrustMu.Lock()
+ defer copilotTrustMu.Unlock()
+
absDir, err := filepath.Abs(dir)
if err != nil {
return errThis Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Copilot CLI v1.0.8 changed hook loading to require folder trust confirmation before loading repo-level hooks. In non-interactive (-p) mode there is no trust dialog, so hooks silently never fire. Pre-add the test repo directory to ~/.copilot/config.json trusted_folders before invoking copilot -p. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 44debfa7ba4f
|
It's not working, back to draft. |


Turns out v1.0.8 of copilot changed:
For interactive E2E tests we handled this but for
-pdirect prompt execution hooks did not fire anymore.And it also adds scaling to E2E checkpoint polling timeouts by each agent's TimeoutMultiplier, and bump Copilot CLI from 1.5x to 2.5x (15s → 37.5s)
Note
Medium Risk
Touches E2E harness behavior and mutates user-level Copilot config (
~/.copilot/config.json), which could affect developer/CI environments and change test timing characteristics.Overview
Fixes Copilot CLI non-interactive (
-p) E2E runs by pre-adding the repo directory to Copilot’strusted_foldersin~/.copilot/config.jsonso repo-level hooks load reliably on v1.0.8+.Increases
copilot-cli’sTimeoutMultiplierand updates E2E tests to use a newRepoState.CheckpointTimeout()helper, so checkpoint polling/idle waits scale per agent instead of using a hardcoded 15s.Written by Cursor Bugbot for commit 8dd64d4. Configure here.