plexus.cli.procedure.tactus_adapters.hitl module
Plexus HITL Adapter for Tactus.
Implements the Tactus HITLHandler protocol using Plexus’s exit-and-resume pattern. Creates HITL messages via GraphQL and raises ProcedureWaitingForHuman to pause execution.
- class plexus.cli.procedure.tactus_adapters.hitl.PlexusHITLAdapter(client, procedure_id: str, chat_recorder=None, storage_adapter=None)
Bases:
objectImplements Tactus HITLHandler protocol using Plexus’s exit-and-resume pattern.
When a HITL interaction is requested: 1. Creates a message in the chat session 2. Updates procedure status to WAITING_FOR_HUMAN 3. Raises ProcedureWaitingForHuman to exit runtime 4. On resume, checks for response and returns it
Initialize Plexus HITL adapter.
- Args:
client: PlexusDashboardClient instance procedure_id: ID of the procedure chat_recorder: Optional ProcedureChatRecorder for message creation storage_adapter: Optional PlexusStorageAdapter for status updates
- __init__(client, procedure_id: str, chat_recorder=None, storage_adapter=None)
Initialize Plexus HITL adapter.
- Args:
client: PlexusDashboardClient instance procedure_id: ID of the procedure chat_recorder: Optional ProcedureChatRecorder for message creation storage_adapter: Optional PlexusStorageAdapter for status updates
- cancel_pending_request(procedure_id: str, message_id: str) None
Cancel a pending HITL request.
- Args:
procedure_id: Procedure ID message_id: Message ID to cancel
- check_pending_response(procedure_id: str, message_id: str) HITLResponse | None
Check if there’s a response to a pending HITL request.
- Args:
procedure_id: Procedure ID message_id: Message ID to check
- Returns:
HITLResponse if response exists, None otherwise
- request_interaction(procedure_id: str, request: HITLRequest) HITLResponse
Request human interaction using Plexus’s exit-and-resume pattern.
This creates a HITL message in the chat session, updates the procedure status, and raises ProcedureWaitingForHuman to pause execution.
- Args:
procedure_id: Procedure ID request: HITLRequest with interaction details
- Returns:
HITLResponse (only reached if response already exists on resume)
- Raises:
ProcedureWaitingForHuman: To trigger exit-and-resume