From d2e80346e672fb9d035eeecc87982ff83be5b48c Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Fri, 30 Oct 2026 15:09:13 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20agent:=20recognise=20bob=202?= =?UTF-8?q?.x=20"Processing=E2=80=A6=20(Enter=20to=20steer)"=20as=20an=20i?= =?UTF-8?q?n-progress=20turn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bob-Shell 2.x keeps the ❯ input box painted while a response streams and signals busy only with "⠇ Processing… (Enter to steer, Tab to queue)", which matched none of the working markers. paneShowsTurnEnded therefore fired ~30s after delivery: the kick outcome settled while bob was still working and the turn-end kick log archive was a mid-run snapshot. Add the steer hint to agentWorkingMarkers so both the delivery busy gate and turn-end classification see a streaming bob. Closes #15864 Signed-off-by: Andrew Anderson --- changelog.d/fixed-bob-processing-turn-end.md | 1 + src/crux/agent/agent_working_test.go | 36 ++++++++++++++++++++ src/crux/agent/manager_pane_signals.go | 11 ++++++ 3 files changed, 48 insertions(+) create mode 100644 changelog.d/fixed-bob-processing-turn-end.md diff --git a/changelog.d/fixed-bob-processing-turn-end.md b/changelog.d/fixed-bob-processing-turn-end.md new file mode 100644 index 0000000000..4c56e2fa1e --- /dev/null +++ b/changelog.d/fixed-bob-processing-turn-end.md @@ -0,0 +1 @@ +- bob 2.x's busy indicator ("⠇ Processing… (Enter to steer, Tab to queue)") is now recognised as an in-progress turn. Previously a kicked bob turn was classified as ended ~30s after delivery while bob was still working, so the kick outcome settled early and the turn-end kick log archive under 🕘 past kicks was a mid-run snapshot rather than the full run. diff --git a/src/crux/agent/agent_working_test.go b/src/crux/agent/agent_working_test.go index 4e94282b46..a6c7eb5ffa 100644 --- a/src/crux/agent/agent_working_test.go +++ b/src/crux/agent/agent_working_test.go @@ -194,3 +194,39 @@ func TestWaitForInputPrompt_WorkingGate(t *testing.T) { "want ready (gate must use the visible pane, not scrollback)") } } + +// Bob-Shell 2.x keeps the "❯" input box painted while a response streams and +// signals busy only with "⠇ Processing… (Enter to steer, Tab to queue)". The +// busy pane must read as working (delivery gate) and NOT as a finished turn +// (turn-end classification / kick log archive); the idle pane must do the +// opposite. Captures are from the live hive in #15864. +func TestPaneShowsAgentWorking_BobProcessing(t *testing.T) { + busyBob := `• All referenced issues are still open. Now let me look at the current state of the code. + Execute Command (completed) + Command: ls /tmp/hive/ 2>/dev/null || echo "no hive dir" + bin + ⠇ Processing… (Enter to steer, Tab to queue) +─────────────────────────────────────────────────────────────────────── + ❯ Build Anything, @ for context, / for commands, $ for skills +─────────────────────────────────────────────────────────────────────── + Agent Mode (auto-approve) · 22.6k / 270.0k (8%) · 0.380 🅞` + if !paneShowsAgentWorking(busyBob) { + t.Error("a bob pane showing Processing… (Enter to steer) must read as working (#15864)") + } + if paneShowsTurnEnded(busyBob) { + t.Error("a bob pane showing Processing… (Enter to steer) must not read as turn ended (#15864)") + } + + idleBob := ` ### Key Recommendations This Cycle + 1. PR #179 — Reviewer should clarify or dismiss the stale CHANGES_REQUESTED. +─────────────────────────────────────────────────────────────────────── + ❯ Build Anything, @ for context, / for commands, $ for skills +─────────────────────────────────────────────────────────────────────── + Agent Mode (auto-approve) · 31.9k / 270.0k (12%) · 0.984 🅞` + if paneShowsAgentWorking(idleBob) { + t.Error("an idle bob pane must not read as working") + } + if !paneShowsTurnEnded(idleBob) { + t.Error("an idle bob pane must read as turn ended") + } +} diff --git a/src/crux/agent/manager_pane_signals.go b/src/crux/agent/manager_pane_signals.go index 648ddcf83a..4c3eec9479 100644 --- a/src/crux/agent/manager_pane_signals.go +++ b/src/crux/agent/manager_pane_signals.go @@ -113,11 +113,22 @@ func paneHasCLIMarker(output string) bool { // present in the mid-task Claude Fable 5 capture in #7085, alongside a fully // rendered "❯" input box. paneShowsBusyFooter covers newer escape-action // footers such as "esc stop agents" while waiting on background agents. +// +// bobBusyMarker is bob 2.x's equivalent: while a response streams it renders +// "⠇ Processing… (Enter to steer, Tab to queue)" above a still-painted "❯" +// input box, and none of the other markers match it. Without it a kicked +// bob turn was classified ended ~30s after delivery and its turn-end kick log +// archive was a mid-run snapshot (#15864). var agentWorkingMarkers = []string{ "esc interrupt", "◉ Working", + bobBusyMarker, } +// bobBusyMarker is the steer hint bob 2.x shows only while it is processing a +// request. Verified live on Bob-Shell 2.0.5 (#15864). +const bobBusyMarker = "Enter to steer" + // paneShowsAgentWorking reports whether the pane is showing an actively-working // agent rather than a ready CLI input prompt. Modern TUI backends keep the "❯" // input box rendered for the whole time a response streams, so a busy pane From d28e04ffc3c764d6c21f705879c1868b6aa67b9a Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Fri, 30 Oct 2026 15:55:07 -0400 Subject: [PATCH 2/2] agent: move blocking-prompt table out of manager_pane_signals.go to satisfy the crux file-size ratchet Signed-off-by: Andrew Anderson --- .../agent/manager_pane_blocking_prompts.go | 247 ++++++++++++++++++ src/crux/agent/manager_pane_signals.go | 244 ----------------- 2 files changed, 247 insertions(+), 244 deletions(-) create mode 100644 src/crux/agent/manager_pane_blocking_prompts.go diff --git a/src/crux/agent/manager_pane_blocking_prompts.go b/src/crux/agent/manager_pane_blocking_prompts.go new file mode 100644 index 0000000000..c73ef2bd67 --- /dev/null +++ b/src/crux/agent/manager_pane_blocking_prompts.go @@ -0,0 +1,247 @@ +package agent + +import "strings" + +// blockingPrompt is a startup-blocking modal that must be answered with a +// SPECIFIC numbered option rather than a bare Enter or a generic +// navigate-away-from-"No" heuristic. +// +// The generic heuristic in dismissInferencePrompts steers away from options +// containing "no"/"exit" and otherwise confirms whatever is selected. That is +// wrong for menus whose DEFAULT selection is affirmative but harmful — most +// notably codex's update prompt, where the pre-selected option shells out to +// `npm install -g`. Answering those needs the exact key, so each entry names +// the one prompt it answers and nothing else is ever blind-fired at. +// +// This mirrors blockingPromptKey() in bin/contributor-relay.js, which solved +// the same problem contributor-side. The hub had no equivalent. +type blockingPrompt struct { + // backend this prompt belongs to. Prompts are matched only against the + // backend that actually renders them, so a codex pattern can never fire at + // a claude pane that happens to contain similar words. + backend string + // match reports whether this prompt is the one on screen. All conditions + // must hold, so a prompt is only answered when positively identified. + match func(pane string) bool + key string // the option to type before Enter + label string // for the audit log +} + +const ( + // claudeAutoModeNoticeMarker / claudeAutoModeNoticeFooter identify Claude + // Code's auto-mode classifier notice, verbatim from a live FMA pane + // (#9945): "We're changing auto mode to no longer charge for classifier + // requests in Claude Code. … Enter to continue · Esc to cancel". Both + // must be present so a kick that merely mentions auto mode cannot match. + claudeAutoModeNoticeMarker = "classifier requests in Claude Code" + claudeAutoModeNoticeFooter = "Enter to continue" + claudeAutoModeNoticeLabel = "claude auto-mode classifier notice" + // claudeAutoModeNoticeFooterLines is how many trailing non-blank lines + // the footer may sit in for the notice to count as live (the footer + // itself plus a possible status/spinner line under it). + claudeAutoModeNoticeFooterLines = 2 +) + +var blockingPrompts = []blockingPrompt{ + { + backend: "claude", + // Claude Code: "Quick safety check: Is this a project you created or + // one you trust?" defaults to "No, exit". If it is not answered before + // the kick path runs, Claude exits and the prompt text lands in bash. + match: func(p string) bool { + return strings.Contains(p, "Is this a project you created or one you trust") && + strings.Contains(p, "Yes, I trust this folder") + }, + key: "Down", + label: "claude workspace trust", + }, + { + backend: "claude", + // Claude Code's auto-mode classifier notice (#9945). It appears + // MID-RUN, at the first checked tool call, not at startup, so the + // 60s dismissInferencePrompts window never sees it; only this + // lifetime watcher can. Enter continues the held action and the + // notice never returns in that session; Esc cancels the turn. New + // inference sessions launch with CLAUDE_CODE_AUTO_MODE_SERVER=0 so + // the notice is not shown at all — this entry rescues panes that + // were already running when that landed, and any session whose + // settings re-enable the server check. + // + // The footer must be on the LAST non-blank lines: once Enter is + // pressed the CLI resumes and draws output below the notice, and the + // lingering text must not read as a live modal (it would hold the + // readiness gate and re-fire Enter every trustReanswerAfter). + match: func(p string) bool { + return strings.Contains(p, claudeAutoModeNoticeMarker) && + strings.Contains(paneTail(p, claudeAutoModeNoticeFooterLines), claudeAutoModeNoticeFooter) + }, + key: "", + label: claudeAutoModeNoticeLabel, + }, + { + backend: "copilot", + // Copilot: "Confirm folder trust" → 1. Yes (THIS SESSION ONLY). + // + // Deliberately NOT "2. Yes, and remember": remembering makes the CLI + // rewrite the SHARED ~/.copilot/config.json from its own in-memory + // snapshot, which stomps every other agent's state in that file — traced + // live on hivecommons/hive (2026-08-22): each agent's "remember" wiped + // the others' trustedFolders entries, and one stale rewrite resurrected + // a dead token over the operator's fresh login, which is why re-logins + // never stuck. Session-only trust writes NOTHING; the watcher now runs + // for the agent's whole lifetime, so every (re)launch gets re-answered + // and persistence is unnecessary. + match: func(p string) bool { + return strings.Contains(p, "Confirm folder trust") || strings.Contains(p, "Do you trust the files") + }, + key: "1", + label: "copilot folder trust", + }, + { + backend: "agy", + // agy (Antigravity CLI): "Do you trust the contents of this project?" + // An arrow-key menu whose affirmative option is ALREADY selected, so a + // bare Enter is correct and there is no numbered option to type. It + // blocks startup exactly like the codex/copilot trust dialogs. + match: func(p string) bool { + return strings.Contains(p, "Do you trust the contents of this project") + }, + key: "", + label: "agy project trust", + }, + { + backend: "omp", + match: func(p string) bool { + lower := strings.ToLower(p) + return strings.Contains(lower, "welcome to omp") && strings.Contains(lower, "press enter to skip") + }, + key: "Enter", + label: "omp onboarding", + }, + { + backend: "codex", + // codex: older CLIs rendered "Do you trust the contents of this + // directory?"; 0.156.1 renders "Folder access" with an + // explicit "Trust this folder?" question and "Trust and continue" + // option. Both choose option 1 to continue. + match: func(p string) bool { + return strings.Contains(p, "Do you trust the contents of this directory") || + (strings.Contains(p, "Trust this folder? Codex can read, edit, and run files here, subject to your permission settings") && + strings.Contains(p, "Trust and continue")) + }, + key: "1", + label: "codex directory trust", + }, + { + backend: "codex", + // codex: "✨ Update available[!] x -> y" → 3. Skip until next version. + // + // Deliberately NOT "1. Update now", which is the PRE-SELECTED option: + // it runs `npm install -g @openai/codex` as the unprivileged agent UID, + // which fails with EACCES and takes the CLI down with it — on every + // launch, indefinitely, until a human intervenes. Even where it could + // succeed it is slow, needs network, can fail half-way, and drifts the + // CLI version out from under the image. + // + // "Skip until next version" is chosen over a plain "Skip" because it + // persists: a plain Skip re-prompts on the very next launch. + match: func(p string) bool { + return strings.Contains(p, "Update available") && strings.Contains(p, "Skip until next version") + }, + key: "3", + label: codexUpdatePromptLabel, + }, + { + backend: "codex", + // codex command approval prompt. The hub path now launches with + // --dangerously-bypass-approvals-and-sandbox, but this keeps already + // wedged panes visible and lets the watcher make the same unattended + // choice the launch posture declares. + match: func(p string) bool { + return strings.Contains(p, "Would you like to run the following command?") && + strings.Contains(p, "Yes, proceed") + }, + key: "1", + label: "codex command approval", + }, +} + +// blockingPromptTailLines bounds how much of the pane a prompt may be matched +// in. captureTmuxPaneForAgent returns SCROLLBACK, not just the visible screen, +// so matching the whole capture answers prompts that have long since scrolled +// away: after a codex CLI died, its update menu stayed in history and the +// watcher typed "3" into the bash shell that replaced it, once every poll, +// forever. A live modal is always at the bottom of the pane, so only the tail +// is eligible. +const blockingPromptTailLines = 25 + +// paneTail returns the last n non-blank lines of a captured pane. +func paneTail(pane string, n int) string { + lines := strings.Split(pane, "\n") + kept := make([]string, 0, n) + for i := len(lines) - 1; i >= 0 && len(kept) < n; i-- { + if strings.TrimSpace(lines[i]) == "" { + continue + } + kept = append(kept, lines[i]) + } + for i, j := 0, len(kept)-1; i < j; i, j = i+1, j-1 { + kept[i], kept[j] = kept[j], kept[i] + } + return strings.Join(kept, "\n") +} + +// blockingPromptKey returns the keystroke that dismisses whatever known +// startup-blocking modal this backend currently has on screen, and whether one +// was recognised. Only the tail of the pane is considered — see +// blockingPromptTailLines. +func blockingPromptKey(backend, pane string) (key, label string, ok bool) { + tail := paneTail(pane, blockingPromptTailLines) + for _, p := range blockingPrompts { + if p.backend == backend && p.match(tail) { + return p.key, p.label, true + } + } + return "", "", false +} + +// PaneShowsBlockingPrompt reports whether the pane is currently sitting on a +// known startup-blocking modal (folder trust, codex update, …) for the given +// backend. The login-detector uses it to stand down: a trust-wedged pane is +// NOT a login problem, and pausing the agent for it kills the very watcher +// that would answer the prompt — the deadlock that kept hivecommons/hive's +// copilot agents "sitting at login prompt" through every re-login (2026-08-22). +func PaneShowsBlockingPrompt(backend, pane string) bool { + _, _, ok := blockingPromptKey(backend, pane) + return ok +} + +// paneHasBlockingPrompt reports whether ANY known blocking prompt is on the +// pane, regardless of backend. Used by the readiness gate, which does not know +// the backend; the patterns are specific enough that a false positive only +// delays readiness rather than mis-firing a keystroke. +func paneHasBlockingPrompt(pane string) bool { + tail := paneTail(pane, blockingPromptTailLines) + for _, p := range blockingPrompts { + if p.match(tail) { + return true + } + } + return false +} + +// backendHasBlockingPrompts reports whether any known startup-blocking prompt +// belongs to this backend, and so whether the watcher is worth running for it. +// +// Derived from the table rather than hardcoded: the watcher used to be gated on +// `backend == "copilot"`, which is why codex agents were never rescued from +// their update menu even after the menu itself was understood. Adding a prompt +// for a new backend now enables the watcher for it automatically. +func backendHasBlockingPrompts(backend string) bool { + for _, p := range blockingPrompts { + if p.backend == backend { + return true + } + } + return false +} diff --git a/src/crux/agent/manager_pane_signals.go b/src/crux/agent/manager_pane_signals.go index 4c3eec9479..774a4da8c6 100644 --- a/src/crux/agent/manager_pane_signals.go +++ b/src/crux/agent/manager_pane_signals.go @@ -163,250 +163,6 @@ func paneShowsAgentWorking(pane string) bool { return false } -// blockingPrompt is a startup-blocking modal that must be answered with a -// SPECIFIC numbered option rather than a bare Enter or a generic -// navigate-away-from-"No" heuristic. -// -// The generic heuristic in dismissInferencePrompts steers away from options -// containing "no"/"exit" and otherwise confirms whatever is selected. That is -// wrong for menus whose DEFAULT selection is affirmative but harmful — most -// notably codex's update prompt, where the pre-selected option shells out to -// `npm install -g`. Answering those needs the exact key, so each entry names -// the one prompt it answers and nothing else is ever blind-fired at. -// -// This mirrors blockingPromptKey() in bin/contributor-relay.js, which solved -// the same problem contributor-side. The hub had no equivalent. -type blockingPrompt struct { - // backend this prompt belongs to. Prompts are matched only against the - // backend that actually renders them, so a codex pattern can never fire at - // a claude pane that happens to contain similar words. - backend string - // match reports whether this prompt is the one on screen. All conditions - // must hold, so a prompt is only answered when positively identified. - match func(pane string) bool - key string // the option to type before Enter - label string // for the audit log -} - -const ( - // claudeAutoModeNoticeMarker / claudeAutoModeNoticeFooter identify Claude - // Code's auto-mode classifier notice, verbatim from a live FMA pane - // (#9945): "We're changing auto mode to no longer charge for classifier - // requests in Claude Code. … Enter to continue · Esc to cancel". Both - // must be present so a kick that merely mentions auto mode cannot match. - claudeAutoModeNoticeMarker = "classifier requests in Claude Code" - claudeAutoModeNoticeFooter = "Enter to continue" - claudeAutoModeNoticeLabel = "claude auto-mode classifier notice" - // claudeAutoModeNoticeFooterLines is how many trailing non-blank lines - // the footer may sit in for the notice to count as live (the footer - // itself plus a possible status/spinner line under it). - claudeAutoModeNoticeFooterLines = 2 -) - -var blockingPrompts = []blockingPrompt{ - { - backend: "claude", - // Claude Code: "Quick safety check: Is this a project you created or - // one you trust?" defaults to "No, exit". If it is not answered before - // the kick path runs, Claude exits and the prompt text lands in bash. - match: func(p string) bool { - return strings.Contains(p, "Is this a project you created or one you trust") && - strings.Contains(p, "Yes, I trust this folder") - }, - key: "Down", - label: "claude workspace trust", - }, - { - backend: "claude", - // Claude Code's auto-mode classifier notice (#9945). It appears - // MID-RUN, at the first checked tool call, not at startup, so the - // 60s dismissInferencePrompts window never sees it; only this - // lifetime watcher can. Enter continues the held action and the - // notice never returns in that session; Esc cancels the turn. New - // inference sessions launch with CLAUDE_CODE_AUTO_MODE_SERVER=0 so - // the notice is not shown at all — this entry rescues panes that - // were already running when that landed, and any session whose - // settings re-enable the server check. - // - // The footer must be on the LAST non-blank lines: once Enter is - // pressed the CLI resumes and draws output below the notice, and the - // lingering text must not read as a live modal (it would hold the - // readiness gate and re-fire Enter every trustReanswerAfter). - match: func(p string) bool { - return strings.Contains(p, claudeAutoModeNoticeMarker) && - strings.Contains(paneTail(p, claudeAutoModeNoticeFooterLines), claudeAutoModeNoticeFooter) - }, - key: "", - label: claudeAutoModeNoticeLabel, - }, - { - backend: "copilot", - // Copilot: "Confirm folder trust" → 1. Yes (THIS SESSION ONLY). - // - // Deliberately NOT "2. Yes, and remember": remembering makes the CLI - // rewrite the SHARED ~/.copilot/config.json from its own in-memory - // snapshot, which stomps every other agent's state in that file — traced - // live on hivecommons/hive (2026-08-22): each agent's "remember" wiped - // the others' trustedFolders entries, and one stale rewrite resurrected - // a dead token over the operator's fresh login, which is why re-logins - // never stuck. Session-only trust writes NOTHING; the watcher now runs - // for the agent's whole lifetime, so every (re)launch gets re-answered - // and persistence is unnecessary. - match: func(p string) bool { - return strings.Contains(p, "Confirm folder trust") || strings.Contains(p, "Do you trust the files") - }, - key: "1", - label: "copilot folder trust", - }, - { - backend: "agy", - // agy (Antigravity CLI): "Do you trust the contents of this project?" - // An arrow-key menu whose affirmative option is ALREADY selected, so a - // bare Enter is correct and there is no numbered option to type. It - // blocks startup exactly like the codex/copilot trust dialogs. - match: func(p string) bool { - return strings.Contains(p, "Do you trust the contents of this project") - }, - key: "", - label: "agy project trust", - }, - { - backend: "omp", - match: func(p string) bool { - lower := strings.ToLower(p) - return strings.Contains(lower, "welcome to omp") && strings.Contains(lower, "press enter to skip") - }, - key: "Enter", - label: "omp onboarding", - }, - { - backend: "codex", - // codex: older CLIs rendered "Do you trust the contents of this - // directory?"; 0.156.1 renders "Folder access" with an - // explicit "Trust this folder?" question and "Trust and continue" - // option. Both choose option 1 to continue. - match: func(p string) bool { - return strings.Contains(p, "Do you trust the contents of this directory") || - (strings.Contains(p, "Trust this folder? Codex can read, edit, and run files here, subject to your permission settings") && - strings.Contains(p, "Trust and continue")) - }, - key: "1", - label: "codex directory trust", - }, - { - backend: "codex", - // codex: "✨ Update available[!] x -> y" → 3. Skip until next version. - // - // Deliberately NOT "1. Update now", which is the PRE-SELECTED option: - // it runs `npm install -g @openai/codex` as the unprivileged agent UID, - // which fails with EACCES and takes the CLI down with it — on every - // launch, indefinitely, until a human intervenes. Even where it could - // succeed it is slow, needs network, can fail half-way, and drifts the - // CLI version out from under the image. - // - // "Skip until next version" is chosen over a plain "Skip" because it - // persists: a plain Skip re-prompts on the very next launch. - match: func(p string) bool { - return strings.Contains(p, "Update available") && strings.Contains(p, "Skip until next version") - }, - key: "3", - label: codexUpdatePromptLabel, - }, - { - backend: "codex", - // codex command approval prompt. The hub path now launches with - // --dangerously-bypass-approvals-and-sandbox, but this keeps already - // wedged panes visible and lets the watcher make the same unattended - // choice the launch posture declares. - match: func(p string) bool { - return strings.Contains(p, "Would you like to run the following command?") && - strings.Contains(p, "Yes, proceed") - }, - key: "1", - label: "codex command approval", - }, -} - -// blockingPromptTailLines bounds how much of the pane a prompt may be matched -// in. captureTmuxPaneForAgent returns SCROLLBACK, not just the visible screen, -// so matching the whole capture answers prompts that have long since scrolled -// away: after a codex CLI died, its update menu stayed in history and the -// watcher typed "3" into the bash shell that replaced it, once every poll, -// forever. A live modal is always at the bottom of the pane, so only the tail -// is eligible. -const blockingPromptTailLines = 25 - -// paneTail returns the last n non-blank lines of a captured pane. -func paneTail(pane string, n int) string { - lines := strings.Split(pane, "\n") - kept := make([]string, 0, n) - for i := len(lines) - 1; i >= 0 && len(kept) < n; i-- { - if strings.TrimSpace(lines[i]) == "" { - continue - } - kept = append(kept, lines[i]) - } - for i, j := 0, len(kept)-1; i < j; i, j = i+1, j-1 { - kept[i], kept[j] = kept[j], kept[i] - } - return strings.Join(kept, "\n") -} - -// blockingPromptKey returns the keystroke that dismisses whatever known -// startup-blocking modal this backend currently has on screen, and whether one -// was recognised. Only the tail of the pane is considered — see -// blockingPromptTailLines. -func blockingPromptKey(backend, pane string) (key, label string, ok bool) { - tail := paneTail(pane, blockingPromptTailLines) - for _, p := range blockingPrompts { - if p.backend == backend && p.match(tail) { - return p.key, p.label, true - } - } - return "", "", false -} - -// PaneShowsBlockingPrompt reports whether the pane is currently sitting on a -// known startup-blocking modal (folder trust, codex update, …) for the given -// backend. The login-detector uses it to stand down: a trust-wedged pane is -// NOT a login problem, and pausing the agent for it kills the very watcher -// that would answer the prompt — the deadlock that kept hivecommons/hive's -// copilot agents "sitting at login prompt" through every re-login (2026-08-22). -func PaneShowsBlockingPrompt(backend, pane string) bool { - _, _, ok := blockingPromptKey(backend, pane) - return ok -} - -// paneHasBlockingPrompt reports whether ANY known blocking prompt is on the -// pane, regardless of backend. Used by the readiness gate, which does not know -// the backend; the patterns are specific enough that a false positive only -// delays readiness rather than mis-firing a keystroke. -func paneHasBlockingPrompt(pane string) bool { - tail := paneTail(pane, blockingPromptTailLines) - for _, p := range blockingPrompts { - if p.match(tail) { - return true - } - } - return false -} - -// backendHasBlockingPrompts reports whether any known startup-blocking prompt -// belongs to this backend, and so whether the watcher is worth running for it. -// -// Derived from the table rather than hardcoded: the watcher used to be gated on -// `backend == "copilot"`, which is why codex agents were never rescued from -// their update menu even after the menu itself was understood. Adding a prompt -// for a new backend now enables the watcher for it automatically. -func backendHasBlockingPrompts(backend string) bool { - for _, p := range blockingPrompts { - if p.backend == backend { - return true - } - } - return false -} - // paneShowsInputPrompt reports whether the pane content shows a CLI input // prompt that is ready to accept a kick. //