Get past a stuck continue or a failed send in one step

AI Assisted
This commit is contained in:
jparkerweb committed 2026-10-25 17:04:21 -07:00
1 parent 7a9f56a452
commit 3e22d53bf5
8 files changed
+266 -17

No files matched your search

+12 -7
View File
@@ -2,7 +2,7 @@
// agent's terminal panel docked at the bottom with a drag handle.
import { mountTerminal } from './terminal.js';
import { barNextSteps, defaultRightFraction, folderName, windowTitleFor } from './meter.js';
import { barNextSteps, continueKeys, defaultRightFraction, folderName, windowTitleFor } from './meter.js';
const { invoke, Channel } = window.__TAURI__.core;
@@ -553,16 +553,21 @@ window.addEventListener('message', (event) => {
}
});
// Its "Not running... type continue" line, pressed: the word, then Enter on
// its own a moment later, so an agent that treats one burst of input as a
// paste still reads the Enter as a submit.
// Its "Not running... type continue" line, pressed: the keystrokes
// continueKeys names, each on its own a moment after the last, so an agent
// that treats one burst of input as a paste still reads the Enter as a submit.
const ENTER_AFTER_MS = 120;
function typeContinue() {
if (!agentActive()) return;
invoke('agent_input', { data: 'continue' })
.then(() => new Promise((resolve) => setTimeout(resolve, ENTER_AFTER_MS)))
.then(() => invoke('agent_input', { data: '\r' }))
continueKeys(agent.kind)
.reduce(
(typed, data, i) =>
typed
.then(() => (i ? new Promise((resolve) => setTimeout(resolve, ENTER_AFTER_MS)) : null))
.then(() => invoke('agent_input', { data })),
Promise.resolve()
)
.catch((error) => {
setAgentStatus(`Could not type continue: ${error}`, { error: true });
});
+14
View File
@@ -11,6 +11,20 @@ export const NEXT_STEP_LABELS = {
update: 'Update skills',
};
/**
* What the console page's **continue** button types into the agent's
* terminal, one write each: the word, then Enter. Claude Code holds typed
* text as a queued message while its turn is busy, and the button only shows
* once the agent stopped checking in with the console, so by then the turn is
* stuck and the queued word would never send by itself: for it, the send-now
* chord (ctrl+x ctrl+s) follows.
*/
export function continueKeys(kind) {
const keys = ['continue', '\r'];
if (kind === 'claude') keys.push('\x18\x13');
return keys;
}
/**
* What the right end of the bar offers, most pressing first: the bar shows
* the first step (short text plus its one button) and counts the rest as