mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 04:45:33 -08:00
Get past a stuck continue or a failed send in one step
AI Assisted
This commit is contained in:
1 parent
7a9f56a452
commit
3e22d53bf5
8 files changed
+266
-17
No files matched your search
@@ -202,7 +202,20 @@ export const doingNow = () => workingLine(page.S && page.S.agent, page.S && page
|
||||
// itself "working", and the normal state while someone answers is "waiting".
|
||||
export function agentAdrift() {
|
||||
if (!page.agentLastSeen || page.gone || finish()) return false;
|
||||
return Date.now() - Date.parse(page.agentLastSeen) > patience(ADRIFT_MS);
|
||||
const silent = Date.now() - Date.parse(page.agentLastSeen);
|
||||
return silent > (page.pendingResult ? uncollectedLimit() : patience(ADRIFT_MS));
|
||||
}
|
||||
|
||||
// With answers sent and nothing collecting them, the agent's quiet allowance
|
||||
// stops counting: those answers are what it is meant to come back for. An
|
||||
// agent that said it is waiting pings from `wait` every five seconds, so a
|
||||
// minute of silence means it is not there. One that said it is working (it
|
||||
// asked and carried on) collects at its next `wait`, so it gets the plain
|
||||
// three minutes, never the half hour a build task may have asked for.
|
||||
const UNCOLLECTED_MS = 60 * 1000;
|
||||
|
||||
function uncollectedLimit() {
|
||||
return agentWorking() ? ADRIFT_MS : UNCOLLECTED_MS;
|
||||
}
|
||||
|
||||
// Answers that went nowhere: pressed Send, and nothing has collected them.
|
||||
|
||||
Reference in new issue
Block a user