-
Notifications
You must be signed in to change notification settings - Fork 20
feat: enable evaluators after resume by using consistent thread_id and Command API #1132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
c00a487 to
540ed7a
Compare
- Use eval_item.id as runtime_id to maintain consistent thread_id across suspend/resume - Pass UiPathExecuteOptions(resume=True) when in resume mode - Add logging to track resume mode execution This ensures: 1. Checkpoints can be found when resuming (same thread_id) 2. Framework-agnostic approach (uses runtime options, not LangGraph Command) 3. Resume handling is delegated to runtime layer where framework-specific logic belongs
540ed7a to
e905c9c
Compare
| # Create a new runtime with runtime_id for this eval execution. | ||
| # Use eval_item.id to maintain consistent thread_id across suspend and resume. | ||
| # This ensures checkpoints can be found when resuming from suspended state. | ||
| runtime_id = eval_item.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think someone changed this for a reason I can't remember. @akshaylive or @radu-mocanu do you guys remember why we no longer use eval_item.id as the runtime_id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They made it so there was no conflict in the runtime when multiple evals were started the runtime collided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to fix the LangGraph aspect too. Is there a better way @cristipufu it is not resume properly for me without this change as the mapping won't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I remember the concern was regarding running multiple eval runtimes in parallel targeting the same evaluation set. there would be collisions since eval_item.id is static
During resume, the eval runtime should pass None as input instead of
inputs_with_overrides. This allows the UiPathResumableRuntime wrapper to:
1. Fetch triggers from storage
2. Read resume data via trigger_manager.read_trigger()
3. Build resume map: {interrupt_id: resume_data}
4. Pass this map to the delegate runtime
The wrapper's _restore_resume_input() method handles the resume data
restoration automatically when input is None. Passing the original input
would skip this mechanism and cause the resume to fail.
This completes the fix for evaluator execution after resume, working in
conjunction with the langchain runtime's Command(resume=...) wrapper.
Summary
Enables evaluators to execute and produce scores after agent resumes from suspended state.
Changes
Consistent thread_id for suspend/resume
Command API integration
Enhanced logging
Testing
Tested with suspend/resume evaluation samples in uipath-langchain-python:
Built on top of
🤖 Generated with Claude Code