[PR #6532] feat(langgraph): add input schema validation for interrupt resume values #5106

Closed
opened 2026-02-20 17:51:14 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/6532

State: closed
Merged: No


Description:

This PR adds support for validating resume values against a schema when using interrupt(). Users can now specify an input_schema parameter that enforces the format of resume values, enabling type-safe human-in-the-loop workflows.

Key Changes:

  • Added input_schema parameter to Interrupt class and interrupt() function
  • Implemented _validate_resume_value() helper for schema validation
  • Support for multiple schema types:
    • Pydantic BaseModel classes
    • Python dataclasses
    • Dict schemas (JSON schema format)
  • When a resume value doesn't match the provided schema, the interrupt is re-raised for proper error handling
  • Comprehensive unit tests covering all schema types and edge cases
  • Applied formatting and linting fixes

Behavior:

  • If a resume map is provided and the response format does not match InputSchema, re-raise the interrupt
  • If a null resume is provided and there is one pending interrupt, and the response format does not match, re-raise the interrupt
  • If the response format does match InputSchema, resume the interrupt
  • Backward compatible - works without schema parameter (existing behavior)

Thanks to @kushalgarg101 for proposing this feature and providing valuable feedback on the implementation approach.

Issue: Closes #6531

Dependencies: None

Twitter handle: 0xaaryan

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6532 **State:** closed **Merged:** No --- **Description:** This PR adds support for validating resume values against a schema when using `interrupt()`. Users can now specify an `input_schema` parameter that enforces the format of resume values, enabling type-safe human-in-the-loop workflows. **Key Changes:** - Added `input_schema` parameter to `Interrupt` class and `interrupt()` function - Implemented `_validate_resume_value()` helper for schema validation - Support for multiple schema types: - Pydantic BaseModel classes - Python dataclasses - Dict schemas (JSON schema format) - When a resume value doesn't match the provided schema, the interrupt is re-raised for proper error handling - Comprehensive unit tests covering all schema types and edge cases - Applied formatting and linting fixes **Behavior:** - If a resume map is provided and the response format does not match InputSchema, re-raise the interrupt - If a null resume is provided and there is one pending interrupt, and the response format does not match, re-raise the interrupt - If the response format does match InputSchema, resume the interrupt - Backward compatible - works without schema parameter (existing behavior) Thanks to @kushalgarg101 for proposing this feature and providing valuable feedback on the implementation approach. **Issue:** Closes #6531 **Dependencies:** None **Twitter handle:** 0xaaryan
yindo added the pull-request label 2026-02-20 17:51:14 -05:00
yindo closed this issue 2026-02-20 17:51:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#5106