feat(escalation): return task_id and assigned_to from escalation tool#517
Open
saksharthakkar wants to merge 5 commits intomainfrom
Open
feat(escalation): return task_id and assigned_to from escalation tool#517saksharthakkar wants to merge 5 commits intomainfrom
saksharthakkar wants to merge 5 commits intomainfrom
Conversation
9fc49e4 to
2fb80b7
Compare
- Add _get_user_email helper to extract emailAddress from user object/dict - Extract task_id and assigned_to from escalation result for instrumentor - Return interrupt() result to capture Task object - Rename escalation_action to outcome for consistency - Store call_id and call_args in tool metadata
interrupt() always returns Task object for escalations, not dict. Remove dead dict branch and defensive fallbacks. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove dead code - output is always a dict from escalation_tool_fn. model_dump() and isinstance checks were unnecessary. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4d67a75 to
4e34462
Compare
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
akshaylive
reviewed
Feb 5, 2026
Collaborator
akshaylive
left a comment
There was a problem hiding this comment.
Mostly looks good. Please test it in a simulation context as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Frontend needs
task_idfor constructing task URLs in traces:Also need
assigned_tofor instrumentation/debugging purposes.Summary
task_idandassigned_tofrom escalation tool for instrumentationWhy the simplification?
interrupt()always returns aTaskobject for escalations, never a dict. TheTypeAdapter.validate_python()path was dead code - Task is already a validated Pydantic model from the SDK.Removed in
escalation_tool_fn:if isinstance(result, dict):branch - never trueTypeAdapter.validate_python()call - unnecessary validationor result.get("key"),or result.get("assignedToUser"))Simplified in
escalation_wrapper:model_dump()check - output is always a dictisinstance(output, dict)check - dead codeTest plan