feat(cli): add 'bunx oh-my-opencode run' command for persistent agent sessions (#228)
- Add new 'run' command using @opencode-ai/sdk to manage agent sessions - Implement recursive descendant session checking (waits for ALL nested child sessions) - Add completion conditions: all todos done + all descendant sessions idle - Add SSE event processing for session state tracking - Fix todo-continuation-enforcer to clean up session tracking - Comprehensive test coverage with memory-safe test patterns Unlike 'opencode run', this command ensures the agent completes all tasks by recursively waiting for nested background agent sessions before exiting. 🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -296,7 +296,8 @@ export function createTodoContinuationEnforcer(
|
||||
|
||||
if (sessionID && role === "assistant" && finish) {
|
||||
remindedSessions.delete(sessionID)
|
||||
log(`[${HOOK_NAME}] Cleared reminded state on assistant finish`, { sessionID })
|
||||
preemptivelyInjectedSessions.delete(sessionID)
|
||||
log(`[${HOOK_NAME}] Cleared reminded/preemptive state on assistant finish`, { sessionID })
|
||||
|
||||
const isTerminalFinish = finish && !["tool-calls", "unknown"].includes(finish)
|
||||
if (isTerminalFinish && isNonInteractive()) {
|
||||
|
||||
Reference in New Issue
Block a user