Skip to content

fix: reject empty polling plugin state#342

Merged
fatelei merged 2 commits into
mainfrom
fix/reject-empty-polling-plugin-state
May 23, 2026
Merged

fix: reject empty polling plugin state#342
fatelei merged 2 commits into
mainfrom
fix/reject-empty-polling-plugin-state

Conversation

@WH-2099
Copy link
Copy Markdown
Member

@WH-2099 WH-2099 commented May 22, 2026

Summary

  • Require ModelCheckPollingRequest.plugin_state to contain at least one item.
  • Treat empty plugin_state as invalid for running LLM polling results.
  • Add tests for empty request and result state payloads.

Root cause

The existing validation only rejected a missing state payload. Empty mappings could pass even though polling cannot resume with no stored state.

Validation

  • uv run pytest tests/test_model_polling.py
  • just check

Closes #341

@WH-2099 WH-2099 self-assigned this May 22, 2026
@WH-2099 WH-2099 marked this pull request as ready for review May 22, 2026 17:42
Copy link
Copy Markdown
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 enforces a minimum length for the plugin_state field in polling requests and updates the validation logic in LLMPollingResult to reject empty states. Corresponding tests were added to verify these constraints. The reviewer correctly pointed out that since these are Pydantic models, the tests should catch pydantic.ValidationError instead of ValueError to align with Pydantic v2 behavior.

Comment thread tests/test_model_polling.py Outdated
Comment thread tests/test_model_polling.py Outdated
fatelei
fatelei previously approved these changes May 23, 2026
@fatelei fatelei merged commit f56d48b into main May 23, 2026
4 checks passed
@fatelei fatelei deleted the fix/reject-empty-polling-plugin-state branch May 23, 2026 08:15
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.

Reject empty polling plugin state

2 participants