fix(cli): handle session.error in run command to prevent infinite wait

When session.error occurs with incomplete todos, the run command now:
- Captures the error via handleSessionError()
- Exits with code 1 instead of waiting indefinitely
- Shows clear error message to user

Previously, run command ignored session.error events, causing infinite
'Waiting: N todos remaining' loop when agent errors occurred.

🤖 Generated with assistance of OhMyOpenCode
https://github.com/code-yeongyu/oh-my-opencode
This commit is contained in:
YeonGyu-Kim
2025-12-25 22:34:41 +09:00
parent 9bfe7d8a1d
commit 0b4821cfdf
4 changed files with 40 additions and 0 deletions

View File

@@ -74,6 +74,8 @@ describe("event handling", () => {
const ctx = createMockContext("my-session")
const state: EventState = {
mainSessionIdle: true,
mainSessionError: false,
lastError: null,
lastOutput: "",
lastPartText: "",
currentTool: null,