fix: verify native terminal closure before bounded descriptor settlement

This commit is contained in:
garrytan committed 2026-10-08 07:19:22 +00:00
1 parent df82a16d10
commit f0bffe4b49
5 files changed
+16 -4

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
# Changelog
## [1.91.37.0] - 2026-10-07
## [1.91.39.0] - 2026-10-07
### Added
- Choose separate model tiers for planning and implementation. Independent plan reviews default to Fable 5.1 or GPT-6 Astra; implementation handoffs recommend Opus 5.5 or GPT-6.1 Sol without switching your session. Explicit model choices still win, and `plan_review_tier smart` or `host` provides an alternative to the frontier default.
+1 -1
View File
@@ -1 +1 @@
1.91.37.0
1.91.39.0
+1 -1
View File
@@ -1,4 +1,4 @@
# gstack digest v1.91.37.0 — regenerate/re-copy after upgrading gstack
# gstack digest v1.91.39.0 — regenerate/re-copy after upgrading gstack
Behavioral rules from gstack (https://github.com/garrytan/gstack), compressed
for agent hosts without a full skill install. The full skills add workflows,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gstack",
"version": "1.91.37",
"version": "1.91.39",
"description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.",
"license": "MIT",
"type": "module",
+12
View File
@@ -58,17 +58,29 @@ process.stdout.write('TERMINAL_READY');
`, { mode: 0o755 });
const originalBinary = process.env.BROWSE_TERMINAL_BINARY;
let session: ClaudePtySession | undefined;
let terminal: Bun.Terminal | undefined;
const spawn = Bun.spawn;
const spawnSpy = spyOn(Bun, 'spawn').mockImplementation(((...args: any[]) => {
const child = (spawn as any)(...args);
if (args[1]?.cwd === dir && args[1]?.terminal) terminal = child.terminal;
return child;
}) as typeof Bun.spawn);
try {
process.env.BROWSE_TERMINAL_BINARY = fake;
session = await launchClaudePty({ cwd: dir, model: 'fixture', timeoutMs: 5000, sessionLedger: false });
await session.waitFor('TERMINAL_READY', { timeoutMs: 3000 });
expect(terminal?.closed).toBe(false);
expect(descriptors().length).toBeGreaterThan(before.length);
await session.close();
expect(session.exited()).toBe(true);
expect(terminal?.closed).toBe(true);
const settledBy = performance.now() + 1000;
while (JSON.stringify(descriptors()) !== JSON.stringify(before) && performance.now() < settledBy) await Bun.sleep(10);
expect(descriptors()).toEqual(before);
} finally {
try { await session?.close(); }
finally {
spawnSpy.mockRestore();
if (originalBinary === undefined) delete process.env.BROWSE_TERMINAL_BINARY;
else process.env.BROWSE_TERMINAL_BINARY = originalBinary;
fs.rmSync(dir, { recursive: true, force: true });