Skip to content

fix(agents): wait for terminal status after stream completion - #187

Open
Apeksha9389 wants to merge 1 commit into
conductor-oss:mainfrom
Apeksha9389:fix/wait-for-terminal-agent-result
Open

Apeksha9389 wants to merge 1 commit into
conductor-oss:mainfrom
Apeksha9389:fix/wait-for-terminal-agent-result

Conversation

@Apeksha9389

@Apeksha9389 Apeksha9389 commented Oct 17, 2026 •

Copy link
Copy Markdown

When the SSE stream closes before the workflow reaches its terminal state, getResult() reads status only once and can return RUNNING. It now polls every 500 ms for up to 15 seconds, uses the terminal status and output, and throws a ConductorAgentError if an observed non-terminal execution does not settle. Transient status-read failures retain the last observed status. The existing event-based fallback remains when no status can be read.

Fixes #155.

Validation:

  • Reproduced the status race and missing timeout with failing tests before the fix.
  • All 1,590 unit tests pass, including delayed failure, transient status-read failure, final output selection, and timeout coverage.
  • Full ESLint: 0 errors (360 existing warnings); changed files: clean.
  • Full TypeScript check has 411 diagnostic lines, byte-identical to unchanged main at 14ae284 in a separate checkout using the same dependencies.
  • git diff --check passes.
  • Full tsup build passed, including declarations. verify-dist.mjs verified all 6 entrypoints in ESM and CJS.

Trade-off: a streamed execution that remains non-terminal adds up to 15 seconds of status settling. No public signatures or package versions change. Live Conductor examples require a configured server and credentials and were not run.

AI-assisted implementation and tests.

@Apeksha9389
Apeksha9389 marked this pull request as ready for review October 17, 2026 12:31
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.

AgentRuntime.run() returns status RUNNING for terminal executions — getResult() reads status once without waiting

1 participant