Skip to content

fix: add Anthropic computer-use beta header - #13242

Merged
RogerHYang merged 2 commits into
Arize-ai:mainfrom
he-yufeng:fix/anthropic-computer-beta-header
Jun 12, 2026
Merged

RogerHYang merged 2 commits into
Arize-ai:mainfrom
he-yufeng:fix/anthropic-computer-beta-header

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

Fixes #12976.

Summary

  • detect raw Anthropic computer tool definitions such as computer_20250124 and computer_20251124
  • pass the matching anthropic-beta header for both streaming and non-streaming Anthropic message requests
  • add a regression test that keeps raw tool passthrough intact and asserts the beta header

Validation

  • uv run python -m py_compile src\phoenix\server\api\helpers\playground_clients.py tests\unit\server\api\helpers\test_playground_clients.py
  • uv run ruff check src\phoenix\server\api\helpers\playground_clients.py tests\unit\server\api\helpers\test_playground_clients.py
  • uv run pytest tests\unit\server\api\helpers\test_playground_clients.py -q (18 passed)
  • git diff --check

@he-yufeng
he-yufeng requested a review from a team as a code owner May 14, 2026 08:46
@github-project-automation github-project-automation Bot moved this to 📘 Todo in phoenix May 14, 2026
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 14, 2026
@github-actions github-actions Bot added the triage issues that need triage label May 14, 2026
@github-project-automation github-project-automation Bot moved this from 📘 Todo to 👍 Approved in phoenix May 14, 2026
@axiomofjoy
axiomofjoy enabled auto-merge (squash) May 14, 2026 14:46
@anticorrelator anticorrelator removed the triage issues that need triage label May 20, 2026
@he-yufeng

Copy link
Copy Markdown
Contributor Author

I rechecked the current red claude-review job. The actual Phoenix checks are green, including Python required, TypeScript required, Playwright required, docs, schema, unit and integration jobs.

The remaining failure is in the Claude review workflow itself: it cannot get an OIDC token (Unable to get ACTIONS_ID_TOKEN_REQUEST_URL; likely missing id-token: write). I do not see a branch-side code action for that failure.

he-yufeng and others added 2 commits June 12, 2026 12:35
Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
Move _anthropic_beta_headers_for_tools next to AnthropicStreamingClient
and add a docstring explaining the computer-use beta header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@he-yufeng
he-yufeng force-pushed the fix/anthropic-computer-beta-header branch from e10ed7a to 7542649 Compare June 12, 2026 04:41
@he-yufeng

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto current main and force-pushed the cleaned two-commit branch.

I rechecked the old red Python CI run more closely. The previous unit failures were from the May 27 merge ref in unit/server/agents/pydantic_ai/test_openinference_model_wrapper.py, not from the touched playground client helper tests. Rebasing should give this PR a fresh CI signal on the current base.

Local validation on Windows after the rebase:

python -m py_compile src\phoenix\server\api\helpers\playground_clients.py tests\unit\server\api\helpers\test_playground_clients.py
git diff --check upstream/main..HEAD

I attempted the targeted uv run ruff/pytest commands, but uv did not finish environment synchronization within the local timeout and left no test failure output. I stopped the leftover uv processes and did not change project files for the local environment issue.

@RogerHYang
RogerHYang merged commit 3d33799 into Arize-ai:main Jun 12, 2026
41 checks passed
@github-project-automation github-project-automation Bot moved this from 👍 Approved to ✅ Done in phoenix Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Anthropic computer use tool: Playground rejects computer_* tool types without beta header

3 participants