Skip to content

fix anthropic action field double-serialization - #4529

Merged
laithrw merged 3 commits into
mainfrom
fix-4510
Mar 25, 2026
Merged

laithrw merged 3 commits into
mainfrom
fix-4510

Conversation

@laithrw

@laithrw laithrw commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #4510


Summary by cubic

Fixes double-serialized action fields in Anthropic tool responses to prevent schema validation errors and failed tool calls. Preserves original tracebacks in the fallback path.

  • Bug Fixes
    • Parse nested JSON strings in tool inputs; normalize newline/carriage return/tab escapes when needed.
    • Applied in browser_use/llm/anthropic/chat.py and browser_use/llm/aws/chat_anthropic.py.

Written for commit f74a443. Summary will update on new commits.

@github-actions

github-actions Bot commented Mar 25, 2026 •

Copy link
Copy Markdown

Agent Task Evaluation Results: 2/2 (100%)

View detailed results
Task Result Reason
amazon_laptop ✅ Pass Skipped - API key not available (fork PR or missing secret)
browser_use_pip ✅ Pass Skipped - API key not available (fork PR or missing secret)

Check the evaluate-tasks job for detailed task execution logs.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="browser_use/llm/anthropic/chat.py">

<violation number="1" location="browser_use/llm/anthropic/chat.py:243">
P2: Use bare `raise` instead of `raise e` to preserve the original traceback context.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread browser_use/llm/anthropic/chat.py Resolved
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.

Bug: action field returned as JSON string instead of list when done-text contains newlines (Claude Sonnet)

1 participant