Skip to content

Commit e885e95

Browse files
k1ytmyk1yt
authored andcommitted
fix(ci): break terminal-reuse fixture re-match loop
1 parent 59cb185 commit e885e95

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

apps/vscode-e2e/src/fixtures/terminal-reuse-shell-race.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,20 @@ import { toolResultContains } from "./tool-result"
55
export function addTerminalReuseShellRaceFixtures(mock: InstanceType<typeof LLMock>) {
66
// First command completes — model issues a second command on the same terminal.
77
// With the temp-script fix, both commands now deliver real output.
8+
// Single-fire guard: `toolResultContains` is a permanent-history existence check, so once the
9+
// first command's result is in history this predicate would match on EVERY subsequent re-prompt.
10+
// If the second command's result does not satisfy Fixture B, Fixture A would keep re-emitting the
11+
// second command forever (60s test timeout). Fire exactly once.
12+
let secondCommandIssued = false
813
mock.addFixture({
914
match: {
10-
predicate: (req) => toolResultContains(req, "call_terminal_reuse_001", ["first", "Exit code: 0"]),
15+
predicate: (req) => {
16+
if (secondCommandIssued) return false
17+
if (!toolResultContains(req, "call_terminal_reuse_001", ["first", "Exit code: 0"])) return false
18+
// Match confirmed — the response below will be emitted. Latch so we never match again.
19+
secondCommandIssued = true
20+
return true
21+
},
1122
},
1223
response: {
1324
toolCalls: [

0 commit comments

Comments
 (0)