Skip to content

Conversation

@alecsolder
Copy link
Contributor

@alecsolder alecsolder commented Nov 14, 2025

Purpose

Fix for issue introduced in 28075

The reasoning parser validation introduced on the structured_outputs_config argument is done very early and does not allow for other programmatic methods for registering reasoning parsers.

By only allowing registration of external reasoning parsers via reasoning-parser-plugin it would require bundling of extra python files when deploying vLLM, which is not an ideal experience.

Test Plan

External registration of plugins with ReasoningParserManager

Test Result

External registration of plugins with ReasoningParserManager works like before

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly relaxes a validation check for reasoning_parser by changing a ValueError to a logger.warning. This allows for programmatic registration of reasoning parsers after the initial configuration, which was the intended goal. The change is well-contained and addresses the issue described. I have one suggestion to improve the clarity of the new warning message to avoid potential confusion for users.

Comment on lines 81 to 83
"Reasoning parser %s not defined in reasoning_parser_plugin "
"argument. Assuming it is registered to the "
"ReasoningParserManager programmatically.",
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current warning message is slightly misleading. It suggests the issue is with reasoning_parser_plugin, but the validation checks against all registered parsers, including built-in ones. This could confuse users who are not using a plugin but have, for example, misspelled a built-in parser name. A more general warning message would be clearer and help prevent user confusion during debugging.

Suggested change
"Reasoning parser %s not defined in reasoning_parser_plugin "
"argument. Assuming it is registered to the "
"ReasoningParserManager programmatically.",
"Reasoning parser %s not found among registered parsers. "
"Assuming it will be registered programmatically later.",

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the comment valid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can make it more clear

@Jialin
Copy link
Collaborator

Jialin commented Nov 17, 2025

The reasoning parser validation introduced on the structured_outputs_config argument is done very early and does not allow for other programmatic methods for registering reasoning parsers.

Instead of reduce the validation from error to warning, should we delay the validation logic instead?

f"invalid reasoning parser: {self.reasoning_parser} "
f"(chose from {{ {','.join(valid_reasoning_parsers)} }})"
logger.warning(
"Reasoning parser %s not defined in reasoning_parser_plugin "
Copy link
Collaborator

Choose a reason for hiding this comment

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

i don't think we should directly assume it exists? should we explicitly skip the check for reasoning parser plugin? any way for us to directly make valid_reasoning_parsers aware of plugin registration?

@alecsolder
Copy link
Contributor Author

@Jialin @yeqcharlotte There is already a check when creating the api server, the early check here is an additional one. There is an additional problem that #28075 causes reasoning parsers to be registered twice, so this PR is just a fast-fix to un-break directly registered reasoning parsers.

@Jialin
Copy link
Collaborator

Jialin commented Nov 17, 2025

@Jialin @yeqcharlotte There is already a check when creating the api server, the early check here is an additional one. There is an additional problem that #28075 causes reasoning parsers to be registered twice, so this PR is just a fast-fix to un-break directly registered reasoning parsers.

IC. If that's case, how about just get rid of the validation here?

@alecsolder
Copy link
Contributor Author

@Jialin @yeqcharlotte There is already a check when creating the api server, the early check here is an additional one. There is an additional problem that #28075 causes reasoning parsers to be registered twice, so this PR is just a fast-fix to un-break directly registered reasoning parsers.

IC. If that's case, how about just get rid of the validation here?

I think a warning is reasonable to help the vast majority of use cases, getting an early warning signal about a reasoning parser needing to be directly registered could definitely be useful IMO

@yeqcharlotte
Copy link
Collaborator

There is an additional problem that #28075 causes reasoning parsers to be registered twice, so this PR is just a fast-fix to un-break directly registered reasoning parsers.

why would the reasoning parsers get registered twice? can that be fixed?

@alecsolder
Copy link
Contributor Author

@walterbm Does it make sense to remove the registration + validation from here and instead have it be in StructuredOutputManager? It seems we're doing it in quite a few places now

@walterbm
Copy link
Contributor

walterbm commented Nov 22, 2025

@walterbm Does it make sense to remove the registration + validation from here and instead have it be in StructuredOutputManager? It seems we're doing it in quite a few places now

yeah that makes sense to me. helps reduce some of the duplication around validation

@mergify
Copy link

mergify bot commented Nov 29, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @alecsolder.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Nov 29, 2025
Alec Solder added 4 commits December 1, 2025 07:48
Signed-off-by: Alec Solder <alecs@fb.com>
Signed-off-by: Alec Solder <alecs@fb.com>
…e as it occurs elsewhere

Signed-off-by: Alec Solder <alecs@fb.com>
Signed-off-by: Alec Solder <alecs@fb.com>
@alecsolder alecsolder force-pushed the remove-early-reasoning-parser-validation branch from 0a6ed23 to 0c744dd Compare December 1, 2025 15:49
@mergify mergify bot removed the needs-rebase label Dec 1, 2025
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.

4 participants