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
{{ message }}
Repository navigation
[Bug]: worktree ps --json agent rows carry no agentWait — only terminal show does, forcing a second call per lane to detect a human-wait #23921
1.4.216 (the 1.4.217 release notes list no change here)
Details
orca worktree ps --json is the one-call fleet sweep: every lane, every agent, in one response.
Its agent rows carry a state enum (working, blocked, waiting, etc.) but not agentWait —
the richer wait-reason signal that orca terminal show --terminal <handle> --json returns for
the same agent. A watcher that wants to tell "this lane is genuinely parked on a human" from
"this lane is just between turns" has to fall back to state alone on the sweep call, then make
one more terminal show call per terminal to get agentWait, defeating the point of a single
fleet-wide ps call.
Reproduction
orca worktree ps --json
# agent row keys: agentType, displayName, interrupted, lastAssistantMessage, paneKey,
# parentPaneKey, prompt, state, stateStartedAt, taskTitle, toolInput, toolName, updatedAt
# -> no agentWait
orca terminal show --terminal <handle-from-that-row> --json
# -> includes "agentWait": null (or a populated wait descriptor when the agent is actually
# waiting on a human)
Expected
Either add agentWait to the agent objects in worktree ps --json (and worktree show), or
document that a fleet sweep needs a terminal show follow-up call per terminal to see it. Today
a caller has no way to know the richer field exists unless they already know to look at terminal show.
Confirmed on upstream/main — the asymmetry is structural, not drift. terminal show fills agentWait in orca-runtime-resolve-terminal-pane.ts via getTerminalInteractiveWait(), while worktree ps rows are assembled in attachRuntimeWorktreeAgentRows() (src/main/runtime/runtime-worktree-agent-rows.ts) from RuntimeWorktreeAgentSources that never carry the field, so the JSON projection can't expose what its source rows don't have.
The ps path already holds what the wait lookup needs: collectRuntimeWorktreeAgentSources() rejoins each status row to the PTY handle it was observed under, and getTerminalInteractiveWait()'s prompt-text and title branches are pure state reads — only the hook branch issues a probe, which is already deduped once per PTY and bounded by TERMINAL_INTERACTIVE_WAIT_PROBE_TIMEOUT_MS. Plan: thread an async wait lookup through the getWorktreePs assembly, attach agentWait to each row conditionally (...(agentWait !== undefined ? { agentWait } : {})), and keep it absent for structured workers, matching the existing absent-vs-null contract documented in worker-observation.ts. Tests against the row builder in the existing runtime-worktree-agent-rows-*.test.ts style: populated wait, explicit null on "looked, nothing waiting", absent when no handle resolves. I'll take this one.
Implemented in #24142. The ps assembly now resolves getTerminalInteractiveWait() for every row source that names its terminal handle and threads the result onto the row; structured workers keep the field absent per the absent-vs-null contract in worker-observation.ts.
Activity
ggbdpq commentedon Sep 30, 2026
Confirmed on
upstream/main— the asymmetry is structural, not drift.terminal showfillsagentWaitinorca-runtime-resolve-terminal-pane.tsviagetTerminalInteractiveWait(), whileworktree psrows are assembled inattachRuntimeWorktreeAgentRows()(src/main/runtime/runtime-worktree-agent-rows.ts) fromRuntimeWorktreeAgentSources that never carry the field, so the JSON projection can't expose what its source rows don't have.The ps path already holds what the wait lookup needs:
collectRuntimeWorktreeAgentSources()rejoins each status row to the PTY handle it was observed under, andgetTerminalInteractiveWait()'s prompt-text and title branches are pure state reads — only the hook branch issues a probe, which is already deduped once per PTY and bounded byTERMINAL_INTERACTIVE_WAIT_PROBE_TIMEOUT_MS. Plan: thread an async wait lookup through thegetWorktreePsassembly, attachagentWaitto each row conditionally (...(agentWait !== undefined ? { agentWait } : {})), and keep it absent for structured workers, matching the existing absent-vs-null contract documented inworker-observation.ts. Tests against the row builder in the existingruntime-worktree-agent-rows-*.test.tsstyle: populated wait, explicit null on "looked, nothing waiting", absent when no handle resolves. I'll take this one.ggbdpq commentedon Sep 30, 2026
Implemented in #24142. The ps assembly now resolves
getTerminalInteractiveWait()for every row source that names its terminal handle and threads the result onto the row; structured workers keep the field absent per the absent-vs-null contract inworker-observation.ts.fix(runtime): carry agentWait on worktree ps agent rows
fix(runtime): carry agentWait on worktree ps agent rows
fix(runtime): add opt-in agentWait to worktree ps agent rows
fix(runtime): add opt-in agentWait to worktree ps agent rows (#24142)