fix(3561): fail closed when Claude version is unavailable

This commit is contained in:
Tom Boucher
2026-05-15 12:59:18 -04:00
parent fbfa4e30f3
commit f097598689
2 changed files with 8 additions and 4 deletions

View File

@@ -30,11 +30,11 @@ Check that the session is running inside Claude Code:
```bash ```bash
if [ "$CLAUDECODE" = "1" ] || [ -n "$CLAUDE_CODE_ENTRYPOINT" ]; then if [ "$CLAUDECODE" = "1" ] || [ -n "$CLAUDE_CODE_ENTRYPOINT" ]; then
CC_VERSION="$(claude --version 2>/dev/null | awk '{print $1}')" 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 if [ -n "$CC_VERSION" ] && [ "$(printf '%s\n' "2.1.91" "$CC_VERSION" | sort -V | head -n1)" = "2.1.91" ]; then
echo "" echo "claude-code:${CC_VERSION}"
else else
echo "claude-code:${CC_VERSION:-unknown}" echo ""
fi fi
else else
echo "" echo ""

View File

@@ -91,6 +91,10 @@ describe('ultraplan-phase workflow runtime gate', () => {
content.includes('CLAUDECODE') || content.includes('CLAUDE_CODE_ENTRYPOINT'), content.includes('CLAUDECODE') || content.includes('CLAUDE_CODE_ENTRYPOINT'),
'workflow must gate on Claude Code runtime marker env vars' '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', () => { test('error message references /gsd-plan-phase as local alternative', () => {