Skip to content

Conversation

Dhruvkumar-Microsoft
Copy link
Contributor

Purpose

This pull request introduces a robust event-driven notification and timeout system for handling human approvals and clarifications in the orchestration workflow. The changes replace previous polling mechanisms with asyncio events, add timeout handling and user notifications via WebSocket, and ensure proper resource cleanup and error handling throughout the approval and clarification processes.

Event-driven approval and clarification system:

  • Added event-driven mechanisms for approvals and clarifications in settings.py, including methods to set pending states, wait for results with timeouts, and clean up resources. These changes replace prior polling approaches and improve reliability and scalability.
  • Updated API endpoints in router.py to use the new event-driven methods for setting approval and clarification results, ensuring consistent state management. [1] [2]

Timeout notification and error handling:

  • Introduced a new TimeoutNotification dataclass and corresponding WebSocket message type for notifying users when approval or clarification requests time out. This ensures users are informed of delays and can retry actions as needed. [1] [2]
  • Refactored waiting logic in proxy_agent.py and human_approval_manager.py to use event-driven waiting with timeout, cancellation, and error handling. On timeout, users receive a notification and resources are cleaned up to prevent leaks. [1] [2]

Logging and diagnostics:

  • Enhanced logging throughout the agent and orchestration code to provide better diagnostics for timeouts, cancellations, and unexpected errors, aiding in debugging and monitoring. [1] [2] [3] [4] [5]

These improvements make the approval and clarification flows more reliable, responsive, and user-friendly, and lay a foundation for future scalability and maintainability.

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

@Roopan-Microsoft Roopan-Microsoft merged commit c140b0b into dev-v3 Oct 16, 2025
4 checks passed
@Roopan-Microsoft Roopan-Microsoft deleted the psl-us-23031-dk branch October 16, 2025 10:18
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.

2 participants