fix(3561): fail closed when Claude version is unavailable
This commit is contained in:
@@ -30,11 +30,11 @@ Check that the session is running inside Claude Code:
|
||||
|
||||
```bash
|
||||
if [ "$CLAUDECODE" = "1" ] || [ -n "$CLAUDE_CODE_ENTRYPOINT" ]; then
|
||||
CC_VERSION="$(claude --version 2>/dev/null | awk '{print $1}')"
|
||||
if [ -n "$CC_VERSION" ] && [ "$(printf '%s\n' "2.1.91" "$CC_VERSION" | sort -V | head -n1)" != "2.1.91" ]; then
|
||||
echo ""
|
||||
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 "claude-code:${CC_VERSION:-unknown}"
|
||||
echo ""
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
|
||||
@@ -91,6 +91,10 @@ describe('ultraplan-phase workflow runtime gate', () => {
|
||||
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', () => {
|
||||
|
||||
Reference in New Issue
Block a user