Skip to content

Commit db8ee37

Browse files
Wait for rendered terminal approval state in CI
1 parent 07e9dbc commit db8ee37

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎docs/NATIVE_VERIFICATION.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ these transitions. Assertions inspect fresh complete frames because incremental
304304
ANSI updates can split words. This covers resize recovery; broader picker
305305
navigation, visual review and sustained terminal stress remain open.
306306

307+
The approval phase now waits for the terminal's rendered **DENY** dialog and
308+
then its rendered **ALLOW** state before sending Enter. This replaced a fixed
309+
delay that could race the terminal's asynchronous approval refresh on a clean
310+
CI runner. The repaired PTY probe passes all eight fixture-model requests and
311+
the workspace Clippy check remains clean.
312+
307313
## Reviewed copy of uncommitted work
308314

309315
Twelve real-Git worktree tests pass. Copy scenarios verify distinct staged and

‎scripts/test-native-tui.mjs‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,21 @@ try {
280280
await delay(200);
281281
assert.equal((await cli(["approvals"])).approvals[0].id, approval.id);
282282
tui.child.stdin.write("\x7f");
283+
const openingApproval = tui.output.stdout.length;
283284
tui.child.stdin.write("\x1bOS");
284-
await delay(150);
285-
tui.child.stdin.write("\t\r");
285+
await until("terminal approval dialog", () =>
286+
tui.output.stdout
287+
.slice(openingApproval)
288+
.includes("DENY · Tab switches"),
289+
);
290+
const switchingApproval = tui.output.stdout.length;
291+
tui.child.stdin.write("\t");
292+
await until("terminal approval allow state", () =>
293+
tui.output.stdout
294+
.slice(switchingApproval)
295+
.includes("ALLOW · Tab switches"),
296+
);
297+
tui.child.stdin.write("\r");
286298
await until(
287299
"approved exact command",
288300
async () =>

0 commit comments

Comments
 (0)