fix(claude_code): greptile — robust version extraction + narrow pytest.raises

- run_daily.sh: extract semver via grep -oE instead of awk '{print $1}' so
  the parsed version survives a 'claude --version' output that ever prepends
  a label (e.g. 'Claude Code vX.Y.Z'). The previous awk pattern would silently
  publish the wrong string in that case.
- _driver_unit_tests/test_basic_messaging.py: narrow pytest.raises(BaseException)
  to pytest.raises(pytest.fail.Exception). pytest.fail() raises Failed, which
  inherits from BaseException; the new bound matches what the helper raises
  without also swallowing KeyboardInterrupt/SystemExit.
This commit is contained in:
mateo-berri 2026-05-19 02:37:48 +00:00
parent be4d8ec972
commit 2ff8bc46b1
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -146,7 +146,7 @@ def test_verify_streaming_fails_when_proxy_buffers(monkeypatch):
outcome = DriverResult(text="1\n2\n3", events=_buffered_events())
_install_fake_runner(monkeypatch, outcomes_by_model={model: outcome})
with pytest.raises(BaseException):
with pytest.raises(pytest.fail.Exception):
run_basic_messaging_cell(
compat_result=fake_result,
models=[model],
@ -189,7 +189,7 @@ def test_verify_streaming_requires_all_models_to_stream(monkeypatch):
}
_install_fake_runner(monkeypatch, outcomes_by_model=outcomes)
with pytest.raises(BaseException):
with pytest.raises(pytest.fail.Exception):
run_basic_messaging_cell(
compat_result=fake_result,
models=list(outcomes.keys()),

View file

@ -163,8 +163,8 @@ LITELLM_VERSION="$(
[[ -n "${LITELLM_VERSION}" ]] || die "could not resolve latest v*-stable tag in 5 pages of releases"
log "resolved litellm: ${LITELLM_VERSION}"
CLAUDE_CODE_VERSION="$(claude --version 2>/dev/null | awk '{print $1}')"
[[ -n "${CLAUDE_CODE_VERSION}" ]] || die "could not read 'claude --version'"
CLAUDE_CODE_VERSION="$(claude --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+([.-][A-Za-z0-9.-]+)?' | head -n1)"
[[ -n "${CLAUDE_CODE_VERSION}" ]] || die "could not parse semver from 'claude --version'"
log "local claude code: ${CLAUDE_CODE_VERSION}"
# ---------------------------------------------------------------------------