Skip to content

chore: bump renderers to 0.1.8.dev1 and migrate to ParsedToolCall API#1366

Open
hallerite wants to merge 2 commits into
mainfrom
chore/bump-renderers-0.1.8.dev1
Open

chore: bump renderers to 0.1.8.dev1 and migrate to ParsedToolCall API#1366
hallerite wants to merge 2 commits into
mainfrom
chore/bump-renderers-0.1.8.dev1

Conversation

@hallerite
Copy link
Copy Markdown
Member

@hallerite hallerite commented May 13, 2026

Summary

  • Bumps renderers from 0.1.8.dev00.1.8.dev1.
  • Migrates RendererClient.from_native_response to the new ParsedToolCall dataclass shape — parsed.tool_calls is now list[ParsedToolCall] (with .name / .arguments / .status / .id) instead of list[dict].
  • Filters out non-OK parse attempts (INVALID_JSON, UNCLOSED_BLOCK, MISSING_NAME, MALFORMED_STRUCTURE) so malformed tool blocks never reach the tool loop; prefers each call's native id when the format carries one (Kimi K2), falling back to call_<i> over the OK subset.

What changed upstream in renderers between 0.1.8.dev0 and 0.1.8.dev1:

Compare on the renderers repo: renderers-v0.1.8.dev0...renderers-v0.1.8.dev1.

Test plan

  • uv run pytest tests/test_renderer_client.py — 34 passed against renderers 0.1.8.dev1
  • Full suite (tests/ minus tests/test_envs.py which needs OPENAI_API_KEY) — green

hallerite and others added 2 commits May 13, 2026 17:21
The renderers 0.1.8.dev1 preview changes ``ParsedResponse.tool_calls``
from ``list[dict] | None`` to ``list[ParsedToolCall]`` (renderers PR #22)
and forwards the ``tools=`` list into ``parse_response`` so XML-style
parsers can apply schema-aware argument coercion (PR #28). It also adds
a ``LagunaXS2Renderer``, drops ``torch`` from the renderer surface in
favor of numpy, and fixes Qwen3.5 tool-response image emission.

This PR updates ``RendererClient.from_native_response`` to read the new
dataclass attributes (``tc.name`` / ``tc.arguments`` / ``tc.id`` /
``tc.status``) instead of indexing the old ``tc["function"]["name"]``
shape, and filters out non-OK parse attempts (``INVALID_JSON``,
``UNCLOSED_BLOCK``, …) so malformed blocks don't reach the tool loop.
The renderer's native tool-call id is preferred when present (Kimi K2),
falling back to the synthesized ``call_<index>`` over the OK subset.

Regression tests pin both paths: dataclass round-trip with a native id
and a mixed-status list where only the well-formed call is surfaced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Existing tests already exercise the rollout paths end-to-end; the new
shape doesn't need its own pinning test layer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4a27d0b. Configure here.

has_content = bool(response.get("content"))
# ``tool_calls`` is now ``list[ParsedToolCall]`` (renderers >=0.1.8.dev1)
# — a non-empty list with only malformed attempts still counts as the
# model having tried to call a tool, so we don't filter by status here.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Validation bypassed for effectively empty malformed-only responses

Medium Severity

raise_from_native_response uses unfiltered tool_calls to decide the response is non-empty (has_tool_calls = bool(response.get("tool_calls"))), but from_native_response then filters to only ToolCallParseStatus.OK entries. When a model emits only malformed tool calls with no content or reasoning_content, the validation gate passes, yet the resulting Response has content="" and tool_calls=None — an effectively empty response that escapes the EmptyModelResponseError check designed to catch exactly this situation.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4a27d0b. Configure here.

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.

1 participant