Skip to content

fix: propagate error events in AgentRunner.run()#103

Merged
JackChen-me merged 1 commit intomainfrom
fix/issue-98-run-error-propagation
Apr 12, 2026
Merged

fix: propagate error events in AgentRunner.run()#103
JackChen-me merged 1 commit intomainfrom
fix/issue-98-run-error-propagation

Conversation

@JackChen-me
Copy link
Copy Markdown
Owner

Summary

  • AgentRunner.run() only handled 'done' events from stream(), silently dropping 'error' events. Failed LLM calls returned an empty RunResult that Agent.executeRun() treated as success: true.
  • Now run() re-throws the error, which executeRun() catches and converts to success: false with the error message in output.

Closes #98

Test plan

  • New tests/runner-error-propagation.test.ts covering 3 scenarios:
    • LLM adapter error surfaces as success: false in AgentRunResult
    • AgentRunner.run() throws when adapter errors
    • Agent transitions to error state on LLM failure
  • Full test suite passes (528 tests)

run() only handled 'done' events from stream(), silently dropping
'error' events. This caused failed LLM calls to return an empty
RunResult that the caller treated as successful.
@JackChen-me JackChen-me merged commit 97c5e45 into main Apr 12, 2026
3 checks passed
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.

[P0] AgentRunner.run() silently drops fatal errors — failed runs appear successful

1 participant