Unattended /autoplan on Claude Code says its phase guard is on, and a report hidden in reasoning gets a clear fix (GST-3062) (#4481)

An unattended /autoplan run on Claude Code now says its phase guard is
on, instead of saying it is off while the guard blocks it. A phase
report written only in reasoning now gets a denial that says so and
names the exact command to send.

Why: in the day-one eval, two runs were blocked by a guard their own
record called off, and one run ended blocked after four publish attempts
whose report was invisible.

Nothing to do.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-18 08:47:07 +00:00
1 parent f87d4325a3
commit 44170d6791
19 files changed
+244 -34

No files matched your search

+17
View File
@@ -24,6 +24,7 @@ import * as path from 'path';
import { generatePreamble } from '../scripts/resolvers/preamble';
import { HOST_PATHS, type TemplateContext } from '../scripts/resolvers/types';
import { expectAbsent, expectMentions } from './helpers/prompt-structure';
import { GUARD_ENFORCED_LINE, GUARD_NOT_INSTALLED_LINE, autoplanGuardLine } from '../lib/autoplan-guard-status';
const ROOT = path.resolve(import.meta.dir, '..');
const START = path.join(ROOT, 'bin', 'gstack-skill-start');
@@ -388,6 +389,22 @@ describe('gstack-skill-start behavior', () => {
}
});
// GST-3062 (GEVA-549): an unattended Claude Code run printed GUARD_NOT_INSTALLED while autoplan's
// PreToolUse hook denied its phase Reads. The line follows the host and the installed skill, not the session kind.
test('the autoplan guard line says enforced whenever Claude Code runs the declared hook, unattended included', () => {
const line = (env: Record<string, string>) => (runStart(['--skill', 'autoplan'], env).match(/^autoplan guard: .*$/gm) ?? []);
const unattendedClaude = line({ CLAUDECODE: '1', GSTACK_SESSION_KIND: 'unattended' });
expect(unattendedClaude).toEqual([GUARD_ENFORCED_LINE]);
expect(unattendedClaude.join('\n')).not.toContain('GUARD_NOT_INSTALLED');
const matrix: Record<string, string>[] = [
{ CLAUDECODE: '1' }, { CLAUDECODE: '1', GSTACK_ACTIVE_HOST: 'claude' },
{ CLAUDECODE: '1', GSTACK_ACTIVE_HOST: 'codex' }, { GSTACK_SESSION_KIND: 'unattended' }, {},
];
for (const env of matrix) expect({ env, line: line(env) }).toEqual({ env, line: [autoplanGuardLine(env, ROOT)] });
expect(line({ CLAUDECODE: '1', GSTACK_ACTIVE_HOST: 'codex', GSTACK_SESSION_KIND: 'unattended' })).toEqual([GUARD_NOT_INSTALLED_LINE]);
expect(runStart(['--skill', 'review'], { CLAUDECODE: '1' })).not.toContain('autoplan guard:');
});
test('unattended block promises GSTACK_RESULT only to skills that write it; the rest name their record (#3281)', () => {
const block = (skill: string) => {
const out = runStart(['--skill', skill], { GSTACK_SESSION_KIND: 'unattended' });