Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions verifiers/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def resolve_client(client_or_config: Client | ClientConfig) -> Client:
return AnthropicMessagesClient(client_or_config)
case "nemorl_chat_completions":
return NeMoRLChatCompletionsClient(client_or_config)
case _:
raise ValueError(f"Unsupported client_type: {client_type!r}")
else:
raise ValueError(f"Unsupported client type: {type(client_or_config)}")

Expand Down
2 changes: 1 addition & 1 deletion verifiers/clients/openai_chat_completions_token_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def normalize_sampling_args(sampling_args: SamplingArgs):
return {k: v for k, v in sampling_args.items() if v is not None}

sampling_args = normalize_sampling_args(sampling_args)
state = cast(State, kwargs.pop("state"))
state = cast(State, kwargs.pop("state", None))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Silently accepting None state causes deferred confusing error

Medium Severity

Unlike the other clients (anthropic_messages_client, openai_responses_client) that pop state only to discard it from kwargs, this client actually uses state — accessing state["trajectory"] on lines 112, 114, and 204. Adding a None default means if state is ever missing, cast(State, None) yields None, and None["trajectory"] raises a confusing TypeError instead of the old clear KeyError: 'state'. The "consistency with other clients" rationale doesn't apply here since those clients don't use the value.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0493b0b. Configure here.

extra_headers = kwargs.pop("extra_headers", None)
# Use standard /chat/completions for: (1) first turn (no prior tokens
# to stitch), or (2) conversations that contain multimodal content in
Expand Down