Skip to content

Bump inspect_ai to >=0.3.249 (Anthropic bridge system-role fix)#30

Merged
robe-ai2 merged 1 commit into
mainfrom
bump-inspect-ai-system-role-bridge-fix
Jul 23, 2026
Merged

Bump inspect_ai to >=0.3.249 (Anthropic bridge system-role fix)#30
robe-ai2 merged 1 commit into
mainfrom
bump-inspect-ai-system-role-bridge-fix

Conversation

@gas2own

@gas2own gas2own commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What

Bump the inspect_ai floor (and the astabench override) in solvers/inspect-swe/pyproject.toml from >=0.3.220 to >=0.3.249, and regenerate the frozen uv.lock (inspect-ai 0.3.220 → 0.3.249, inspect-swe 0.2.54 → 0.2.66).

Why

The sandboxed claude_code agent proxies its Anthropic API calls back through inspect's model bridge (generate_anthropic). In inspect_ai 0.3.220, messages_from_anthropic_input (src/inspect_ai/agent/_bridge/anthropic_api_impl.py) only handled user/assistant roles and raised on anything else:

RuntimeError: Unexpected message role: system

Current Claude Code emits a system-role entry inside messages[], so every arm was interrupted mid-sample before any sample completed — no .reductions, no scores. inspect_ai 0.3.249 adds an explicit elif param["role"] == "system" branch that folds the content into a ChatMessageSystem (anthropic_api_impl.py:454-456), which resolves the crash.

uv run --frozen is used downstream (gas2own's asta-eval jobrunner), so bumping pyproject.toml alone would not take effect — the lock is regenerated in this PR.

Context

Surfaced by the gas2own asta improve-skills eval runner (allenai/gas2own#346); the runner now fails loudly quoting the arm's own error, which is how this upstream cause was pinned.

🤖 Generated with Claude Code

The sandboxed claude_code agent (inspect_swe) proxies its Anthropic API
calls back through inspect's model bridge via `generate_anthropic`.
inspect_ai 0.3.220's `messages_from_anthropic_input`
(agent/_bridge/anthropic_api_impl.py) only handled `user`/`assistant`
message roles and raised `RuntimeError: Unexpected message role: system`
on anything else. Current Claude Code emits a system-role entry in
`messages[]`, so every arm was interrupted mid-sample before any sample
completed.

inspect_ai 0.3.249 adds an explicit `elif param["role"] == "system"`
branch that folds the content into a `ChatMessageSystem`
(anthropic_api_impl.py:454-456), fixing the crash. Bump the floor and the
astabench override to >=0.3.249 and regenerate the frozen lock (uv run
--frozen is used downstream, so pyproject alone would not take effect).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@robe-ai2
robe-ai2 requested a review from jbragg July 23, 2026 17:14
@robe-ai2

Copy link
Copy Markdown
Contributor

@jbragg https://github.com/allenai/gas2own/issues/346 uncovered this one, but i'm gonna need your review to see if this is legit

@jbragg jbragg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't investigate the truth of the claim but bumping seems fine to me

@robe-ai2
robe-ai2 merged commit 1bc24c0 into main Jul 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants