orkestrator 2.37.3-beta → 2.37.4-beta
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/client.js +356 -16
- package/dist/main.js +111519 -102007
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +198 -75
- package/resources/claude-bridge/dist/index.js +364 -167
- package/resources/codex-bridge/dist/index.js +239 -88
- package/resources/cursor-bridge/dist/index.js +1344 -395
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +351 -131
- package/resources/pi-bridge/runtime/install.json +1 -1
|
@@ -262,6 +262,58 @@ var PROTECTED_SEGMENTS = new Set([
|
|
|
262
262
|
".mcp.json"
|
|
263
263
|
]);
|
|
264
264
|
|
|
265
|
+
// ../protocol/src/agent-mail.ts
|
|
266
|
+
var AGENT_MAIL_MAX_BODY_BYTES = 32 * 1024;
|
|
267
|
+
var AGENT_MAIL_MAX_STORE_BYTES = 32 * 1024 * 1024;
|
|
268
|
+
var AGENT_MAIL_DEFAULT_RETENTION_DAYS = 14;
|
|
269
|
+
var AGENT_MAIL_MAX_ATTACHMENT_BYTES = 8 * 1024 * 1024;
|
|
270
|
+
var AGENT_MAIL_MAX_TOTAL_ATTACHMENT_BYTES = 32 * 1024 * 1024;
|
|
271
|
+
var AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET = 16;
|
|
272
|
+
var AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT = 40;
|
|
273
|
+
var AGENT_MAIL_TOOL_NAMES = Object.freeze([
|
|
274
|
+
"list_mailboxes",
|
|
275
|
+
"send_message",
|
|
276
|
+
"check_inbox",
|
|
277
|
+
"read_message",
|
|
278
|
+
"ack_message",
|
|
279
|
+
"reply_message",
|
|
280
|
+
"get_message_status"
|
|
281
|
+
]);
|
|
282
|
+
var DEFAULT_AGENT_MESSAGING_SETTINGS = Object.freeze({
|
|
283
|
+
enabled: true,
|
|
284
|
+
allowCrossProject: false,
|
|
285
|
+
defaultInjectPolicy: "off",
|
|
286
|
+
wakePeers: false,
|
|
287
|
+
autonomousWakeBudget: AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET,
|
|
288
|
+
hourlyWakeLimit: AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT,
|
|
289
|
+
coordinatorStatusWakes: "settled",
|
|
290
|
+
retentionDays: AGENT_MAIL_DEFAULT_RETENTION_DAYS,
|
|
291
|
+
paused: false
|
|
292
|
+
});
|
|
293
|
+
function agentMailCapabilities(tabType, agent, locked = true) {
|
|
294
|
+
if (tabType === "agent-native") {
|
|
295
|
+
if (!locked || !agent)
|
|
296
|
+
return { canPull: false, canSend: false, canInject: false };
|
|
297
|
+
if (agent === "claude" || agent === "codex" || agent === "opencode" || agent === "pi" || agent === "cursor" || agent === "grok") {
|
|
298
|
+
return { canPull: true, canSend: true, canInject: true };
|
|
299
|
+
}
|
|
300
|
+
return { canPull: false, canSend: false, canInject: false };
|
|
301
|
+
}
|
|
302
|
+
if (tabType === "claude-tmux")
|
|
303
|
+
return { canPull: true, canSend: true, canInject: true };
|
|
304
|
+
if (tabType === "pipeline-worker") {
|
|
305
|
+
return agent ? { canPull: true, canSend: true, canInject: true } : { canPull: false, canSend: false, canInject: false };
|
|
306
|
+
}
|
|
307
|
+
if (["claude", "codex", "opencode"].includes(tabType)) {
|
|
308
|
+
return { canPull: true, canSend: true, canInject: false };
|
|
309
|
+
}
|
|
310
|
+
if (["cursor", "grok", "pi"].includes(tabType)) {
|
|
311
|
+
return { canPull: false, canSend: false, canInject: false };
|
|
312
|
+
}
|
|
313
|
+
return { canPull: false, canSend: false, canInject: false };
|
|
314
|
+
}
|
|
315
|
+
var NATIVE_AGENT_MAIL_CAPABILITIES = Object.freeze(Object.fromEntries(AGENT_PLATFORMS.map((agent) => [agent, agentMailCapabilities("agent-native", agent)])));
|
|
316
|
+
|
|
265
317
|
// ../protocol/src/review-evidence-frames.ts
|
|
266
318
|
var SYSTEM_INSTRUCTIONS_FRAME_OPEN = "<orkestrator-system-instructions>";
|
|
267
319
|
var SYSTEM_INSTRUCTIONS_FRAME_CLOSE = "</orkestrator-system-instructions>";
|
|
@@ -883,6 +935,11 @@ var BACKGROUND_CAPABLE_SHELL_TOOL_NAMES = new Set([
|
|
|
883
935
|
"run_terminal_cmd",
|
|
884
936
|
"execute_command"
|
|
885
937
|
]);
|
|
938
|
+
var NATIVE_AGENT_BRANCH_LIST_LIMITS = Object.freeze({
|
|
939
|
+
branches: 50,
|
|
940
|
+
promptChars: 280,
|
|
941
|
+
entryIdChars: 512
|
|
942
|
+
});
|
|
886
943
|
var NATIVE_AGENT_COMMAND_EXECUTION_KINDS = [
|
|
887
944
|
"provider-prompt",
|
|
888
945
|
"provider-command",
|
|
@@ -1513,12 +1570,22 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
1513
1570
|
denied: "A renderer asked for a permission the policy does not grant."
|
|
1514
1571
|
}
|
|
1515
1572
|
},
|
|
1573
|
+
"desktop.webrequest": {
|
|
1574
|
+
description: "Main-process webRequest listeners on Electron sessions. Listener names only; never a URL, header or error message.",
|
|
1575
|
+
events: {
|
|
1576
|
+
"listener.failed-closed": "A listener's decision threw or rejected, so it answered with its fail-closed response.",
|
|
1577
|
+
"observer.failed": "A listener with no callback (a redirect observer) threw; its fallback ran.",
|
|
1578
|
+
"callback.failed": "Electron's webRequest callback threw while a listener answered.",
|
|
1579
|
+
...THROTTLE_LOG_EVENTS
|
|
1580
|
+
}
|
|
1581
|
+
},
|
|
1516
1582
|
"desktop.dialog": {
|
|
1517
1583
|
description: "Native dialogs, whose modal loops hold the main thread while they are open.",
|
|
1518
1584
|
events: {
|
|
1519
1585
|
"attention-failed": "A dialog could not ask for the user's attention.",
|
|
1520
1586
|
closed: "A native dialog closed.",
|
|
1521
1587
|
"hidden-cancelled": "A hidden profile cancelled a dialog without opening native UI.",
|
|
1588
|
+
"no-display-cancelled": "A headless Electron with no display cancelled a dialog instead of opening native UI.",
|
|
1522
1589
|
"open-failed": "A dialog could not open; it was answered as cancelled.",
|
|
1523
1590
|
opening: "A native dialog is opening.",
|
|
1524
1591
|
"preview-beforeunload-ignored": "A browser preview's beforeunload handler was ignored.",
|
|
@@ -1874,6 +1941,7 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
|
|
|
1874
1941
|
"agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
|
|
1875
1942
|
"coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
|
|
1876
1943
|
"monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
|
|
1944
|
+
"monitor.silent": "The request monitor's stream stopped heartbeating, so it is replaced. `silenceMs` only.",
|
|
1877
1945
|
"worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
|
|
1878
1946
|
"request.failed": "Handling a request event failed, so the stream restarts. Error class only.",
|
|
1879
1947
|
"credential-plugin.skipped": "A host OpenCode server started without the credential plugin, so its tools inherit its password; `reason` says why.",
|
|
@@ -1896,6 +1964,7 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
|
|
|
1896
1964
|
"host-server.terminate-failed": "A 2.x server that did not become ready could not be stopped; its process entry is kept for shutdown. Error class only.",
|
|
1897
1965
|
"container-server.launched": "The start script of a container environment's 2.x server was run. Container port only.",
|
|
1898
1966
|
"container-server.ready": "A container environment's 2.x server this backend started answered `/api/info` as 2.x. Environment id only.",
|
|
1967
|
+
"container-server.cleanup-failed": "Cleanup after OpenCode startup failed; step names only, while the original startup error is preserved.",
|
|
1899
1968
|
"container-server.warm-incomplete": "The first workspace request to a container's new 2.x server failed, so its plugins load on the next one. Error class only.",
|
|
1900
1969
|
"resume-list.unavailable": "The 2.x sessions could not be listed for the resume picker, so it shows the 1.x list alone. Error class only.",
|
|
1901
1970
|
"credential.mirrored": "A provider sign-in change was copied into the 2.x database. `outcome` (written, removed, unchanged, skipped) only; never a provider id or value.",
|
|
@@ -2130,6 +2199,7 @@ var TMUX_LOG_AREAS = defineLogAreas({
|
|
|
2130
2199
|
"cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
|
|
2131
2200
|
"cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
|
|
2132
2201
|
"cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
|
|
2202
|
+
"cleanup.kill-incomplete": "An environment's tmux sessions could not all be shown gone (a session survived, or the socket was unreachable while another tmux process might own it), so cleanup stays incomplete.",
|
|
2133
2203
|
"hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
|
|
2134
2204
|
"hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
|
|
2135
2205
|
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
@@ -2259,6 +2329,7 @@ var STORAGE_LOG_AREAS = defineLogAreas({
|
|
|
2259
2329
|
"config.restrict-mode-failed": "A config file holding provider secrets could not be set to owner-only; the backend carries on.",
|
|
2260
2330
|
"legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
|
|
2261
2331
|
"legacy-json.archive-failed": "Imported JSON store files could not be archived.",
|
|
2332
|
+
"native-session-owners.backfill-failed": "Native-session rows could not be given their environment as owner at open; an environment delete then parses those rows instead, and the next open retries.",
|
|
2262
2333
|
"lease.timed-out": "A waiter gave up on a lease; `lease` and `family` name it, `holderAgeMs` is the time since its holder's last heartbeat (null when the holder had just gone), `waitedMs` how long the waiter waited.",
|
|
2263
2334
|
"lease.heartbeat-failed": "A held lease's heartbeat failed, which shortens the lease; the next one retries.",
|
|
2264
2335
|
"scrub.vacuum-failed": "Deleted-content page reclamation failed; the checkpoint is attempted independently.",
|
|
@@ -2308,6 +2379,7 @@ var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
|
2308
2379
|
"transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
|
|
2309
2380
|
"restore.skipped": "A pipeline could not be restored at startup and was skipped.",
|
|
2310
2381
|
"criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
|
|
2382
|
+
"completion-notes.publish-failed": "A finished pipeline's notes tab could not be added to the layout; the run stays complete.",
|
|
2311
2383
|
"workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
|
|
2312
2384
|
"rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
|
|
2313
2385
|
"kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
|
|
@@ -2349,6 +2421,8 @@ var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
|
|
|
2349
2421
|
"dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
|
|
2350
2422
|
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
2351
2423
|
"turn.settle-failed": "Settling a late interrupted turn failed.",
|
|
2424
|
+
"turn.end-recovery": "A background retry of a turn end capture that timed out finished: recovered, done (no longer eligible) or exhausted.",
|
|
2425
|
+
"turn.end-recovery-failed": "A background retry of a turn end capture threw; it counts as a failed attempt.",
|
|
2352
2426
|
"evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
|
|
2353
2427
|
"measurement.failed": "Recomputing a tool's measurement failed."
|
|
2354
2428
|
}
|
|
@@ -2417,6 +2491,7 @@ var COORDINATOR_LOG_AREAS = defineLogAreas({
|
|
|
2417
2491
|
"node-release.no-coordinator": "Work closed on a released node belonged to a coordinator that no longer exists, so nobody was told.",
|
|
2418
2492
|
"node-offline.notice-failed": "The notice that a node has been unreachable for a day could not be sent; the next failed read retries.",
|
|
2419
2493
|
"node-offline.check-failed": "Whether a long-unreachable node's coordinators were told could not be checked; the next read retries.",
|
|
2494
|
+
"node-reconnect.notice-failed": "The message that a node a coordinator tried while it was disconnected is back could not be sent; it is not retried, since the coordinator already holds the refusal.",
|
|
2420
2495
|
"checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
|
|
2421
2496
|
"checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
|
|
2422
2497
|
"checkout.mail-follow": "Before mail woke the main coordinator, the project checkout was fast-forwarded (`fast-forwarded-fetched` when the fetch was slow or failed and the upstream commit already fetched was merged), or `outcome` says why not (`timed-out`, `failed`).",
|
|
@@ -2469,7 +2544,8 @@ var REVIEW_LOG_AREAS = defineLogAreas({
|
|
|
2469
2544
|
"monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
|
|
2470
2545
|
"monitor.merged-tickets-closed": "The startup sweep moved Kanban tickets whose pull request had merged to done (`count`).",
|
|
2471
2546
|
"monitor.merged-tickets-close-failed": "The startup sweep closing Kanban tickets whose pull request merged failed; the next backend start retries.",
|
|
2472
|
-
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
|
|
2547
|
+
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink.",
|
|
2548
|
+
"branch-cleanup.kept": "A merge or cleanup kept a pull request's head branch because it is not the branch created for the environment (`reason`)."
|
|
2473
2549
|
}
|
|
2474
2550
|
}
|
|
2475
2551
|
});
|
|
@@ -2501,6 +2577,8 @@ var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
|
|
|
2501
2577
|
"kept-note.failed": "Recording why a limit stop found no account to move to failed; the stop stands.",
|
|
2502
2578
|
"container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
|
|
2503
2579
|
"last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
|
|
2580
|
+
"shared-usage.save-failed": "The shared usage readings could not be saved; they stay in memory and the next reading saves them.",
|
|
2581
|
+
"shared-usage.record-failed": "A fresh usage reading could not be kept for sharing with other machines; the account's own reading stands.",
|
|
2504
2582
|
"login-cleanup.failed": "A temporary login could not be cleaned up.",
|
|
2505
2583
|
"login-renewal.failed": "Renewing an idle account's sign-in to read its usage failed; it is retried after a backoff.",
|
|
2506
2584
|
"login-renewal.not-extended": "Claude Code ran to renew an idle account's sign-in, but its token is still lapsed.",
|
|
@@ -2518,6 +2596,7 @@ var DOCKER_LOG_AREAS = defineLogAreas({
|
|
|
2518
2596
|
"git-mirror.mount-unavailable": "A new container gets no project Git mirror, so its clone goes to the remote.",
|
|
2519
2597
|
"git-mirror.mount-withheld": "A new restricted container gets no project Git mirror because its firewall would not let it reach the project's remote, so it cannot read what the remote serves through the mirror either.",
|
|
2520
2598
|
"git-mirror.refreshed": "A project's Git mirror was built or updated.",
|
|
2599
|
+
"git-mirror.access-changed": "A project's Git mirror was withdrawn because containers are now given a different credential (another access kind, or a token acting as another or an unreadable account), so no reader keeps what it could not fetch itself.",
|
|
2521
2600
|
"git-mirror.seeded": "A project's Git mirror was built from its host checkout and only what the remote added to it.",
|
|
2522
2601
|
"git-mirror.seed-skipped": "A project's host checkout could not seed its Git mirror, so the build downloads everything.",
|
|
2523
2602
|
"git-mirror.refresh-failed": "A project's Git mirror could not be updated. New clones still work, from the mirror as it was or from the remote.",
|
|
@@ -2531,6 +2610,9 @@ var DOCKER_LOG_AREAS = defineLogAreas({
|
|
|
2531
2610
|
"git-mirror.clone-fallback": "A new environment could not clone from its project's Git mirror and cloned from the remote.",
|
|
2532
2611
|
"project-seed.refused": "A project .env, .env.local or opencode.json was not copied into a new container: a link, not a regular file, outside the project, too large or unreadable.",
|
|
2533
2612
|
"opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
|
|
2613
|
+
"opencode.listener-replaced": "The process on a container's OpenCode port (`provider`: `opencode` or `opencode2`) is not the server the backend launched and recorded, so its password was withheld and the next start replaces it. `stage` is `request` when the re-check after a refused connection or an unexpected answer found it (to-do 7550); that connection then sends nothing more.",
|
|
2614
|
+
"opencode.project-config-too-large": "A checkout's opencode.json or opencode.jsonc was larger than the limit, so a launched OpenCode server does not read it. File name only.",
|
|
2615
|
+
"opencode.project-config-filtered": "Values were left out of a checkout's OpenCode configuration before a launched server reads it (to-do 7550): counts of plugin keys, `{env:}` and `{file:}` references and dropped instructions (including separate instructionGlob and instructionUrl counts), and the names of files that were not a JSONC object. Never values.",
|
|
2534
2616
|
"log-driver.unbounded": "The Docker daemon offers neither the local nor the json-file log driver, so new containers keep its default driver, whose log may be uncapped. Written once per backend.",
|
|
2535
2617
|
"lifecycle-event.reconcile-failed": "Reconciling an environment after a container start or stop event failed; the next status read retries.",
|
|
2536
2618
|
"login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
|
|
@@ -2565,6 +2647,17 @@ var DOCKER_LOG_AREAS = defineLogAreas({
|
|
|
2565
2647
|
description: "A bridge process was launched in a container, for the first time there or as a relaunch; `provider` names it. A relaunch keeps the run before it in the previous log.",
|
|
2566
2648
|
essential: true,
|
|
2567
2649
|
fields: { provider: "label", containerPort: "number" }
|
|
2650
|
+
},
|
|
2651
|
+
"bridge.listener-refused": {
|
|
2652
|
+
description: "The socket listening on a container bridge's port is not the one the bridge the backend started opened (to-do 7250), so its token is not handed out and the next start replaces it. `reason` is a fixed label: `different-socket`, `several-sockets`, `pending` (a start has not recorded its bridge yet, or failed before it did) or `scan-incomplete`.",
|
|
2653
|
+
essential: true,
|
|
2654
|
+
fields: { provider: "label", reason: "label" }
|
|
2655
|
+
},
|
|
2656
|
+
"bridge.listener-adopted": "A running container bridge had no listener record, because a backend from before the record started it, so the socket on its port was recorded as the bridge's; `provider` names it.",
|
|
2657
|
+
"bridge.listener-unrecorded": {
|
|
2658
|
+
description: "A bridge the backend just launched could not be recorded as its port's listener, for the fixed `reason` given (`no-listener`, `several-sockets`, `launch-exited` or `scan-incomplete`); what listens on the port is stopped and the start fails.",
|
|
2659
|
+
essential: true,
|
|
2660
|
+
fields: { provider: "label", reason: "label" }
|
|
2568
2661
|
}
|
|
2569
2662
|
}
|
|
2570
2663
|
},
|
|
@@ -2619,7 +2712,8 @@ var MCP_LOG_AREAS = defineLogAreas({
|
|
|
2619
2712
|
"listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
|
|
2620
2713
|
"state-listener.failed": "A Control MCP state listener threw; the others still run.",
|
|
2621
2714
|
"delegation.remote-open-failed": "A delegation could not be opened on another node.",
|
|
2622
|
-
"delegation.open-failed": "A coordinator delegation could not be opened."
|
|
2715
|
+
"delegation.open-failed": "A coordinator delegation could not be opened.",
|
|
2716
|
+
"delegation.turn-origin-unreadable": "A coordinator's last turn origin could not be read, so its delegated prompt is marked as arising from agent mail."
|
|
2623
2717
|
}
|
|
2624
2718
|
},
|
|
2625
2719
|
"mcp-management": {
|
|
@@ -2704,6 +2798,7 @@ var NODES_LOG_AREAS = defineLogAreas({
|
|
|
2704
2798
|
"ticket-sync.failed": "A Kanban sync with a node failed; it is retried.",
|
|
2705
2799
|
"ticket-sync.unknown-project": "A node sent ticket changes for a project that no longer exists here.",
|
|
2706
2800
|
"ticket-sync.forget-failed": "A detached command node's ticket copies could not be released.",
|
|
2801
|
+
"usage-sync.failed": "Sharing usage readings with a node failed; the next reading or reconnect retries.",
|
|
2707
2802
|
"fleet-update.requested": "The update policy asked an older leaf to install the command node's version.",
|
|
2708
2803
|
"fleet-update.failed": "The update policy could not read or update a leaf; it retries later.",
|
|
2709
2804
|
"fleet-update.policy-load-failed": "The stored update policy could not be read; it is off."
|
|
@@ -2795,6 +2890,20 @@ var SCHEDULER_LOG_AREAS = defineLogAreas({
|
|
|
2795
2890
|
}
|
|
2796
2891
|
});
|
|
2797
2892
|
|
|
2893
|
+
// ../protocol/src/log-vocabulary/self-improvement.ts
|
|
2894
|
+
var SELF_IMPROVEMENT_LOG_AREAS = defineLogAreas({
|
|
2895
|
+
"self-improvement": {
|
|
2896
|
+
description: "Self-improvement runs: diagnostics and conversation review turned into tickets. Counts and steps only, never conversation text.",
|
|
2897
|
+
events: {
|
|
2898
|
+
"run.started": "A run started; `trigger` is manual, daily or dry-run.",
|
|
2899
|
+
"run.finished": "A run finished; `created`, `verified`, `fixFailed` and `parts` count its tickets, confirmed fixes, failed fixes and conversation parts read.",
|
|
2900
|
+
"run.failed": "A run stopped before it finished; `reason` is a fixed label.",
|
|
2901
|
+
"review.call-failed": "One conversation review call failed; the run carries on and the part is read again next run.",
|
|
2902
|
+
"daily.check-failed": "The daily run check failed; the next check retries."
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
});
|
|
2906
|
+
|
|
2798
2907
|
// ../protocol/src/log-vocabulary/web-app.ts
|
|
2799
2908
|
var WEB_APP_LOG_AREAS = defineLogAreas({
|
|
2800
2909
|
"web.app": {
|
|
@@ -3130,6 +3239,10 @@ var WEB_SETTINGS_LOG_AREAS = defineLogAreas({
|
|
|
3130
3239
|
"web.settings": {
|
|
3131
3240
|
description: "The settings screens.",
|
|
3132
3241
|
events: {
|
|
3242
|
+
"self-improvement.status-failed": "Settings → Self-improvement could not read the status.",
|
|
3243
|
+
"self-improvement.projects-failed": "Settings → Self-improvement could not list the projects.",
|
|
3244
|
+
"self-improvement.save-failed": "Settings → Self-improvement could not save a setting.",
|
|
3245
|
+
"self-improvement.run-failed": "Settings → Self-improvement could not start a run.",
|
|
3133
3246
|
"config.save-failed": "Global settings could not be saved.",
|
|
3134
3247
|
"config.load-failed": "The settings page could not load the config.",
|
|
3135
3248
|
"config.reload-failed": "Re-reading the workspace config after a save failed.",
|
|
@@ -3299,6 +3412,7 @@ var LOG_VOCABULARY = {
|
|
|
3299
3412
|
...HOST_LOG_AREAS,
|
|
3300
3413
|
...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
|
|
3301
3414
|
...SCHEDULER_LOG_AREAS,
|
|
3415
|
+
...SELF_IMPROVEMENT_LOG_AREAS,
|
|
3302
3416
|
...WEB_APP_LOG_AREAS,
|
|
3303
3417
|
...WEB_BUILD_PIPELINE_LOG_AREAS,
|
|
3304
3418
|
...WEB_CHAT_LOG_AREAS,
|
|
@@ -3599,6 +3713,14 @@ var SIGNALS = new Set([
|
|
|
3599
3713
|
"SIGXFSZ"
|
|
3600
3714
|
]);
|
|
3601
3715
|
var PROVIDERS3 = new Set(["claude", "codex", "opencode", "cursor", "grok", "acp", "pi"]);
|
|
3716
|
+
var BRIDGE_LISTENER_REASONS = new Set([
|
|
3717
|
+
"different-socket",
|
|
3718
|
+
"several-sockets",
|
|
3719
|
+
"pending",
|
|
3720
|
+
"scan-incomplete",
|
|
3721
|
+
"no-listener",
|
|
3722
|
+
"launch-exited"
|
|
3723
|
+
]);
|
|
3602
3724
|
var UUID = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
|
3603
3725
|
var SOURCE = new RegExp(`^(?:claude|codex|opencode|cursor|grok|acp|pi):${UUID}$`, "i");
|
|
3604
3726
|
var STORAGE_DATABASES = new Set(["main", "ledger", "other"]);
|
|
@@ -13617,6 +13739,11 @@ function toBridgeModel(model) {
|
|
|
13617
13739
|
defaultReasoningEffort: fallbackReasoningId(model.supportedReasoningEfforts.map((entry) => entry.effort), model.defaultReasoningEffort) ?? model.defaultReasoningEffort
|
|
13618
13740
|
};
|
|
13619
13741
|
}
|
|
13742
|
+
// ../protocol/src/terminal-text.ts
|
|
13743
|
+
var MAX_STRING_LENGTH = 8 * 1024;
|
|
13744
|
+
var BUDGET_FLOOR = 4 * 1024;
|
|
13745
|
+
var MAX_MOVE = 4 * 1024;
|
|
13746
|
+
|
|
13620
13747
|
// ../protocol/src/human-prompts.ts
|
|
13621
13748
|
var HUMAN_PROMPT_SCAN_BYTES = 16 * 1024;
|
|
13622
13749
|
var HUMAN_PROMPT_KINDS = new Set([
|
|
@@ -17093,8 +17220,9 @@ class TurnAccumulator {
|
|
|
17093
17220
|
settleEndedAttempt() {
|
|
17094
17221
|
this.interruptOpenAgentMessages();
|
|
17095
17222
|
for (const accumulator of this.items.values()) {
|
|
17096
|
-
if (!accumulator.completed && !accumulator.interrupted)
|
|
17223
|
+
if (!accumulator.completed && !accumulator.interrupted || accumulator.item?.type === "command_execution" && accumulator.item.status === "in_progress") {
|
|
17097
17224
|
this.touch(accumulator);
|
|
17225
|
+
}
|
|
17098
17226
|
}
|
|
17099
17227
|
}
|
|
17100
17228
|
recordRetryCard(id, text, state) {
|
|
@@ -17400,6 +17528,7 @@ function mcpToolCallParts(item) {
|
|
|
17400
17528
|
function commandExecutionParts(item) {
|
|
17401
17529
|
const output = capCommandOutput(item.aggregated_output);
|
|
17402
17530
|
const failed = item.status === "failed";
|
|
17531
|
+
const leftRunning = item.left_running === true && item.status === "in_progress";
|
|
17403
17532
|
return [
|
|
17404
17533
|
{
|
|
17405
17534
|
type: "tool-invocation",
|
|
@@ -17407,7 +17536,9 @@ function commandExecutionParts(item) {
|
|
|
17407
17536
|
content: item.command,
|
|
17408
17537
|
toolName: "bash",
|
|
17409
17538
|
toolArgs: { command: item.command },
|
|
17410
|
-
|
|
17539
|
+
...leftRunning ? { toolLeftRunning: true } : {
|
|
17540
|
+
toolState: item.status === "failed" ? "failure" : item.status === "completed" ? "success" : "pending"
|
|
17541
|
+
},
|
|
17411
17542
|
toolTitle: item.command,
|
|
17412
17543
|
toolOutput: failed ? undefined : output || undefined,
|
|
17413
17544
|
toolError: failed ? output || "Command failed" : undefined,
|
|
@@ -17773,6 +17904,40 @@ function rolloutCommandExecutionParts(item) {
|
|
|
17773
17904
|
});
|
|
17774
17905
|
return adapted?.type === "command_execution" ? commandExecutionParts(adapted) : null;
|
|
17775
17906
|
}
|
|
17907
|
+
|
|
17908
|
+
class ReplayCommandSettlement {
|
|
17909
|
+
slots = new Map;
|
|
17910
|
+
terminal = false;
|
|
17911
|
+
reset() {
|
|
17912
|
+
this.slots.clear();
|
|
17913
|
+
this.terminal = false;
|
|
17914
|
+
}
|
|
17915
|
+
settle() {
|
|
17916
|
+
this.terminal = true;
|
|
17917
|
+
for (const { parts, index } of this.slots.values())
|
|
17918
|
+
this.settlePart(parts[index]);
|
|
17919
|
+
}
|
|
17920
|
+
settlePart(part) {
|
|
17921
|
+
if (this.terminal && part.toolState === "pending") {
|
|
17922
|
+
delete part.toolState;
|
|
17923
|
+
part.toolLeftRunning = true;
|
|
17924
|
+
}
|
|
17925
|
+
}
|
|
17926
|
+
update(id, incoming) {
|
|
17927
|
+
const slot = this.slots.get(id);
|
|
17928
|
+
if (!slot)
|
|
17929
|
+
return false;
|
|
17930
|
+
slot.parts[slot.index] = incoming[0];
|
|
17931
|
+
this.settlePart(slot.parts[slot.index]);
|
|
17932
|
+
return true;
|
|
17933
|
+
}
|
|
17934
|
+
append(id, target, incoming) {
|
|
17935
|
+
const index = target.length;
|
|
17936
|
+
target.push(...incoming);
|
|
17937
|
+
this.slots.set(id, { parts: target, index });
|
|
17938
|
+
this.settlePart(target[index]);
|
|
17939
|
+
}
|
|
17940
|
+
}
|
|
17776
17941
|
// ../protocol/src/coordinator.ts
|
|
17777
17942
|
var COORDINATOR_CODEX_USER_SKILLS_DIR_ENV = "ORKESTRATOR_COORDINATOR_CODEX_USER_SKILLS_DIR";
|
|
17778
17943
|
var COORDINATOR_OTHER_ENVIRONMENTS_SETTING_LABEL = "Let the coordinator use environments it did not create";
|
|
@@ -18909,6 +19074,7 @@ async function replayPersistedRollout(threadId, snapshot, meta, structuredTurns)
|
|
|
18909
19074
|
const messages = [];
|
|
18910
19075
|
const toolPartsByCallId = new Map;
|
|
18911
19076
|
const turnCallIds = new Set;
|
|
19077
|
+
const commandSettlement = new ReplayCommandSettlement;
|
|
18912
19078
|
const transcriptCwd = asNonEmptyString2(meta.cwd) ?? getWorkingDirectory();
|
|
18913
19079
|
let currentTurnId;
|
|
18914
19080
|
let currentTurnModel;
|
|
@@ -19030,6 +19196,8 @@ async function replayPersistedRollout(threadId, snapshot, meta, structuredTurns)
|
|
|
19030
19196
|
const open = [...openCells.values()];
|
|
19031
19197
|
const parts = rolloutCommandExecutionParts(item);
|
|
19032
19198
|
const id = asNonEmptyString2(item.id);
|
|
19199
|
+
if (parts && id && commandSettlement.update(id, parts))
|
|
19200
|
+
return;
|
|
19033
19201
|
const direct = id !== undefined && turnCallIds.has(id);
|
|
19034
19202
|
if (!parts || direct || open.length !== 1) {
|
|
19035
19203
|
for (const cell of open)
|
|
@@ -19038,7 +19206,7 @@ async function replayPersistedRollout(threadId, snapshot, meta, structuredTurns)
|
|
|
19038
19206
|
}
|
|
19039
19207
|
const cell = open[0];
|
|
19040
19208
|
cell.sawCommandRecord = true;
|
|
19041
|
-
cell.message.parts
|
|
19209
|
+
commandSettlement.append(id, cell.message.parts, parts);
|
|
19042
19210
|
};
|
|
19043
19211
|
const visitCompletedItem = (item, timestamp) => {
|
|
19044
19212
|
if (!item || typeof item !== "object" || Array.isArray(item))
|
|
@@ -19161,6 +19329,7 @@ async function replayPersistedRollout(threadId, snapshot, meta, structuredTurns)
|
|
|
19161
19329
|
const recordTurnId = readTurnId(record.payload);
|
|
19162
19330
|
if (recordTurnId && recordTurnId !== currentTurnId) {
|
|
19163
19331
|
settleOpenCells();
|
|
19332
|
+
commandSettlement.reset();
|
|
19164
19333
|
currentTurnId = recordTurnId;
|
|
19165
19334
|
turnCallIds.clear();
|
|
19166
19335
|
typedPromptConsumed = false;
|
|
@@ -19184,7 +19353,10 @@ async function replayPersistedRollout(threadId, snapshot, meta, structuredTurns)
|
|
|
19184
19353
|
}
|
|
19185
19354
|
return;
|
|
19186
19355
|
}
|
|
19356
|
+
if (record.type === "event_msg" && record.payload?.type === "turn_aborted")
|
|
19357
|
+
commandSettlement.settle();
|
|
19187
19358
|
if (record.type === "event_msg" && record.payload?.type === "task_complete") {
|
|
19359
|
+
commandSettlement.settle();
|
|
19188
19360
|
const error = record.payload.error;
|
|
19189
19361
|
if (error && typeof error === "object" && typeof error.message === "string") {
|
|
19190
19362
|
ensureAssistantMessage(timestamp).parts.push({
|
|
@@ -19431,12 +19603,13 @@ function effectiveItem(turn, accumulator) {
|
|
|
19431
19603
|
}
|
|
19432
19604
|
switch (item.type) {
|
|
19433
19605
|
case "command_execution": {
|
|
19434
|
-
|
|
19435
|
-
|
|
19606
|
+
const settled = item.status === "in_progress" && turn.isTerminal() ? { ...item, left_running: true } : item;
|
|
19607
|
+
if (settled.aggregated_output && settled.aggregated_output.length > 0)
|
|
19608
|
+
return settled;
|
|
19436
19609
|
if (accumulator.outputDelta.length === 0)
|
|
19437
|
-
return
|
|
19610
|
+
return settled;
|
|
19438
19611
|
return {
|
|
19439
|
-
...
|
|
19612
|
+
...settled,
|
|
19440
19613
|
aggregated_output: accumulator.outputDelta + (accumulator.outputTruncated ? TRUNCATION_NOTICE : "")
|
|
19441
19614
|
};
|
|
19442
19615
|
}
|
|
@@ -19798,7 +19971,8 @@ async function renderTurn(turn, options) {
|
|
|
19798
19971
|
const accumulator = accumulatorsByKey.get(itemId);
|
|
19799
19972
|
const cached = options.state.completedItemParts.get(itemId);
|
|
19800
19973
|
const suppressDraft = suppressStructuredOutputDraft(turn, options.state, accumulator, item, structuredOutputItemId);
|
|
19801
|
-
|
|
19974
|
+
const leftRunning = item.type === "command_execution" && item.left_running === true;
|
|
19975
|
+
if (accumulator?.completed && cached?.source === accumulator.item && cached.commandChanges === accumulator.commandChanges && cached.leftRunning === true === leftRunning) {
|
|
19802
19976
|
if (!suppressDraft)
|
|
19803
19977
|
parts.push(...cached.parts);
|
|
19804
19978
|
} else {
|
|
@@ -19823,6 +19997,7 @@ async function renderTurn(turn, options) {
|
|
|
19823
19997
|
options.state.completedItemParts.set(itemId, {
|
|
19824
19998
|
source: accumulator.item,
|
|
19825
19999
|
...accumulator.commandChanges ? { commandChanges: accumulator.commandChanges } : {},
|
|
20000
|
+
...leftRunning ? { leftRunning: true } : {},
|
|
19826
20001
|
parts: stampedParts
|
|
19827
20002
|
});
|
|
19828
20003
|
} else {
|
|
@@ -20174,58 +20349,6 @@ async function publishAssistantRows(context, state, turn, options) {
|
|
|
20174
20349
|
// ../../bridges/codex-bridge/src/app-server-runtime-sessions.ts
|
|
20175
20350
|
import { createHash as createHash14, randomUUID as randomUUID9 } from "node:crypto";
|
|
20176
20351
|
|
|
20177
|
-
// ../protocol/src/agent-mail.ts
|
|
20178
|
-
var AGENT_MAIL_MAX_BODY_BYTES = 32 * 1024;
|
|
20179
|
-
var AGENT_MAIL_MAX_STORE_BYTES = 32 * 1024 * 1024;
|
|
20180
|
-
var AGENT_MAIL_DEFAULT_RETENTION_DAYS = 14;
|
|
20181
|
-
var AGENT_MAIL_MAX_ATTACHMENT_BYTES = 8 * 1024 * 1024;
|
|
20182
|
-
var AGENT_MAIL_MAX_TOTAL_ATTACHMENT_BYTES = 32 * 1024 * 1024;
|
|
20183
|
-
var AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET = 16;
|
|
20184
|
-
var AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT = 40;
|
|
20185
|
-
var AGENT_MAIL_TOOL_NAMES = Object.freeze([
|
|
20186
|
-
"list_mailboxes",
|
|
20187
|
-
"send_message",
|
|
20188
|
-
"check_inbox",
|
|
20189
|
-
"read_message",
|
|
20190
|
-
"ack_message",
|
|
20191
|
-
"reply_message",
|
|
20192
|
-
"get_message_status"
|
|
20193
|
-
]);
|
|
20194
|
-
var DEFAULT_AGENT_MESSAGING_SETTINGS = Object.freeze({
|
|
20195
|
-
enabled: true,
|
|
20196
|
-
allowCrossProject: false,
|
|
20197
|
-
defaultInjectPolicy: "off",
|
|
20198
|
-
wakePeers: false,
|
|
20199
|
-
autonomousWakeBudget: AGENT_MAIL_DEFAULT_AUTONOMOUS_WAKE_BUDGET,
|
|
20200
|
-
hourlyWakeLimit: AGENT_MAIL_DEFAULT_HOURLY_WAKE_LIMIT,
|
|
20201
|
-
coordinatorStatusWakes: "settled",
|
|
20202
|
-
retentionDays: AGENT_MAIL_DEFAULT_RETENTION_DAYS,
|
|
20203
|
-
paused: false
|
|
20204
|
-
});
|
|
20205
|
-
function agentMailCapabilities(tabType, agent, locked = true) {
|
|
20206
|
-
if (tabType === "agent-native") {
|
|
20207
|
-
if (!locked || !agent)
|
|
20208
|
-
return { canPull: false, canSend: false, canInject: false };
|
|
20209
|
-
if (agent === "claude" || agent === "codex" || agent === "opencode" || agent === "pi" || agent === "cursor" || agent === "grok") {
|
|
20210
|
-
return { canPull: true, canSend: true, canInject: true };
|
|
20211
|
-
}
|
|
20212
|
-
return { canPull: false, canSend: false, canInject: false };
|
|
20213
|
-
}
|
|
20214
|
-
if (tabType === "claude-tmux")
|
|
20215
|
-
return { canPull: true, canSend: true, canInject: true };
|
|
20216
|
-
if (tabType === "pipeline-worker") {
|
|
20217
|
-
return agent ? { canPull: true, canSend: true, canInject: true } : { canPull: false, canSend: false, canInject: false };
|
|
20218
|
-
}
|
|
20219
|
-
if (["claude", "codex", "opencode"].includes(tabType)) {
|
|
20220
|
-
return { canPull: true, canSend: true, canInject: false };
|
|
20221
|
-
}
|
|
20222
|
-
if (["cursor", "grok", "pi"].includes(tabType)) {
|
|
20223
|
-
return { canPull: false, canSend: false, canInject: false };
|
|
20224
|
-
}
|
|
20225
|
-
return { canPull: false, canSend: false, canInject: false };
|
|
20226
|
-
}
|
|
20227
|
-
var NATIVE_AGENT_MAIL_CAPABILITIES = Object.freeze(Object.fromEntries(AGENT_PLATFORMS.map((agent) => [agent, agentMailCapabilities("agent-native", agent)])));
|
|
20228
|
-
|
|
20229
20352
|
// ../protocol/src/rich-content-policy.ts
|
|
20230
20353
|
var KIB = 1024;
|
|
20231
20354
|
var MIB = 1024 * KIB;
|
|
@@ -25011,6 +25134,48 @@ function collect(config, exclusions) {
|
|
|
25011
25134
|
}
|
|
25012
25135
|
}
|
|
25013
25136
|
|
|
25137
|
+
// ../protocol/src/node/bounded-wait.ts
|
|
25138
|
+
function boundedWait(work, timeoutMs, options = {}) {
|
|
25139
|
+
return new Promise((resolve, reject) => {
|
|
25140
|
+
let timedOut = false;
|
|
25141
|
+
const timer = setTimeout(() => {
|
|
25142
|
+
timedOut = true;
|
|
25143
|
+
resolve({ settled: false });
|
|
25144
|
+
}, timeoutMs);
|
|
25145
|
+
unrefTimer(timer);
|
|
25146
|
+
Promise.resolve(work).then((value) => {
|
|
25147
|
+
if (!timedOut) {
|
|
25148
|
+
clearTimeout(timer);
|
|
25149
|
+
resolve({ settled: true, value });
|
|
25150
|
+
return;
|
|
25151
|
+
}
|
|
25152
|
+
disposeLate(options.onLate, value);
|
|
25153
|
+
}, (error) => {
|
|
25154
|
+
if (!timedOut) {
|
|
25155
|
+
clearTimeout(timer);
|
|
25156
|
+
reject(error);
|
|
25157
|
+
}
|
|
25158
|
+
});
|
|
25159
|
+
});
|
|
25160
|
+
}
|
|
25161
|
+
function unrefTimer(timer) {
|
|
25162
|
+
const handle = timer;
|
|
25163
|
+
if (typeof handle === "object" && typeof handle.unref === "function")
|
|
25164
|
+
handle.unref();
|
|
25165
|
+
}
|
|
25166
|
+
function disposeLate(onLate, value) {
|
|
25167
|
+
if (!onLate)
|
|
25168
|
+
return;
|
|
25169
|
+
try {
|
|
25170
|
+
const disposal = onLate(value);
|
|
25171
|
+
if (disposal && typeof disposal.then === "function") {
|
|
25172
|
+
Promise.resolve(disposal).catch(() => {
|
|
25173
|
+
return;
|
|
25174
|
+
});
|
|
25175
|
+
}
|
|
25176
|
+
} catch {}
|
|
25177
|
+
}
|
|
25178
|
+
|
|
25014
25179
|
// ../../bridges/codex-bridge/src/engine/mcp-tool-availability.ts
|
|
25015
25180
|
var ORKESTRATOR_MCP_STARTUP_TIMEOUT_SEC = 15;
|
|
25016
25181
|
var MCP_TOOL_AVAILABILITY_TIMEOUT_MS = (ORKESTRATOR_MCP_STARTUP_TIMEOUT_SEC + 5) * 1000;
|
|
@@ -25047,29 +25212,19 @@ async function waitForMcpToolAvailability(list, serverName, toolName, options =
|
|
|
25047
25212
|
const now = options.now ?? Date.now;
|
|
25048
25213
|
const deadline = now() + (options.timeoutMs ?? MCP_TOOL_AVAILABILITY_TIMEOUT_MS);
|
|
25049
25214
|
const pollMs = options.pollMs ?? MCP_TOOL_AVAILABILITY_POLL_MS;
|
|
25050
|
-
const expired = Symbol("availability-deadline");
|
|
25051
25215
|
for (;; ) {
|
|
25052
25216
|
const remainingMs = deadline - now();
|
|
25053
25217
|
if (remainingMs <= 0)
|
|
25054
25218
|
return { state: "unverified" };
|
|
25055
25219
|
let response;
|
|
25056
|
-
let timer;
|
|
25057
25220
|
try {
|
|
25058
|
-
response = await
|
|
25059
|
-
list(remainingMs),
|
|
25060
|
-
new Promise((resolve) => {
|
|
25061
|
-
timer = setTimeout(() => resolve(expired), remainingMs);
|
|
25062
|
-
timer.unref?.();
|
|
25063
|
-
})
|
|
25064
|
-
]);
|
|
25221
|
+
response = await boundedWait(list(remainingMs), remainingMs);
|
|
25065
25222
|
} catch {
|
|
25066
25223
|
return { state: "unverified" };
|
|
25067
|
-
} finally {
|
|
25068
|
-
clearTimeout(timer);
|
|
25069
25224
|
}
|
|
25070
|
-
if (response
|
|
25225
|
+
if (!response.settled || now() >= deadline)
|
|
25071
25226
|
return { state: "unverified" };
|
|
25072
|
-
const availability = classifyMcpToolAvailability(response, serverName, toolName);
|
|
25227
|
+
const availability = classifyMcpToolAvailability(response.value, serverName, toolName);
|
|
25073
25228
|
if (availability)
|
|
25074
25229
|
return availability;
|
|
25075
25230
|
await new Promise((resolve) => {
|
|
@@ -27694,6 +27849,9 @@ class CodexRuntimeSessions {
|
|
|
27694
27849
|
this.ctx = ctx;
|
|
27695
27850
|
this.lifecycle = lifecycle;
|
|
27696
27851
|
}
|
|
27852
|
+
sessionDeleteClaimed(session) {
|
|
27853
|
+
return this.deleteClaims.has(session);
|
|
27854
|
+
}
|
|
27697
27855
|
sessionAdmissionClosed(session) {
|
|
27698
27856
|
return this.ctx.closingSessionIds.has(session.id) || this.ctx.registry.getSession(session.id) !== session;
|
|
27699
27857
|
}
|
|
@@ -30696,16 +30854,8 @@ class CodexRuntimeLifecycle {
|
|
|
30696
30854
|
return false;
|
|
30697
30855
|
if (this.ctx.sessionRestore !== "restoring")
|
|
30698
30856
|
return true;
|
|
30699
|
-
|
|
30700
|
-
|
|
30701
|
-
timer = setTimeout(() => resolve(false), timeoutMs);
|
|
30702
|
-
timer.unref?.();
|
|
30703
|
-
});
|
|
30704
|
-
try {
|
|
30705
|
-
return await Promise.race([this.ctx.sessionsRestored.promise, timedOut]);
|
|
30706
|
-
} finally {
|
|
30707
|
-
clearTimeout(timer);
|
|
30708
|
-
}
|
|
30857
|
+
const restored = await boundedWait(this.ctx.sessionsRestored.promise, timeoutMs);
|
|
30858
|
+
return restored.settled && restored.value;
|
|
30709
30859
|
}
|
|
30710
30860
|
async stop() {
|
|
30711
30861
|
this.ctx.stopping = true;
|
|
@@ -32629,7 +32779,8 @@ class CodexRuntimePrompt {
|
|
|
32629
32779
|
const retryMessages = context.messages;
|
|
32630
32780
|
await this.ctx.journal.markRetryable(requestId);
|
|
32631
32781
|
await new Promise((resolve) => setTimeout(resolve, this.ctx.options.initialPromptRetryDelayMs ?? DEFAULT_INITIAL_PROMPT_RETRY_DELAY_MS));
|
|
32632
|
-
|
|
32782
|
+
const registeredSession = () => this.sessions.sessionDeleteClaimed(session) ? undefined : this.ctx.registry.getSession(session.id);
|
|
32783
|
+
let liveSession = registeredSession();
|
|
32633
32784
|
if (!this.ctx.stopping && liveSession === session && this.sessions.sessionAdmissionClosed(session)) {
|
|
32634
32785
|
return await refuseRetryForClose();
|
|
32635
32786
|
}
|
|
@@ -32648,7 +32799,7 @@ class CodexRuntimePrompt {
|
|
|
32648
32799
|
return { ok: false, status: 404, error: "Session not found" };
|
|
32649
32800
|
}
|
|
32650
32801
|
await this.ctx.generationRecovery;
|
|
32651
|
-
liveSession =
|
|
32802
|
+
liveSession = registeredSession();
|
|
32652
32803
|
if (!this.ctx.stopping && liveSession === session && this.sessions.sessionAdmissionClosed(session)) {
|
|
32653
32804
|
return await refuseRetryForClose();
|
|
32654
32805
|
}
|
|
@@ -35422,7 +35573,7 @@ app.get("/session/:id/mcp", async (c) => {
|
|
|
35422
35573
|
if (typeof server.name !== "string")
|
|
35423
35574
|
return [];
|
|
35424
35575
|
const status = server.authStatus === "notLoggedIn" || server.runtimeStatus === "authenticationRequired" ? "needs-auth" : server.runtimeStatus === "connected" ? "connected" : server.runtimeStatus === "starting" ? "connecting" : server.runtimeStatus === "disabled" ? "disabled" : server.runtimeStatus === "failed" || server.runtimeStatus === "cancelled" ? "failed" : "unknown";
|
|
35425
|
-
const tools = server.tools && typeof server.tools === "object" ? Object.keys(server.tools).slice(0, 256) : [];
|
|
35576
|
+
const tools = server.tools && typeof server.tools === "object" ? Object.keys(server.tools).sort().slice(0, 256) : [];
|
|
35426
35577
|
return [
|
|
35427
35578
|
{
|
|
35428
35579
|
id: server.name,
|