Merge pull request #3563 from gsd-build/fix/3561-gsd-ultraplan-phase-runtime-gate-checks-

fix: use Claude Code runtime markers in ultraplan gate
This commit is contained in:
Tom Boucher
2026-05-15 15:03:14 -04:00
committed by GitHub
3 changed files with 24 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
---
type: Fixed
pr: 3563
---
**Ultraplan runtime gate now detects Claude Code correctly** - runtime gating no longer relies on `CLAUDE_CODE_VERSION`; it uses Claude Code marker env vars and preserves the minimum supported version floor. Fixes #3561.

View File

@@ -29,7 +29,16 @@ Use /gsd:plan-phase for stable local planning.
Check that the session is running inside Claude Code:
```bash
echo "$CLAUDE_CODE_VERSION"
if [ "$CLAUDECODE" = "1" ] || [ -n "$CLAUDE_CODE_ENTRYPOINT" ]; then
CC_VERSION="$(claude --version 2>/dev/null | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -n1)"
if [ -n "$CC_VERSION" ] && [ "$(printf '%s\n' "2.1.91" "$CC_VERSION" | sort -V | head -n1)" = "2.1.91" ]; then
echo "claude-code:${CC_VERSION}"
else
echo ""
fi
else
echo ""
fi
```
If the output is empty or unset, display the following error and exit:

View File

@@ -86,8 +86,15 @@ describe('ultraplan-phase workflow beta marker', () => {
describe('ultraplan-phase workflow runtime gate', () => {
const content = fs.readFileSync(WF_PATH, 'utf-8');
test('checks CLAUDE_CODE_VERSION to detect Claude Code runtime', () => {
assert.ok(content.includes('CLAUDE_CODE_VERSION'), 'workflow must gate on CLAUDE_CODE_VERSION env var');
test('checks Claude Code runtime markers instead of version env var', () => {
assert.ok(
content.includes('CLAUDECODE') || content.includes('CLAUDE_CODE_ENTRYPOINT'),
'workflow must gate on Claude Code runtime marker env vars'
);
assert.ok(
!content.includes('CLAUDE_CODE_VERSION'),
'workflow must not gate on CLAUDE_CODE_VERSION'
);
});
test('error message references /gsd-plan-phase as local alternative', () => {