Skip to content

test: cover tool-call response formatting in CI (non-pricy) - #33

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789677972-tool-call-format-tests
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789677972-tool-call-format-tests

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Closes the code-scan gap where handle_tool_call / add_responded_tool_calls — the multi-turn tool-use wire formatting for all three providers — was only exercised by @pytest.mark.pricy tests that CI (pytest -m 'not pricy') never runs.

Adds 13 non-pricy unit tests in tests/llm/test_response_api.py that build a ToolCalls from mocked raw calls (mirroring what each _parse_tool_calls produces) and assert the exact dicts each builder emits:

  • OpenAIResponseAPIMessageBuilder: function_call → {"type": "function_call_output", "call_id", "output": <str>}; computer_call → {"type": "computer_call_output", "call_id", "output": {"type": "input_image", "image_url"}}; raw response output items are preserved ahead of the responses, including the multi-call ordering case.
  • AnthropicAPIMessageBuilder: assistant tool_use block followed by a user message whose content is a list of {"type": "tool_result", "tool_use_id", "content": <str>}.
  • OpenAIChatCompletionAPIMessageBuilder: raw assistant message followed by {"name", "role": "tool", "tool_call_id", "content"}.

Also covers the guard rails that previously had no CI assertion: image response in a function call, text response in a computer call, all_responses_set False in add_responded_tool_calls, and prepare_message() on a "tool" builder with no responded_tool_calls (raises ValueError).

No production code changed.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/8d237cdb781b415ead9ebef85e7b15ae
Open in Devin Desktop: https://app.devin.ai/desktop/session/8d237cdb781b415ead9ebef85e7b15ae?variant=devin

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

0 participants