Skip to content

Conversation

@radu-mocanu
Copy link
Collaborator

  • add escalation tool

@radu-mocanu radu-mocanu self-assigned this Dec 3, 2025
output_schema = response_schema or END_EXECUTION_TOOL.args_schema
validated = output_schema.model_validate(args)
return validated.model_dump()
return _handle_end_execution(tool_call["args"], response_schema)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we make these into tools instead? That way, the LLM gets the tool definitions without additional change.

Copy link
Collaborator Author

@radu-mocanu radu-mocanu Dec 4, 2025

Choose a reason for hiding this comment

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

I think it might be better to leave the terminate node as a 'special' tool for separation of concerns.
image

from pydantic import BaseModel, Field


class AgentTerminationSource(StrEnum):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need more information here. AFAIK escalations states are submit and reject. IMO the model should be the one deciding to terminate. Otherwise, any potential cleanup may get skipped.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is the way low code currently works. without this we won t be able to reach parity

else None
)
if outcome and outcome == EscalationAction.END:
return Command(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This feels like an anti-pattern. Tools should ideally not be aware of state.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same as above. the escalations can be configured to terminate the execution on reject

Copy link
Collaborator

Choose a reason for hiding this comment

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

In that case, can we port over this logic to ToolNode?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is already being converted to a ToolNode

return {tool.name: ToolNode([tool], handle_tool_errors=False) for tool in tools}

)
output_model: type[BaseModel] = jsonschema_to_pydantic(channel.output_schema)

# only works for UserEmail type as value is GUID for UserId or GroupId for other types
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

3 participants