[Python] The manual Anthropic tool result flow can't mark a failed call with is_error
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Start with ToolCallData.execute and to_tool_result_message in the Anthropic integration, and the manual flow in docs/ai/integrations/anthropic.md. Compare how generate_tool_call_messages sets is_error with the manual path. The issue asks for a public API decision (return type or new argument), so confirm the approach with maintainers first. Done means a failed call can be marked is_error: true from the manual flow, with a test covering it.
Written by the indexing model from the issue text.
Description
Describe the bug
In the Anthropic integration, ToolCallData.execute returns only the tool result text. A tool result block built by hand with execute() and to_tool_result_message(), as shown in the Anthropic docs, therefore can't be marked with is_error when the function fails. After #2314 the block carries the error JSON, for example {"error": "date is in the past"}, but Anthropic's API is not told the call failed. generate_tool_call_messages sets is_error itself, so only the manual flow is affected.
To Reproduce
- Create a function whose body raises
ValueError("date is in the past"). - Follow the manual flow in
docs/ai/integrations/anthropic.md:result = tool_call.execute(client), thentool_call.to_tool_result_message(result). - The block has the error JSON as its content but no
is_error.
Expected behavior
The manual flow can mark a failed call with is_error: true, the same as generate_tool_call_messages.
System [please complete the following information]:
- OS: any (unitycatalog-ai from main)
Additional context
Raised while fixing #2314. Changing execute() to return more than a string, or adding an is_error argument to to_tool_result_message(), both change the public API, so it is left for a separate change.
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 706
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 135
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from unitycatalog/unitycatalog
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
unitycatalog/unitycatalog#2363 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
unitycatalog/unitycatalog#2280 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
unitycatalog/unitycatalog#2277 · 1 comment ·
Maintainers usually reply within 1 day
-
[CI] Submit the sbt dependency graph so Dependabot alerts cover the server's Java dependenciesPossibly taken @iam-hk claimed this 7 days ago. Openenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
unitycatalog/unitycatalog#2255 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
[Python] Timedelta parameter defaults are rendered unquoted in generated function SQLMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
unitycatalog/unitycatalog#2148 · 1 comment ·
Maintainers usually reply within 1 day
All issues in unitycatalog/unitycatalog
Similar issues
-
hermes-queue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
chrisalunlloyd2-sudo/mindpalace#430 ·
Maintainers usually reply within 1 day
-
area: editor P3 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
halisonworks/mod-codeling#290 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
area/dependencies area/dependencies/js backport/26.6 backport/26.8 kind/cve severity/medium source/scan-dependencies status/triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Igalia/wpe-android#407 ·
Maintainers usually reply within 1 day