From 3cb6ef027b90a0a3c6d73657eb46b5b47ffd22d9 Mon Sep 17 00:00:00 2001 From: garrytan Date: Tue, 6 Oct 2026 18:27:24 +0000 Subject: [PATCH] test: fix the spawned-block slice and type the #3045 re-init events --- test/autoplan-publication-guard.test.ts | 4 ++-- test/spawned-consent-rule.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/autoplan-publication-guard.test.ts b/test/autoplan-publication-guard.test.ts index 943361712..324dcae3f 100644 --- a/test/autoplan-publication-guard.test.ts +++ b/test/autoplan-publication-guard.test.ts @@ -500,9 +500,9 @@ describe('Autoplan parent publication guard', () => { const reason = (f.evaluate() as any).reason; expect(reason).toContain('which this guard cannot bind'); expect(reason).toContain('`bun "" init "" "" ""`'); - f.events.splice(2, 0, { ...structuredClone(f.events[0]!), toolUseId: 're-init', + f.events.splice(2, 0, { ...(structuredClone(f.events[0]!) as any), toolUseId: 're-init', input: { command: `bun "${ROOT}/bin/gstack-autoplan-snapshot.ts" init "${f.source}" "${f.active}" "${f.restore}"` } }, - { ...structuredClone(f.events[1]!), toolUseId: 're-init', content: JSON.stringify({ ...f.init, reused: true }) }); + { ...(structuredClone(f.events[1]!) as any), toolUseId: 're-init', content: JSON.stringify({ ...f.init, reused: true }) }); f.reorder(); expect(f.evaluate()).toEqual({ allow: true }); }); diff --git a/test/spawned-consent-rule.test.ts b/test/spawned-consent-rule.test.ts index be1c0719c..0f55823cf 100644 --- a/test/spawned-consent-rule.test.ts +++ b/test/spawned-consent-rule.test.ts @@ -24,7 +24,7 @@ describe('#3016: spawned auto-choice never grants consent or publishes', () => { test("skill-start's spawned-session block names consent and off-machine publishing as exceptions", () => { const start = fs.readFileSync(path.join(ROOT, 'bin', 'gstack-skill-start'), 'utf8'); - const block = start.slice(start.indexOf('_emit_block spawned-session'), start.indexOf('EOI', start.indexOf('_emit_block spawned-session'))); + const block = start.slice(start.indexOf('_emit_block spawned-session'), start.indexOf('\nEOI', start.indexOf('_emit_block spawned-session'))); expect(block).toContain('never grant a consent or choose an option that publishes or syncs data off this machine'); }); });