You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add af agent run — non-streaming task execution for scripting
`af agent run --agent-id <id> --message "Do X" --json` sends a task
and returns a structured JSON result with the response and thread_id.
Designed for AI agents calling the CLI via Bash:
- No stream parsing needed — just JSON in, JSON out
- Returns thread_id for conversation continuity
- Timeout + poll interval configurable
- Falls back to polling thread status if stream text is empty
fail("agent_run_failed",`Agent run failed (thread: ${resolvedThreadId})`);
3704
+
}
3705
+
}catch{/* thread not ready yet */}
3706
+
awaitnewPromise((r)=>setTimeout(r,pollMs));
3707
+
}
3708
+
3709
+
fail("agent_run_timeout",`Agent did not respond within ${opts.timeout}s`,`Thread: ${resolvedThreadId}. Check with: af agent-threads messages --thread-id ${resolvedThreadId}`);
0 commit comments