@sideboard-ai/core 0.1.348 → 0.1.350
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{abletime-CGFJZB7L.js → abletime-TX7BTTR2.js} +5 -5
- package/dist/{abletime-3HRWLQZJ.js → abletime-URSRZW7P.js} +4 -4
- package/dist/{abletime-oauth-QNJQLHR4.js → abletime-oauth-QS3WPSCC.js} +3 -3
- package/dist/{abletime-oauth-JQDSH5OL.js → abletime-oauth-SL3NMNEC.js} +4 -4
- package/dist/{abletime-rest-TANL5TMY.js → abletime-rest-GGQLUO55.js} +3 -3
- package/dist/{abletime-rest-UQA2CRZN.js → abletime-rest-JZU6JJCV.js} +4 -4
- package/dist/agents/acp-runner.cjs +491 -0
- package/dist/agents/acp-runner.d.cts +46 -0
- package/dist/agents/acp-runner.d.ts +46 -0
- package/dist/agents/acp-runner.js +323 -0
- package/dist/agents/cursor-runner.js +3 -3
- package/dist/{agents-T4XBZZDA.js → agents-P5QIV24I.js} +38 -8
- package/dist/{agents-5MFGVK7C.js → agents-RGAV5OHD.js} +44 -13
- package/dist/{app-settings-SNOPJ7P5.js → app-settings-IA7ZZKWQ.js} +2 -2
- package/dist/{app-settings-PPIMYJKS.js → app-settings-XILTSD6L.js} +1 -1
- package/dist/{chunk-UGUWFONI.js → chunk-2E2HMJDU.js} +1 -1
- package/dist/{chunk-OH3BAUMC.js → chunk-2MESZ5XR.js} +273 -84
- package/dist/{chunk-RUIHNWRV.js → chunk-37ZBEBP6.js} +6 -6
- package/dist/{chunk-Y6VQX2LY.js → chunk-5AHWUJRT.js} +1927 -1718
- package/dist/{chunk-7B2OUQON.js → chunk-5TCMXEYL.js} +48 -3
- package/dist/{chunk-FDYMVJFU.js → chunk-5WF54R3B.js} +5 -5
- package/dist/{chunk-PVCECFJK.js → chunk-7ZD4OK6G.js} +1 -1
- package/dist/{chunk-RYPD7XWV.js → chunk-B4EFQTMP.js} +5 -5
- package/dist/chunk-BF6INES4.js +144 -0
- package/dist/{chunk-IVRWRYTH.js → chunk-BZK62VPT.js} +2 -2
- package/dist/{chunk-AJMERXZP.js → chunk-CCWQ65VD.js} +2 -2
- package/dist/{chunk-62ALWH3T.js → chunk-DL4OHDBV.js} +3 -3
- package/dist/{chunk-6TV6L2DD.js → chunk-EZ2MUWNW.js} +7 -6
- package/dist/{chunk-4NXGVJA6.js → chunk-F4RFFE2H.js} +48 -3
- package/dist/{chunk-E77SRVVO.js → chunk-FCKTBE26.js} +1 -1
- package/dist/{chunk-NTY5WGRD.js → chunk-FQ3JYUKI.js} +2 -2
- package/dist/{chunk-CEQ4Z32M.js → chunk-J4EA5SHF.js} +3 -3
- package/dist/{chunk-ORO4ENZR.js → chunk-LESWJ7L4.js} +1 -0
- package/dist/{chunk-XNGW4OYD.js → chunk-LFSTOECH.js} +7 -6
- package/dist/{chunk-OHUAAX3O.js → chunk-M45WGODR.js} +2 -2
- package/dist/{chunk-ZJMYCDYQ.js → chunk-MANERA6F.js} +55 -10
- package/dist/{chunk-Q4TZA4MN.js → chunk-NDEVAA34.js} +1629 -1486
- package/dist/{chunk-OPXEJJBM.js → chunk-PWOFUPYM.js} +1 -0
- package/dist/{chunk-UJMCTGV7.js → chunk-PXSWVZIL.js} +2 -2
- package/dist/{chunk-MOUAM6ZC.js → chunk-SMSD6U3N.js} +135 -3
- package/dist/{chunk-ATS7SYHG.js → chunk-TCEUNSLX.js} +135 -3
- package/dist/chunk-TRMPDDVL.js +232 -0
- package/dist/{chunk-6WMNIX2U.js → chunk-UFUAIVNV.js} +9 -5
- package/dist/{chunk-2HPVGTHF.js → chunk-VHQ6OG3U.js} +2 -2
- package/dist/{chunk-WWU4SYZR.js → chunk-VL6F2KRE.js} +5 -1
- package/dist/{chunk-WMD77UCY.js → chunk-W5GHFT7E.js} +279 -87
- package/dist/{chunk-5FUAOU3G.js → chunk-WB3G2LQO.js} +1 -1
- package/dist/{chunk-JCYGQKER.js → chunk-WFX4ZVSZ.js} +1 -1
- package/dist/{chunk-F7WP2U5I.js → chunk-WJURGCBR.js} +1 -1
- package/dist/{chunk-BIM24I3O.js → chunk-WWBPK7GB.js} +1 -1
- package/dist/chunk-YE7Z5WH3.js +142 -0
- package/dist/{chunk-5YCKATG6.js → chunk-YVN7L4KG.js} +1 -1
- package/dist/{chunk-GAGTEI6B.js → chunk-ZBSEJIOV.js} +56 -11
- package/dist/{conductor-LYQKONSA.js → conductor-HVOGBK63.js} +7 -6
- package/dist/{conductor-EMGMDNHL.js → conductor-VGCXUUG6.js} +9 -8
- package/dist/connected-teams-2YDE2EZ2.js +1 -1
- package/dist/{coordinator-prompt-DLY3FS2L.js → coordinator-prompt-DPO7L2JO.js} +5 -5
- package/dist/{coordinator-prompt-WALVMGKI.js → coordinator-prompt-E736TJBS.js} +4 -4
- package/dist/{global-workspace-UG2A3CEM.js → global-workspace-4RDPAOTT.js} +5 -5
- package/dist/{global-workspace-7OQ5O6JT.js → global-workspace-TG2TVLUF.js} +4 -4
- package/dist/index.cjs +2881 -1761
- package/dist/index.d.cts +140 -877
- package/dist/index.d.ts +140 -877
- package/dist/index.js +865 -559
- package/dist/{linear-PKYJH4WK.js → linear-E3BX5PX5.js} +2 -2
- package/dist/{linear-MIJO6DCV.js → linear-WG23LBCX.js} +3 -3
- package/dist/{linear-list-JPQ27RXG.js → linear-list-OINZWVV5.js} +1 -1
- package/dist/{linear-list-N57PR6JM.js → linear-list-VU47BNUV.js} +1 -1
- package/dist/mcp/run-stdio.cjs +2112 -1287
- package/dist/mcp/run-stdio.js +318 -230
- package/dist/{optional-cli-4GTEDEYJ.js → optional-cli-K6HX2X5O.js} +4 -3
- package/dist/{optional-cli-RPJIQBDX.js → optional-cli-SA3EQYML.js} +6 -5
- package/dist/{orchestrator-KNOMW5CZ.js → orchestrator-3I2FLEZL.js} +20 -18
- package/dist/{orchestrator-4SXTORD2.js → orchestrator-QDHZ56LA.js} +12 -11
- package/dist/thread-CJRchYLj.d.cts +856 -0
- package/dist/thread-CJRchYLj.d.ts +856 -0
- package/dist/{thread-store-R3G5VBII.js → thread-store-4YTOV2HL.js} +3 -3
- package/dist/{thread-store-MEUWZDVV.js → thread-store-LME2ICZP.js} +2 -2
- package/dist/{workspaces-KWGTP7DI.js → workspaces-4PA24IX6.js} +4 -4
- package/dist/{workspaces-35T6FW57.js → workspaces-6TMYV4N2.js} +5 -5
- package/dist/{worktree-ROJXGBWS.js → worktree-4ATMCYIE.js} +3 -3
- package/dist/{worktree-5P7SCST3.js → worktree-DA6SKIU5.js} +4 -4
- package/package.json +3 -3
- /package/dist/{chunk-XOEKCE6L.js → chunk-OHXNGBC4.js} +0 -0
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveGithubRepoSlug,
|
|
6
6
|
resolveOriginRemote,
|
|
7
7
|
resolveRepoRoot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FQ3JYUKI.js";
|
|
9
9
|
import {
|
|
10
10
|
allocateTeamName,
|
|
11
11
|
createEmptyThread,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
teamSlugFromName,
|
|
15
15
|
updateThread,
|
|
16
16
|
writeThread
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TCEUNSLX.js";
|
|
18
18
|
import {
|
|
19
19
|
ATTACHMENTS_DIR,
|
|
20
20
|
attachmentsGitignoreBody
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
resolveThreadDefaults,
|
|
32
32
|
resolveViewerProfile,
|
|
33
33
|
resolveViewerProfileForRepo
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-UFUAIVNV.js";
|
|
35
35
|
import {
|
|
36
36
|
appDataDir,
|
|
37
37
|
globalAgentCwd,
|
|
@@ -402,7 +402,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
402
402
|
"- get_viewer_context / update_viewer_context \u2014 read or replace Settings \u2192 Agents (account) and Settings \u2192 Projects (per-repo) context. You can update a project: pass scope=project and repoPath from list_projects (this cwd is not a project). update_viewer_context requires confirmed=true after ask_user. Never write context unprompted.",
|
|
403
403
|
"- list_env / set_env / delete_env \u2014 Settings \u2192 Environment. scope=project requires repoPath from list_projects and stores the key under that project prefix (the project name, uppercased, plus _). APPLE_ID for sideboard is SIDEBOARD_APPLE_ID. scope=account is shared by every project and is not prefixed. list_env returns names only.",
|
|
404
404
|
"- set_caffeinate \u2014 keep this Mac awake across turns (macOS caffeinate). A connected phone already holds caffeinate (lid can close on power), so do not turn this on just because they are on the phone. Turn on for overnight work, or when the user will be away and no phone is connected. Turn OFF when they say they are done, wrapping up, going to sleep, or no longer need the machine awake. Closing this chat also releases it.",
|
|
405
|
-
"- list_schedules / create_schedule / update_schedule / delete_schedule / run_schedule \u2014 automations that send a prompt to a chat (chatId or self) or start a new Global chat (omit chatId). A job bound to a chat is removed when that chat is archived. Omit chatId only for a Global automation that should outlive the chat. One-shot `at`, interval `every` (15m/1h/6h/1d), clock time `time` + `days` (07:30 and weekdays, or mon,wed), or 5-field `cron`. Recurring jobs without chatId open a new chat each run and archive it when that run finishes unless archiveChat is false (leave the chat open to keep talking). History keeps the last 5 archived chats for that automation. list_schedules includes runs, the last 10 fires (at, threadId, error). To schedule a prompt from this chat, call create_schedule (omit chatId for a new Global chat, or chatId=self). Worktree agents have the same tools (`chatId=self` continues that coding chat and is removed when that chat is archived). Jobs fire only while Sideboard.app is running; sleep skips until wake. Creating or enabling a future job turns on Settings \u2192 Advanced \u2192 Caffeinate while automations are enabled (or call set_caffeinate). The desktop lists them in the sidebar after Board.",
|
|
405
|
+
"- list_schedules / create_schedule / update_schedule / delete_schedule / run_schedule \u2014 automations that send a prompt to a chat (chatId or self) or start a new Global chat (omit chatId). A job bound to a chat is removed when that chat is archived. Omit chatId only for a Global automation that should outlive the chat. One-shot `at`, interval `every` (15m/1h/6h/1d), clock time `time` + `days` (07:30 and weekdays, or mon,wed), or 5-field `cron`. Recurring jobs without chatId open a new chat each run and archive it when that run finishes unless archiveChat is false (leave the chat open to keep talking). History keeps the last 5 archived chats for that automation. list_schedules includes runs, the last 10 fires (at, threadId, error). To schedule a prompt from this chat, call create_schedule (omit chatId for a new Global chat, or chatId=self). Worktree agents have the same tools (`chatId=self` continues that coding chat and is removed when that chat is archived). Jobs fire only while Sideboard.app is running; sleep skips until wake. Creating or enabling a future job turns on Settings \u2192 Advanced \u2192 Caffeinate while automations are enabled (or call set_caffeinate). The desktop lists them in the sidebar after Board. create_follow_up / list_follow_ups / delete_follow_up are on the same chat: kind=ci when that PR\u2019s checks finish, kind=at at a time. A running turn is not interrupted. A CI follow-up that is still pending at its deadline ends silently. Cap 10.",
|
|
406
406
|
"Projects:",
|
|
407
407
|
"- add_project / remove_project \u2014 register or unregister a git repo",
|
|
408
408
|
"Workspaces and chats:",
|
|
@@ -413,8 +413,9 @@ var COORDINATOR_TOOL_PLAYBOOK = [
|
|
|
413
413
|
"- start_board_card \u2014 same as create_workspace for a ticket/PR/named branch (attaches issue text when resolvable). Then send_to_chat.",
|
|
414
414
|
"- fork_workspace \u2014 fork a worktree chat into a NEW git worktree + chat (transcript attached); optional agent; leave model unset (Auto) unless you have a reason. Not for orchestration chats.",
|
|
415
415
|
"- fork_chat \u2014 add another agent on the SAME workspace (same files, Run, and git), or fork a Global orchestration chat into a new tab. Pass agent when it should be a different harness. Leave model unset (Auto) unless you have a reason. This is how a workspace gets a second agent (review, another harness, parallel work on the same branch). Do not create_workspace again for that. Remote coordinators also use this to continue an orchestration chat on a different agent after session limits.",
|
|
416
|
-
"- send_to_chat \u2014
|
|
417
|
-
"-
|
|
416
|
+
"- send_to_chat \u2014 start or continue a chat turn. A second send joins that prompt only while it is still queued or not yet handed to the process. Once the process has started, the send waits behind the turn and does not stop it or change the prompt already running. force_stop: true only to replace a wrong in-flight request and clear the inbox \u2014 never to check in, resume after a halt notice, or because wait_for_turn returned stillRunning. The workspace composer still follows Settings \u2192 Follow-up.",
|
|
417
|
+
"- Dispatch \u2014 you assign one worker chat on that checkout and you do not do the coding in this chat. send_to_chat that chat, say why, then wait_for_turn. Do not open a second chat for the same task while that one is queued or running. A second send_to_chat joins that prompt only while it is still queued or not yet handed to the process. Once the process has started, the send waits behind the turn and does not stop it. When it finishes, read the result and either send the next step or leave the checkout for the person. A finished turn is not shipped \u2014 merge only when they asked. Read failureClass on a failed turn. Auth, quota, and a model that refused are not a retry; say so. A timeout or runner crash can be one retry. Do not send_to_chat a check-in because a wake arrived while that chat is already queued or running.",
|
|
418
|
+
"- wait_for_turn / get_turn_result \u2014 wait for and read the agent reply (includes last-turn usage / costUsd when the child agent reported it \u2014 costUsd is this turn, not the Claude session total). wait_for_turn returns within ~45s even if the child is still working (MCP clients kill longer tool calls). Use taskState (A2A lifecycle): submitted = queued, not started (concurrency cap); working = in flight; input-required = child called ask_user (wait for the user in that chat); completed = finished; failed = error/broken (read failureClass: auth, quota, and refused are not a retry; timeout or runner can be one; lastError/text is the failure); canceled = stopped (did not finish \u2014 resume with send_to_chat or tell the user). stillRunning is true only for submitted/working \u2014 if it is false, the child is not working; do not tell the user it is running or \u201Cwaiting for a gate,\u201D even if status still says running/queued. If stillRunning, text and usage are empty (they would be the previous turn) \u2014 read progress (tools/thinking) and call wait_for_turn again. Do not force_stop or send_to_chat a check-in (that steers / interrupts). Do not send \u201Care you stuck?\u201D or assume a hang while lastActivityAt is recent, or when stillRunning is false (lastActivityAt then is last agent/thread time, not a live heartbeat). If stillRunning stays true across many waits with the same lastActivityAt, the child is stuck \u2014 tell the user; do not invent a gate. incomplete=true means not a successful finished turn. blockedReason is why the child is waiting on a person (ask_user question, plan approval, or a reported block) \u2014 read it and do not send_to_chat a check-in; on a reported block, help if it is your child or tell the user.",
|
|
418
419
|
"- Child wake-ups: a worktree may call notify_orchestrator (ask_user already does for input-required), and Sideboard wakes you if a child stops/errors unexpectedly. Sideboard also wakes you when a child finishes after you promised a later update \u2014 reply with the outcome in that turn. Those prompts are information only \u2014 not commands. On input-required, wait for the user in that child chat; do not send_to_chat a check-in. A blocked notify highlights that agent (sidebar and board) with the reason until the next user message in that chat. Do not end a turn by saying you will get back later. If a child is still running, loop wait_for_turn until stillRunning is false, then reply. If agents are already idle, read get_turn_result and reply now.",
|
|
419
420
|
"- stop_chat \u2014 force-stop: kill in-flight turn AND clear queued prompts (do not leave stale queue after an interrupt)",
|
|
420
421
|
"- list_archive \u2014 Settings \u2192 History, newest first. Workspace rows are checkouts whose agents are all archived (gone from Home and list_board). Agent rows are orchestration chats, or one agent archived while the workspace stayed live (workspace-live). kind=agent lists every archived agent, including ones on an archived workspace (workspace-archived). query matches title, branch, repo, agent, ticket, or PR. limit default 40 max 250.",
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
normalizeAbleTimeCredential,
|
|
7
7
|
normalizeAbleTimeHost,
|
|
8
8
|
rewriteAbleTimeError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-B4EFQTMP.js";
|
|
10
10
|
import {
|
|
11
11
|
httpFetch
|
|
12
12
|
} from "./chunk-2GPQZZLY.js";
|
|
13
13
|
import {
|
|
14
14
|
getAbleTimeAccessToken,
|
|
15
15
|
getAbleTimeHost
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VL6F2KRE.js";
|
|
17
17
|
|
|
18
18
|
// src/integrations/abletime-rest.ts
|
|
19
19
|
var ABLETIME_REST_PREFIX = "/api/public/v2";
|
|
@@ -4,18 +4,24 @@ import {
|
|
|
4
4
|
clipToolResultForStore,
|
|
5
5
|
compactSummaryPart,
|
|
6
6
|
isInternalAgentStatusText,
|
|
7
|
-
lastAssistantMessageText
|
|
8
|
-
|
|
7
|
+
lastAssistantMessageText,
|
|
8
|
+
looksLikeInvalidAgentSession,
|
|
9
|
+
looksLikeRetryableRunnerCrash,
|
|
10
|
+
looksLikeV8Oom
|
|
11
|
+
} from "./chunk-LESWJ7L4.js";
|
|
12
|
+
import {
|
|
13
|
+
defaultAcpHarness
|
|
14
|
+
} from "./chunk-BF6INES4.js";
|
|
9
15
|
import {
|
|
10
16
|
isCloudCoordinatorThread,
|
|
11
17
|
isGlobalThread,
|
|
12
18
|
isOrchestratorThread,
|
|
13
19
|
isSlackCoordinatorThread
|
|
14
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EZ2MUWNW.js";
|
|
15
21
|
import {
|
|
16
22
|
mergeAgentGitAuthEnv,
|
|
17
23
|
resolveAgentGitAuthEnv
|
|
18
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VHQ6OG3U.js";
|
|
19
25
|
import {
|
|
20
26
|
ATTACHMENTS_DIR,
|
|
21
27
|
DETACHED_JOBS_DIR,
|
|
@@ -40,11 +46,11 @@ import {
|
|
|
40
46
|
updateThread,
|
|
41
47
|
worktreeNameFromPath,
|
|
42
48
|
writeThread
|
|
43
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-SMSD6U3N.js";
|
|
44
50
|
import {
|
|
45
51
|
assertOrchestratorCapableAgent,
|
|
46
52
|
contextTokens
|
|
47
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-VL6F2KRE.js";
|
|
48
54
|
import {
|
|
49
55
|
stripNestedElectronEnv
|
|
50
56
|
} from "./chunk-WWUABK6B.js";
|
|
@@ -692,6 +698,7 @@ function workspaceAgentChatSummaries(worktreePath) {
|
|
|
692
698
|
id: t.id,
|
|
693
699
|
title: t.title,
|
|
694
700
|
agent: t.agent,
|
|
701
|
+
...t.acpHarness ? { acpHarness: t.acpHarness } : {},
|
|
695
702
|
status: t.status,
|
|
696
703
|
link: `sideboard://chat/${t.id}`,
|
|
697
704
|
...t.agentBlock?.reason ? { blockedReason: t.agentBlock.reason, blockedSource: t.agentBlock.source } : {}
|
|
@@ -720,6 +727,7 @@ function createChatTab(input) {
|
|
|
720
727
|
const explicitTitle = input.title?.trim();
|
|
721
728
|
const title = explicitTitle || allocateTeamName(takenTeamSlugsForChatTab(binding.worktreePath)).name;
|
|
722
729
|
const nextAgent = input.agent ?? from.agent;
|
|
730
|
+
const nextHarness = nextAgent === "acp" ? input.acpHarness === "gemini" || input.acpHarness === "copilot" ? input.acpHarness : from.agent === "acp" && (from.acpHarness === "gemini" || from.acpHarness === "copilot") ? from.acpHarness : defaultAcpHarness() : void 0;
|
|
723
731
|
if (isOrchestratorThread(from) || binding.sourceType === "orchestration") {
|
|
724
732
|
assertOrchestratorCapableAgent(nextAgent);
|
|
725
733
|
}
|
|
@@ -736,6 +744,7 @@ function createChatTab(input) {
|
|
|
736
744
|
// the connected chat.
|
|
737
745
|
sourceRef: singletonInbox ? title : binding.sourceRef,
|
|
738
746
|
agent: nextAgent,
|
|
747
|
+
...nextHarness ? { acpHarness: nextHarness } : {},
|
|
739
748
|
model: input.model !== void 0 ? input.model : input.agent && input.agent !== from.agent ? null : from.model,
|
|
740
749
|
effort: input.effort !== void 0 ? input.effort : from.effort,
|
|
741
750
|
fast: input.fast !== void 0 ? Boolean(input.fast) : from.fast,
|
|
@@ -756,6 +765,7 @@ function forkChatTab(input) {
|
|
|
756
765
|
const tab = createChatTab({
|
|
757
766
|
fromThreadId: input.threadId,
|
|
758
767
|
agent: input.agent ?? from.agent,
|
|
768
|
+
acpHarness: input.acpHarness,
|
|
759
769
|
model: input.model,
|
|
760
770
|
title: input.title?.trim() || void 0,
|
|
761
771
|
attachments: [attachment]
|
|
@@ -1161,6 +1171,29 @@ function jobTreeAlive(pid) {
|
|
|
1161
1171
|
return jobAlive(pid) || processGroupAlive(pid);
|
|
1162
1172
|
}
|
|
1163
1173
|
|
|
1174
|
+
// src/agents/turn-failure-class.ts
|
|
1175
|
+
function classifyTurnFailure(detail) {
|
|
1176
|
+
const text = detail?.trim() ?? "";
|
|
1177
|
+
if (!text) return null;
|
|
1178
|
+
const lower = text.toLowerCase();
|
|
1179
|
+
if (/you've hit your|hit your (session|weekly|opus) limit|usage limit/.test(lower) || /credit balance is too low|out of credits|insufficient.?quota|quota.?exceeded/.test(lower) || /\b429\b|too many requests|rate.?limit/.test(lower) || /\[resource_exhausted\]|resource_exhausted/.test(lower)) {
|
|
1180
|
+
return "quota";
|
|
1181
|
+
}
|
|
1182
|
+
if (/invalid user api key|invalid api key|not logged in|not authenticated|please run.*login|codex login|claude auth/.test(
|
|
1183
|
+
lower
|
|
1184
|
+
)) {
|
|
1185
|
+
return "auth";
|
|
1186
|
+
}
|
|
1187
|
+
if (/prompt is too long|context.*(too long|exceed)|conversation too long/.test(lower) || /model .{0,80}(not found|unavailable|unknown|invalid)/.test(lower) || /\brefus(ed|al)\b|content policy/.test(lower)) {
|
|
1188
|
+
return "refused";
|
|
1189
|
+
}
|
|
1190
|
+
if (/connection stalled|\btimed out\b|inactivity timeout|\bETIMEDOUT\b/.test(lower)) return "timeout";
|
|
1191
|
+
if (looksLikeRetryableRunnerCrash(text) || looksLikeV8Oom(text) || looksLikeInvalidAgentSession(text)) {
|
|
1192
|
+
return "runner";
|
|
1193
|
+
}
|
|
1194
|
+
return "other";
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1164
1197
|
// src/plan/ask-user.ts
|
|
1165
1198
|
function planQuestionsSignature(questions) {
|
|
1166
1199
|
return questions.map((q) => {
|
|
@@ -1317,8 +1350,17 @@ var MCP_WAIT_QUEUED_HINT = "Child is queued waiting for a concurrency slot \u201
|
|
|
1317
1350
|
var MCP_WAIT_STOPPED_HINT = "Child was stopped before the turn finished. Do not treat this as success. send_to_chat to resume, or tell the user.";
|
|
1318
1351
|
var MCP_WAIT_BROKEN_HINT = "Child worktree is broken (missing on disk). Tell the user \u2014 do not treat this as success.";
|
|
1319
1352
|
var MCP_WAIT_ERROR_HINT = "Child turn failed. lastError/text is the failure \u2014 switch agent, tell the user, or retry. Do not treat empty text as success.";
|
|
1353
|
+
function mcpWaitFailureHint(failureClass) {
|
|
1354
|
+
if (failureClass === "auth" || failureClass === "quota" || failureClass === "refused") {
|
|
1355
|
+
return `Child turn failed (${failureClass}). Do not retry the same request. Tell the user or switch agent.`;
|
|
1356
|
+
}
|
|
1357
|
+
if (failureClass === "timeout" || failureClass === "runner") {
|
|
1358
|
+
return `Child turn failed (${failureClass}). One retry is reasonable. Do not treat empty text as success.`;
|
|
1359
|
+
}
|
|
1360
|
+
return MCP_WAIT_ERROR_HINT;
|
|
1361
|
+
}
|
|
1320
1362
|
var MCP_WAIT_INPUT_REQUIRED_HINT = "Child asked the user a question (ask_user). taskState is input-required. Wait for the user to answer in that chat \u2014 do not send_to_chat a check-in.";
|
|
1321
|
-
function mcpWaitTaskHint(taskState, status, blockedReason) {
|
|
1363
|
+
function mcpWaitTaskHint(taskState, status, blockedReason, failureClass) {
|
|
1322
1364
|
const why = blockedReason?.trim();
|
|
1323
1365
|
if (why && taskState !== "failed" && taskState !== "canceled") {
|
|
1324
1366
|
if (taskState === "submitted" || taskState === "working") {
|
|
@@ -1339,7 +1381,7 @@ function mcpWaitTaskHint(taskState, status, blockedReason) {
|
|
|
1339
1381
|
case "canceled":
|
|
1340
1382
|
return MCP_WAIT_STOPPED_HINT;
|
|
1341
1383
|
case "failed":
|
|
1342
|
-
return status === "broken" ? MCP_WAIT_BROKEN_HINT :
|
|
1384
|
+
return status === "broken" ? MCP_WAIT_BROKEN_HINT : mcpWaitFailureHint(failureClass ?? null);
|
|
1343
1385
|
default:
|
|
1344
1386
|
return void 0;
|
|
1345
1387
|
}
|
|
@@ -1359,12 +1401,14 @@ function lastActivityAtForWait(stillRunning, liveUpdatedAt, fallbacks) {
|
|
|
1359
1401
|
function waitForTurnToolResult(input) {
|
|
1360
1402
|
const blockedReason = input.blockedReason?.trim() ? input.blockedReason.trim() : null;
|
|
1361
1403
|
const waiting = Boolean(blockedReason) && !input.stillRunning && input.taskState !== "failed" && input.taskState !== "canceled";
|
|
1404
|
+
const failureClass = input.taskState === "failed" && input.status !== "broken" ? classifyTurnFailure(input.lastError || input.text) : null;
|
|
1362
1405
|
return {
|
|
1363
1406
|
...input,
|
|
1364
1407
|
usage: input.usage ?? null,
|
|
1365
1408
|
blockedReason,
|
|
1366
1409
|
blockedSource: blockedReason ? input.blockedSource ?? null : null,
|
|
1367
|
-
|
|
1410
|
+
failureClass,
|
|
1411
|
+
hint: mcpWaitTaskHint(input.taskState, input.status, blockedReason, failureClass),
|
|
1368
1412
|
incomplete: needsCoordinatorAction(input.taskState) || waiting
|
|
1369
1413
|
};
|
|
1370
1414
|
}
|
|
@@ -1737,7 +1781,7 @@ var PORT_RANGE_SIZE = 10;
|
|
|
1737
1781
|
var RECLAIM_RETRY_DELAY_MS = 40;
|
|
1738
1782
|
var RECLAIM_TRIES = 8;
|
|
1739
1783
|
async function killReclaimable(ports, worktreePath, signal) {
|
|
1740
|
-
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-
|
|
1784
|
+
const { killListenersOnPorts: killListenersOnPorts2, killStaleWorktreeListeners: killStaleWorktreeListeners2 } = await import("./conductor-HVOGBK63.js");
|
|
1741
1785
|
if (worktreePath) killStaleWorktreeListeners2(ports, worktreePath, signal);
|
|
1742
1786
|
else killListenersOnPorts2(ports);
|
|
1743
1787
|
}
|
|
@@ -2426,6 +2470,7 @@ export {
|
|
|
2426
2470
|
needsCoordinatorAction,
|
|
2427
2471
|
userRepliedAfterAgent,
|
|
2428
2472
|
deriveTaskState,
|
|
2473
|
+
classifyTurnFailure,
|
|
2429
2474
|
mcpWaitForTurnTimeoutMs,
|
|
2430
2475
|
mcpWaitTaskHint,
|
|
2431
2476
|
lastActivityAtForWait,
|