Skip to content

fix(orchestrator): handle exceptions in _promise_action and flush_promises#2432

Open
Wanbogang wants to merge 1 commit intoOpenMind:mainfrom
Wanbogang:fix/promise-action-exception-handling
Open

fix(orchestrator): handle exceptions in _promise_action and flush_promises#2432
Wanbogang wants to merge 1 commit intoOpenMind:mainfrom
Wanbogang:fix/promise-action-exception-handling

Conversation

@Wanbogang
Copy link
Collaborator

Problem

Two silent failure points existed in ActionOrchestrator:

  1. _promise_action() had no exception handling around input_type(**converted_params) and connector.connect(). Any crash here — invalid enum value from LLM, missing required parameter, or hardware/network failure — would be swallowed silently by asyncio.wait() in flush_promises().

  2. flush_promises() never retrieved exceptions from completed tasks. Since asyncio.wait() does not re-raise task exceptions, failures disappeared entirely with no log output and no trace.

Fix

  • Wrap input_type(**converted_params) in try/except with logging.exception() — handles invalid LLM output such as unknown enum values or missing required fields
  • Wrap connector.connect() in try/except with logging.exception() — handles hardware disconnect, network timeout, or any runtime failure in the connector
  • Add exception retrieval loop in flush_promises() so failed tasks are logged before being discarded

…h_promises

- Wrap input_type() construction in try/except to handle invalid enum
  values or missing parameters from LLM output
- Wrap connector.connect() in try/except to handle hardware/network failures
- Retrieve and log exceptions from completed tasks in flush_promises()
- Add TestActionOrchestratorExceptionHandling with 4 tests covering:
  connector crash, invalid enum value, partial failure, and missing
  required parameter scenarios
@Wanbogang Wanbogang requested review from a team as code owners February 28, 2026 12:02
@github-actions github-actions bot added robotics Robotics code changes python Python code tests Test files labels Feb 28, 2026
@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code robotics Robotics code changes tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant