Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: paste continue when a stalled TUI session needs a nudge

[._.]/ Adam Eivye60af704d647
diff --git a/docs/features/cos-agent-runner.md b/docs/features/cos-agent-runner.md
index 0c4fd53da3..59bd626d9f 100644
--- a/docs/features/cos-agent-runner.md
+++ b/docs/features/cos-agent-runner.md
@@ -52,9 +52,9 @@ Nobody is watching a CoS TUI session, so nothing types into it when the model st
| Truncated response | a harness banner that the response was cut off mid-generation (pi's TUI halts the whole session on it) | Pastes `continue` once the session is quiet; fails over to a fallback provider after 3 |
| Retry stall | the TUI retrying one request past attempt 3, ten minutes on | Fails the run over to a fallback provider |
| Tool-permission dialog | Claude Code asking to approve a call nobody can approve | Declines it, then explains why and sends the session back to work |
-| **Stall** | **nothing at all — the session went quiet with the task unfinished** | **Pastes a `continue` nudge after 3 minutes of silence, up to 3 times; then badges the agent card `Stalled`** |
+| **Stall** | **nothing at all — the session went quiet with the task unfinished** | **Pastes a `continue` nudge after 10 minutes of silence, up to 3 times; then badges the agent card `Stalled`** |
-The stall gate is the one with no signal to match on: the model narrates its next step ("Next: /do:pr"), ends its turn, and the TUI returns to its idle composer. Since the wall-clock ceiling was removed, nothing else would ever touch that session. It reads pure silence rather than provider chrome, because in-flight chrome is per-TUI vocabulary while bytes on the PTY are universal. Claude Code repaints its working counter about once a second for as long as any tool or API call is in flight; OpenCode barely repaints its chrome at all, but streams megabytes of transcript through the same stream. Three unbroken minutes of NOTHING is a composer at rest under both.
+The stall gate is the one with no signal to match on: the model narrates its next step ("Next: /do:pr"), ends its turn, and the TUI returns to its idle composer. Since the wall-clock ceiling was removed, nothing else would ever touch that session. It reads pure silence rather than provider chrome, because in-flight chrome is per-TUI vocabulary while bytes on the PTY are universal. Claude Code repaints its working counter about once a second for as long as any tool or API call is in flight; OpenCode barely repaints its chrome at all, but streams megabytes of transcript through the same stream. Ten unbroken minutes of NOTHING is a composer at rest under both.
It stays out of the way of the other four: it is polled last, it waits for the prompt to actually be in, and it skips a run that already wrote its completion sentinel or is mid-`finish()`. Its post-nudge wait is measured from the nudge rather than from output, because a session wedged below its composer never echoes the paste. A session that prints for 30s past a nudge took the hint and gets its full budget back, so a long run that stalls again hours later is not treated as a second strike.
diff --git a/server/lib/tuiHandshake.js b/server/lib/tuiHandshake.js
index d2decc7e0e..54972bd092 100644
--- a/server/lib/tuiHandshake.js
+++ b/server/lib/tuiHandshake.js
@@ -1633,12 +1633,10 @@ export const STALL_NUDGE_MAX_ATTEMPTS = 3;
// never runs out and the run loops for hours on a local GPU. A run that has
// needed this many nudges is not going to finish on the next one.
export const STALL_NUDGE_MAX_TOTAL = 6;
-// What gets pasted. It leads with the literal word a human used, for the literal
-// reason it worked — the TUI still holds the whole conversation and the model
-// only needs a turn — and then closes the two doors that produce this state in
-// an unattended run: waiting on an answer that is never coming, and treating
-// "I described the next step" as finishing it.
-export const STALL_NUDGE_TEXT = 'continue — this session went quiet with its task unfinished, and the completion sentinel has not been written. Nobody is watching it: no question will be answered and no approval is coming, so choose the most reasonable option yourself. Carry out the next step you named, then the one after it, and keep going until the task is genuinely complete and the sentinel is written.';
+// What gets pasted. The same word a human types into the Shell tab: the TUI
+// still holds the conversation, and the unattended-run rules already live in
+// the prompt. A longer paste only clutters the composer.
+export const STALL_NUDGE_TEXT = 'continue';
/**
* State machine for "nudge a TUI session that stopped mid-task".
diff --git a/server/lib/tuiHandshake.test.js b/server/lib/tuiHandshake.test.js
index 4ad0aee0e2..bad5f60d55 100644
--- a/server/lib/tuiHandshake.test.js
+++ b/server/lib/tuiHandshake.test.js
@@ -21,6 +21,7 @@ import {
STALL_NUDGE_IDLE_MS,
STALL_NUDGE_RECOVERY_MS,
STALL_NUDGE_MAX_ATTEMPTS,
+ STALL_NUDGE_TEXT,
SELF_CLEARING_RESUBMIT_INTERVAL_MS,
SELF_CLEARING_RESUBMIT_ECHO_MS,
MCP_BOOT_PASTE_DEADLINE_MS,
@@ -2076,6 +2077,12 @@ describe('answerStartupDialogs', () => {
});
describe('createStallNudgeGate', () => {
+ it('pastes the word a human types, not a paragraph', () => {
+ // A long explanation restates rules the prompt already carries and crowds
+ // the composer. The resume a human types is the single word.
+ expect(STALL_NUDGE_TEXT).toBe('continue');
+ });
+
it('nudges a session that went quiet with its task unfinished', () => {
const gate = createStallNudgeGate();
const quietSince = 0;