fix(e2e): force foreground subagents in claude-code prompts · Entire

fix(e2e): force foreground subagents in claude-code prompts

4580e15→main·

pfleidi·2w ago·2 files·+2 added/-2 removed

New Claude Code releases can run Task subagents in the background: the tool call returns immediately, the foreground turn ends, and the subagent's file changes and commit land after turn-end with no active session — so no checkpoint trailer or condensation happens and the checkpoint-advance assertions time out (CI failures on Linux and Windows).

Instruct the agent to run the subagent in the foreground and wait for it, keeping these tests on the synchronous path they are meant to cover. Tracking background-subagent work in the CLI itself (e.g. via the SubagentStop hook) is a separate product gap.

Sessions

91b00f9ec504View transcript

[?
Debug E2E Test Timing IssuesClaude Code·Opus 4.8[1m]·2 steps](/content/gh/entireio/cli/session/58280a70-c670-4b2d-a1c8-80439ef7460d#timeline-91b00f9ec504/index.html)

Changes

2

95 unmodified lines

96
97
98
99
99
100
101
102

95 unmodified lines

}

_, err := s.RunPrompt(t, ctx,
            "use a subagent: create a markdown file at docs/red.md with a paragraph about the colour red, then commit it. Do not ask for confirmation, just make the change.")
            "use a subagent: create a markdown file at docs/red.md with a paragraph about the colour red, then commit it. Run the subagent in the foreground and wait for it to finish; never run it in the background. Do not ask for confirmation, just make the change.")
        if err != nil {
            t.Fatalf("agent failed: %v", err)
        }

Me2e/tests/single_session_test.go+1/-1

16 unmodified lines

17
18
19
20
20
21
22
23

16 unmodified lines

func TestSubagentCommitFlow(t *testing.T) {
    testutil.ForEachAgent(t, 3*time.Minute, func(t *testing.T, s *testutil.RepoState, ctx context.Context) {
        _, err := s.RunPrompt(t, ctx,
            "use a subagent: create a markdown file at docs/red.md with a paragraph about the colour red. Do not commit the file. Do not ask for confirmation, just make the change.")
            "use a subagent: create a markdown file at docs/red.md with a paragraph about the colour red. Run the subagent in the foreground and wait for it to finish; never run it in the background. Do not commit the file. Do not ask for confirmation, just make the change.")
        if err != nil {
            t.Fatalf("agent failed: %v", err)
        }

Me2e/tests/subagent_commit_flow_test.go+1/-1