Clean routed experts response path#1433
Draft
S1ro1 wants to merge 1 commit into
Draft
Conversation
| ToolCall( | ||
| id=tc.id or f"call_{i}", | ||
| name=tc.name or "", | ||
| id=f"call_{i}", |
There was a problem hiding this comment.
🟡 Medium clients/renderer_client.py:741
The tool call ID assignment in from_native_response unconditionally overwrites the original id with f"call_{i}", discarding any ID provided by the model. If downstream code matches tool results to calls using the original ID, this breaks correlation.
- id=f\"call_{i}\",\n+ id=tc.get(\"id\") or f\"call_{i}\",🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file verifiers/clients/renderer_client.py around line 741:
The tool call ID assignment in `from_native_response` unconditionally overwrites the original `id` with `f"call_{i}"`, discarding any ID provided by the model. If downstream code matches tool results to calls using the original ID, this breaks correlation.
Evidence trail:
renderers/base.py lines 496-502 (ParsedToolCall dataclass with `id` field), renderers/parsing.py lines 1111-1119 (Kimi K2 sets `id=raw_id or None`), verifiers/clients/renderer_client.py line 531 (`"tool_calls": parsed.tool_calls`), verifiers/clients/renderer_client.py lines 739-750 (`id=f"call_{i}"` unconditionally overwrites), verifiers/envs/tool_env.py lines 152-163 (downstream uses `tool_call.id` for correlation)
Contributor
Author
|
Closing this cleanup PR. The renderer-side fix is in renderers PR #54, so verifiers should stay on the normal renderers.client.generate path; prime-rl now pins renderers to that merged commit instead. |
Contributor
Author
|
Reopening while we validate the renderers-only path against the routed-experts run. Do not merge or close yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
Note
Normalize routed experts data in response parsing across client types
parse_routed_expertsinresponse_utils.pyto validate and normalize rawrouted_expertsdicts into a consistentRoutedExpertsPayloadstructure with typeddataand integershapefields.parse_routed_expertsinfrom_native_responseforOpenAIChatCompletionsClient,OpenAICompletionsClient, andRendererClientsoResponseTokens.routed_expertsalways holds a parsed structure instead of rawmodel_extravalues._generate_with_renderertoRendererClientas a new end-to-end generation path that handles renderer pool checkout, stop tokens, endpoint posting, and response parsing includingrouted_expertsand tool calls.RoutedExpertsPayload.datafromAnytostr | bytes | bytearray | memoryviewand enablesarbitrary_types_allowedonCustomBaseModel.📊 Macroscope summarized 28b092a. 5 files reviewed, 2 issues evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues