Skip to content

Fix ToolResponse content being stringified when tc_res is None#116

Merged
jph00 merged 1 commit intomainfrom
fix/115-tool-response-str
Feb 13, 2026
Merged

Fix ToolResponse content being stringified when tc_res is None#116
jph00 merged 1 commit intomainfrom
fix/115-tool-response-str

Conversation

@KeremTurgutlu
Copy link
Contributor

Fixes #115

Problem: When a tool returns a ToolResponse with image content (e.g. capture_tool), the content list was being stringified via str(res) instead of passed through as proper content blocks. This happened because _prep_tool_res was gated on tc_res is not None, and solveit doesn't enable tc_refs.

The AI received "[{'type': 'image_url', 'image_url': 'data:image/png;base64,...'}]" as text instead of an actual image.

Changes:

  • Extracted _mk_tool_result helper from _lite_call_func / _alite_call_func — handles ToolResponse unwrapping, tc_res storage, and content formatting in one place
  • ToolResponse content is now passed through as a list regardless of tc_res; other results are still stringified
  • Simplified both _lite_call_func and _alite_call_func to just arg validation + function call, delegating to _mk_tool_result
  • Added tests

@gitnotebooks
Copy link

gitnotebooks bot commented Feb 12, 2026

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/AnswerDotAI/lisette/pull/116

@KeremTurgutlu KeremTurgutlu requested a review from jph00 February 12, 2026 15:56
@jph00 jph00 added the bug Something isn't working label Feb 13, 2026
@jph00 jph00 merged commit 86a1aa5 into main Feb 13, 2026
1 check passed
@jph00
Copy link
Contributor

jph00 commented Feb 13, 2026

Thanks for the fix @KeremTurgutlu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolResponse content stringified instead of passed through as image blocks when tc_res is None

2 participants