@ponythewhite/base-context 1.0.13 → 1.0.15
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/CHANGELOG.md +18 -0
- package/dist/base-context-runtime/pyproject.toml +1 -1
- package/dist/base-context-runtime/uv.lock +1 -1
- package/dist/build-info.json +1 -1
- package/dist/bundle/amazon-bedrock.js +3 -3
- package/dist/bundle/{anthropic-BJVPUMPB.js → anthropic-AXUXEET7.js} +1 -1
- package/dist/bundle/{azure-openai-responses-ERRMAXK6.js → azure-openai-responses-J3NTJKEO.js} +2 -2
- package/dist/bundle/{bundled-modules-URKVA3UB.js → bundled-modules-O67MEO74.js} +5 -5
- package/dist/bundle/{chunk-FOGKLC7V.js → chunk-72LSQYUV.js} +1 -1
- package/dist/bundle/{chunk-TXVF6Q5H.js → chunk-DGO66I3L.js} +87 -51
- package/dist/bundle/{chunk-MUFZODP5.js → chunk-EGFIZABJ.js} +1 -1
- package/dist/bundle/{chunk-AEMRBMI2.js → chunk-IEM74GZ5.js} +9 -9
- package/dist/bundle/{chunk-25VYRAC6.js → chunk-JKKXN6JE.js} +72 -0
- package/dist/bundle/{chunk-TKOBEJ5E.js → chunk-RQFC34FM.js} +151 -51
- package/dist/bundle/{chunk-Q6UAHLII.js → chunk-V6LOBH6X.js} +2 -2
- package/dist/bundle/{cli-main-ZTJM5EEH.js → cli-main-2RER6PBE.js} +4 -4
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/{google-4GA4YMUX.js → google-QLKV2ZLC.js} +2 -2
- package/dist/bundle/{google-vertex-7AMALD7D.js → google-vertex-UGLUZV6B.js} +2 -2
- package/dist/bundle/{main-53I74INO.js → main-YERLD3T4.js} +5 -5
- package/dist/bundle/{mistral-74BXMNRM.js → mistral-2ITSLHYF.js} +1 -1
- package/dist/bundle/{openai-codex-responses-COXNC4IH.js → openai-codex-responses-FRREQXS3.js} +5 -4
- package/dist/bundle/{openai-completions-BCSA5Q6S.js → openai-completions-HF6UPPLW.js} +1 -1
- package/dist/bundle/{openai-responses-ONCIZSJS.js → openai-responses-LRTMBDFW.js} +2 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +42 -25
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/autonomous.d.ts +2 -0
- package/dist/core/autonomous.d.ts.map +1 -1
- package/dist/core/autonomous.js +4 -0
- package/dist/core/autonomous.js.map +1 -1
- package/dist/core/canonical-context.d.ts.map +1 -1
- package/dist/core/canonical-context.js +7 -0
- package/dist/core/canonical-context.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +11 -9
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/inference-coordinator.d.ts.map +1 -1
- package/dist/core/inference-coordinator.js +13 -2
- package/dist/core/inference-coordinator.js.map +1 -1
- package/dist/core/kernel/repl-manager.d.ts.map +1 -1
- package/dist/core/kernel/repl-manager.js +5 -0
- package/dist/core/kernel/repl-manager.js.map +1 -1
- package/dist/core/public-context.d.ts.map +1 -1
- package/dist/core/public-context.js +2 -0
- package/dist/core/public-context.js.map +1 -1
- package/dist/core/session-manager.d.ts +8 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +57 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/view-units.d.ts.map +1 -1
- package/dist/core/view-units.js +3 -0
- package/dist/core/view-units.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/daemon/daemon-mode.d.ts.map +1 -1
- package/dist/modes/daemon/daemon-mode.js +21 -20
- package/dist/modes/daemon/daemon-mode.js.map +1 -1
- package/dist/modes/daemon/daemon-supervisor.d.ts.map +1 -1
- package/dist/modes/daemon/daemon-supervisor.js +11 -5
- package/dist/modes/daemon/daemon-supervisor.js.map +1 -1
- package/dist/modes/daemon/daemon-worker-client.d.ts +1 -0
- package/dist/modes/daemon/daemon-worker-client.d.ts.map +1 -1
- package/dist/modes/daemon/daemon-worker-client.js +8 -0
- package/dist/modes/daemon/daemon-worker-client.js.map +1 -1
- package/dist/modes/daemon/daemon-worker-protocol.d.ts +3 -0
- package/dist/modes/daemon/daemon-worker-protocol.d.ts.map +1 -1
- package/dist/modes/daemon/daemon-worker-protocol.js +2 -0
- package/dist/modes/daemon/daemon-worker-protocol.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +29 -4
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +24 -21
- package/dist/modes/print-mode.js.map +1 -1
- package/docs/json.md +14 -1
- package/docs/long-running-agents.md +23 -2
- package/docs/providers.md +17 -0
- package/docs/upstream-1.0.15.md +83 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.15] - 2026-09-28
|
|
4
|
+
|
|
5
|
+
- Fixed compaction of long-lived sessions by selecting the active canonical context before source hydration. This covers manual, agent-requested, threshold, and overflow-recovery compaction without increasing source limits.
|
|
6
|
+
- Fixed Codex HTTP retries losing native context acknowledgement after retryable failures. Only an unchanged prepared request can reuse its acknowledged epoch.
|
|
7
|
+
- Changed `/goal stop` and `/goal clear` to acknowledge the goal that was cleared instead of reporting only the resulting idle state.
|
|
8
|
+
- Fixed daemon worker connection retries retaining failed socket and channel references.
|
|
9
|
+
- Handled Python kernel stderr stream errors through the existing kernel error path.
|
|
10
|
+
- Fixed the goal status display being overwritten by delayed state reads and streamed catch-up snapshots.
|
|
11
|
+
|
|
12
|
+
## [1.0.14] - 2026-09-23
|
|
13
|
+
|
|
14
|
+
- Fixed compaction recovery after failed or interrupted partial tool calls, including resuming affected saved sessions without exposing failed replies to the provider.
|
|
15
|
+
- Fixed autonomous turn, token, and time limits being bypassed by native tool loops. Limits now stop at a completed tool-turn boundary before another request.
|
|
16
|
+
- Fixed JSON print mode returning success for terminal assistant, session-command, or compaction failures. Capped autonomous runs no longer treat unrun quality gates as passed.
|
|
17
|
+
- Documented headless error handling, client-owned versus resident lifetimes, stable session IDs, and goal/autonomous token-budget semantics.
|
|
18
|
+
- Fixed unknown explicit CLI models falling back to a saved model during startup.
|
|
19
|
+
- Fixed daemon sessions using `--session-dir` so custom transcript storage no longer fails RLM family ownership checks.
|
|
20
|
+
|
|
3
21
|
## [1.0.13] - 2026-09-21
|
|
4
22
|
|
|
5
23
|
- Changed the default automatic compaction target to 90% of the model context window, retaining required-context headroom, the output reserve, and earlier agent-requested compaction.
|
package/dist/build-info.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createRequire as __piBundleCreateRequire } from 'node:module'; const require = __piBundleCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
writeFileLogEntry
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-V6LOBH6X.js";
|
|
5
|
+
import "./chunk-IEM74GZ5.js";
|
|
6
6
|
import "./chunk-5QCJ5DQU.js";
|
|
7
7
|
import "./chunk-CRBVRZBV.js";
|
|
8
8
|
import "./chunk-GRJFXLBM.js";
|
|
9
9
|
import "./chunk-2T7M7VJ4.js";
|
|
10
10
|
import "./chunk-DGNX7HQ3.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-JKKXN6JE.js";
|
|
12
12
|
import "./chunk-BAWSWWEU.js";
|
|
13
13
|
|
|
14
14
|
// dist/node/amazon-bedrock.js
|
package/dist/bundle/{azure-openai-responses-ERRMAXK6.js → azure-openai-responses-J3NTJKEO.js}
RENAMED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
convertResponsesMessages,
|
|
4
4
|
convertResponsesTools,
|
|
5
5
|
processResponsesStream
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EGFIZABJ.js";
|
|
7
7
|
import "./chunk-NQB5DCFC.js";
|
|
8
8
|
import {
|
|
9
9
|
AzureOpenAI
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
formatStreamFailureMessage,
|
|
26
26
|
recordStreamFailure,
|
|
27
27
|
streamFailureFromStopReason
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JKKXN6JE.js";
|
|
29
29
|
import "./chunk-BAWSWWEU.js";
|
|
30
30
|
|
|
31
31
|
// ../ai/src/providers/azure-openai-responses.ts
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
oauth_exports,
|
|
52
52
|
runPrintMode,
|
|
53
53
|
runRpcMode
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-DGO66I3L.js";
|
|
55
55
|
import {
|
|
56
56
|
AgentSession,
|
|
57
57
|
CURRENT_SESSION_VERSION,
|
|
@@ -143,15 +143,15 @@ import {
|
|
|
143
143
|
withFileMutationQueue,
|
|
144
144
|
wrapRegisteredTool,
|
|
145
145
|
wrapRegisteredTools
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-RQFC34FM.js";
|
|
147
147
|
import "./chunk-CFNASUYO.js";
|
|
148
|
-
import "./chunk-
|
|
148
|
+
import "./chunk-V6LOBH6X.js";
|
|
149
149
|
import {
|
|
150
150
|
VERSION,
|
|
151
151
|
build_exports,
|
|
152
152
|
getAgentDir,
|
|
153
153
|
src_exports
|
|
154
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-IEM74GZ5.js";
|
|
155
155
|
import "./chunk-5QCJ5DQU.js";
|
|
156
156
|
import {
|
|
157
157
|
compile_exports,
|
|
@@ -162,7 +162,7 @@ import "./chunk-2T7M7VJ4.js";
|
|
|
162
162
|
import "./chunk-UIRUOAIQ.js";
|
|
163
163
|
import "./chunk-HXOBFFJX.js";
|
|
164
164
|
import "./chunk-DGNX7HQ3.js";
|
|
165
|
-
import "./chunk-
|
|
165
|
+
import "./chunk-JKKXN6JE.js";
|
|
166
166
|
import {
|
|
167
167
|
__export
|
|
168
168
|
} from "./chunk-BAWSWWEU.js";
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
DAEMON_WORKER_INSTANCE_ID_ENV,
|
|
42
42
|
DAEMON_WORKER_PEER_TRANSPORT_CAPABILITY,
|
|
43
43
|
DAEMON_WORKER_RECOVERY_JOURNAL_ENV,
|
|
44
|
+
DAEMON_WORKER_RLM_LEDGER_SESSION_DIR_ENV,
|
|
44
45
|
DAEMON_WORKER_ROLE_ENV,
|
|
45
46
|
DAEMON_WORKER_ROSTER_CAPABILITY,
|
|
46
47
|
DAEMON_WORKER_STARTUP_GATE_COMMIT,
|
|
@@ -351,7 +352,7 @@ import {
|
|
|
351
352
|
watchWithErrorHandler,
|
|
352
353
|
workerRosterEntryFromSummary,
|
|
353
354
|
wrapTextWithAnsi
|
|
354
|
-
} from "./chunk-
|
|
355
|
+
} from "./chunk-RQFC34FM.js";
|
|
355
356
|
import {
|
|
356
357
|
array,
|
|
357
358
|
boolean,
|
|
@@ -370,7 +371,7 @@ import {
|
|
|
370
371
|
import {
|
|
371
372
|
installFileLogSink,
|
|
372
373
|
setLogContext
|
|
373
|
-
} from "./chunk-
|
|
374
|
+
} from "./chunk-V6LOBH6X.js";
|
|
374
375
|
import {
|
|
375
376
|
APP_NAME,
|
|
376
377
|
APP_TITLE,
|
|
@@ -416,7 +417,7 @@ import {
|
|
|
416
417
|
shouldUseWindowsShell,
|
|
417
418
|
signalProcessGroupOrProcess,
|
|
418
419
|
typebox_exports
|
|
419
|
-
} from "./chunk-
|
|
420
|
+
} from "./chunk-IEM74GZ5.js";
|
|
420
421
|
import {
|
|
421
422
|
PRODUCT,
|
|
422
423
|
PRODUCT_ENV
|
|
@@ -438,7 +439,7 @@ import {
|
|
|
438
439
|
getProviders,
|
|
439
440
|
modelsAreEqual,
|
|
440
441
|
supportsFastMode
|
|
441
|
-
} from "./chunk-
|
|
442
|
+
} from "./chunk-JKKXN6JE.js";
|
|
442
443
|
import {
|
|
443
444
|
__commonJS,
|
|
444
445
|
__export,
|
|
@@ -17248,6 +17249,7 @@ var DaemonWorkerClient = class {
|
|
|
17248
17249
|
await new Promise((resolve26, reject) => {
|
|
17249
17250
|
const timeout = setTimeout(() => {
|
|
17250
17251
|
cleanup();
|
|
17252
|
+
this.clearSocketReference(socket);
|
|
17251
17253
|
socket.destroy();
|
|
17252
17254
|
reject(new Error(`Timed out connecting to daemon worker socket: ${this.socketPath}`));
|
|
17253
17255
|
}, timeoutMs);
|
|
@@ -17262,6 +17264,7 @@ var DaemonWorkerClient = class {
|
|
|
17262
17264
|
};
|
|
17263
17265
|
const onError = (error) => {
|
|
17264
17266
|
cleanup();
|
|
17267
|
+
this.clearSocketReference(socket);
|
|
17265
17268
|
reject(error);
|
|
17266
17269
|
};
|
|
17267
17270
|
socket.once("connect", onConnect);
|
|
@@ -17475,6 +17478,12 @@ var DaemonWorkerClient = class {
|
|
|
17475
17478
|
waiter.reject(error);
|
|
17476
17479
|
}
|
|
17477
17480
|
}
|
|
17481
|
+
clearSocketReference(socket) {
|
|
17482
|
+
if (this.socket !== socket)
|
|
17483
|
+
return;
|
|
17484
|
+
this.socket = void 0;
|
|
17485
|
+
this.channel = void 0;
|
|
17486
|
+
}
|
|
17478
17487
|
notifyClosed(socket, error) {
|
|
17479
17488
|
if (this.socket !== socket) {
|
|
17480
17489
|
return;
|
|
@@ -50505,13 +50514,16 @@ ${warningLines}`, 0, 0));
|
|
|
50505
50514
|
}
|
|
50506
50515
|
async refreshConnectionCatalog() {
|
|
50507
50516
|
this.invalidateConnectionModelRefresh();
|
|
50517
|
+
const read = this.captureConnectionStateRead();
|
|
50508
50518
|
const [state, commands, modelCatalog, resources] = await Promise.all([
|
|
50509
50519
|
this.agentConnection.getState(),
|
|
50510
50520
|
this.agentConnection.getCommands().catch(() => []),
|
|
50511
50521
|
this.agentConnection.getModelCatalog(),
|
|
50512
50522
|
this.agentConnection.getResourceSnapshot()
|
|
50513
50523
|
]);
|
|
50514
|
-
this.
|
|
50524
|
+
if (!this.isConnectionStateReadCurrent(read))
|
|
50525
|
+
return;
|
|
50526
|
+
this.applyConnectionStateSnapshot(state, read);
|
|
50515
50527
|
this.connectionCommands = commands;
|
|
50516
50528
|
this.applyConnectionModelCatalog(modelCatalog);
|
|
50517
50529
|
this.connectionModelsFetchedAt = Date.now();
|
|
@@ -50548,7 +50560,21 @@ ${warningLines}`, 0, 0));
|
|
|
50548
50560
|
getScopedHeartbeats() {
|
|
50549
50561
|
return scopeHeartbeatsToSession(this.heartbeatCatalog, this.connectionState, this.subagentSnapshots.values());
|
|
50550
50562
|
}
|
|
50551
|
-
|
|
50563
|
+
captureConnectionStateRead() {
|
|
50564
|
+
return {
|
|
50565
|
+
connection: this.agentConnection,
|
|
50566
|
+
generation: this.sessionEventGeneration,
|
|
50567
|
+
goal: this.connectionState?.goal
|
|
50568
|
+
};
|
|
50569
|
+
}
|
|
50570
|
+
isConnectionStateReadCurrent(read) {
|
|
50571
|
+
return read.connection === this.agentConnection && read.generation === this.sessionEventGeneration;
|
|
50572
|
+
}
|
|
50573
|
+
applyConnectionStateSnapshot(state, read) {
|
|
50574
|
+
const current = this.connectionState;
|
|
50575
|
+
if (read && current?.sessionId === state.sessionId && current.goal !== read.goal) {
|
|
50576
|
+
state = { ...state, goal: current.goal };
|
|
50577
|
+
}
|
|
50552
50578
|
this.bindPromptStashSession(state.sessionId);
|
|
50553
50579
|
this.connectionState = state;
|
|
50554
50580
|
this.scheduleHeartbeatManagerRefresh();
|
|
@@ -53799,13 +53825,16 @@ ${message}`, ["Yes", "No"], opts);
|
|
|
53799
53825
|
this.ui.requestRender();
|
|
53800
53826
|
}
|
|
53801
53827
|
async renderInitialMessages() {
|
|
53828
|
+
const read = this.captureConnectionStateRead();
|
|
53802
53829
|
const snapshot = await this.agentConnection.getInitialSnapshot();
|
|
53830
|
+
if (!this.isConnectionStateReadCurrent(read))
|
|
53831
|
+
return;
|
|
53803
53832
|
const context = this.getSessionContextFromConnectionSnapshot(snapshot);
|
|
53804
53833
|
const state = snapshot.state;
|
|
53805
53834
|
const streamingMessage = snapshot.streamingMessage;
|
|
53806
53835
|
this.rlmNodeId = snapshot.parent?.childId;
|
|
53807
53836
|
this.seedSubagentSummary(snapshot.children);
|
|
53808
|
-
this.applyConnectionStateSnapshot(state);
|
|
53837
|
+
this.applyConnectionStateSnapshot(state, read);
|
|
53809
53838
|
this.restoreTurnStartFromMessages(context.messages);
|
|
53810
53839
|
await this.renderSessionContext(context, {
|
|
53811
53840
|
updateFooter: true,
|
|
@@ -54562,10 +54591,13 @@ ${message}`, ["Yes", "No"], opts);
|
|
|
54562
54591
|
return showFullPaneOverlay(this.ui, component, options);
|
|
54563
54592
|
}
|
|
54564
54593
|
async showSettingsSelector() {
|
|
54594
|
+
const read = this.captureConnectionStateRead();
|
|
54565
54595
|
let state;
|
|
54566
54596
|
try {
|
|
54567
54597
|
state = await this.agentConnection.getState();
|
|
54568
|
-
this.
|
|
54598
|
+
if (!this.isConnectionStateReadCurrent(read))
|
|
54599
|
+
return;
|
|
54600
|
+
this.applyConnectionStateSnapshot(state, read);
|
|
54569
54601
|
} catch (error) {
|
|
54570
54602
|
this.showError(error instanceof Error ? error.message : String(error));
|
|
54571
54603
|
return;
|
|
@@ -61120,7 +61152,8 @@ var AgentDaemon = class {
|
|
|
61120
61152
|
}
|
|
61121
61153
|
/** Root sessions dir that keys this daemon's spawn ledger. */
|
|
61122
61154
|
rlmLedgerSessionsDir() {
|
|
61123
|
-
|
|
61155
|
+
const assigned = this.options.worker ? process.env[DAEMON_WORKER_RLM_LEDGER_SESSION_DIR_ENV] : void 0;
|
|
61156
|
+
return assigned ?? this.options.defaultSessionConfig.sessionDir ?? getSessionsDir(this.agentDir);
|
|
61124
61157
|
}
|
|
61125
61158
|
async openRlmJournalOwner() {
|
|
61126
61159
|
if (this.options.worker)
|
|
@@ -63563,7 +63596,7 @@ var AgentDaemon = class {
|
|
|
63563
63596
|
cwd,
|
|
63564
63597
|
sessionDir,
|
|
63565
63598
|
agentDir: this.agentDir,
|
|
63566
|
-
ledgerSessionDir:
|
|
63599
|
+
ledgerSessionDir: this.rlmLedgerSessionsDir(),
|
|
63567
63600
|
scope: command.scope
|
|
63568
63601
|
}, pageQuery);
|
|
63569
63602
|
return success(command.id, "list_saved_sessions", page);
|
|
@@ -66271,6 +66304,9 @@ Use prime_context read/search with selected lines or a query.`;
|
|
|
66271
66304
|
if (!state || !state.clients.has(client)) {
|
|
66272
66305
|
continue;
|
|
66273
66306
|
}
|
|
66307
|
+
const streamsSnapshot = client.transport === "private-framed" && daemonClientCapabilitiesForSession(client, activeSessionId).has("chunked_snapshot");
|
|
66308
|
+
const snapshotSignal = streamsSnapshot ? markClientSnapshotStreaming(client, activeSessionId) : void 0;
|
|
66309
|
+
let ownsSnapshot = streamsSnapshot;
|
|
66274
66310
|
try {
|
|
66275
66311
|
const result = await this.createAttachResult(client, state, {
|
|
66276
66312
|
type: "attach",
|
|
@@ -66279,7 +66315,7 @@ Use prime_context read/search with selected lines or a query.`;
|
|
|
66279
66315
|
if (this.sessions.get(activeSessionId) !== state || !state.clients.has(client)) {
|
|
66280
66316
|
continue;
|
|
66281
66317
|
}
|
|
66282
|
-
if (
|
|
66318
|
+
if (snapshotSignal) {
|
|
66283
66319
|
if (purpose === "replacement") {
|
|
66284
66320
|
this.write(client, {
|
|
66285
66321
|
type: "session_replaced",
|
|
@@ -66291,20 +66327,14 @@ Use prime_context read/search with selected lines or a query.`;
|
|
|
66291
66327
|
});
|
|
66292
66328
|
}
|
|
66293
66329
|
const snapshotId = `${result.activeSessionId}-${result.lastEventCursor?.generation}-${result.lastEventSequence}`;
|
|
66294
|
-
const
|
|
66295
|
-
|
|
66296
|
-
|
|
66297
|
-
|
|
66298
|
-
|
|
66299
|
-
|
|
66300
|
-
|
|
66301
|
-
|
|
66302
|
-
signal: snapshotSignal
|
|
66303
|
-
});
|
|
66304
|
-
} catch (error) {
|
|
66305
|
-
finishClientSnapshotStreaming(client, activeSessionId);
|
|
66306
|
-
throw error;
|
|
66307
|
-
}
|
|
66330
|
+
const transcript = createSnapshotTranscriptChunks({
|
|
66331
|
+
activeSessionId,
|
|
66332
|
+
snapshotId,
|
|
66333
|
+
messages: result.snapshot.messages,
|
|
66334
|
+
targetChunkBytes: SNAPSHOT_TARGET_CHUNK_BYTES,
|
|
66335
|
+
signal: snapshotSignal
|
|
66336
|
+
});
|
|
66337
|
+
ownsSnapshot = false;
|
|
66308
66338
|
await this.streamWorkerSnapshot(client, {
|
|
66309
66339
|
...result,
|
|
66310
66340
|
messages: result.messages ? [] : void 0,
|
|
@@ -66338,6 +66368,9 @@ Use prime_context read/search with selected lines or a query.`;
|
|
|
66338
66368
|
this.log(`could not catch up client ${client.id} for ${activeSessionId}: ${String(error)}`);
|
|
66339
66369
|
this.scheduleClientCatchupRetry(client);
|
|
66340
66370
|
return "retry-later";
|
|
66371
|
+
} finally {
|
|
66372
|
+
if (ownsSnapshot)
|
|
66373
|
+
finishClientSnapshotStreaming(client, activeSessionId);
|
|
66341
66374
|
}
|
|
66342
66375
|
}
|
|
66343
66376
|
return "drained";
|
|
@@ -67103,7 +67136,7 @@ function isDaemonWorkerDescriptor(value, socketPath) {
|
|
|
67103
67136
|
return false;
|
|
67104
67137
|
}
|
|
67105
67138
|
const descriptor = value;
|
|
67106
|
-
return (descriptor.version === 1 || descriptor.version === 2) && typeof descriptor.supervisorSocketPath === "string" && normalizeSocketPath(descriptor.supervisorSocketPath) === socketPath && typeof descriptor.workerId === "string" && Number.isInteger(descriptor.pid) && (descriptor.pid ?? 0) > 0 && (descriptor.processStartId === void 0 || typeof descriptor.processStartId === "string") && (descriptor.ownerClientId === void 0 || typeof descriptor.ownerClientId === "string") && typeof descriptor.socketPath === "string" && typeof descriptor.authenticationToken === "string" && (descriptor.workerInstanceId === void 0 || typeof descriptor.workerInstanceId === "string") && typeof descriptor.rootActiveSessionId === "string" && typeof descriptor.createdAt === "string" && typeof descriptor.updatedAt === "string" && Number.isInteger(descriptor.consecutiveFailures) && descriptor.createCommand !== void 0 && typeof descriptor.createCommand === "object" && descriptor.createCommand.type === "create";
|
|
67139
|
+
return (descriptor.version === 1 || descriptor.version === 2) && typeof descriptor.supervisorSocketPath === "string" && normalizeSocketPath(descriptor.supervisorSocketPath) === socketPath && typeof descriptor.workerId === "string" && Number.isInteger(descriptor.pid) && (descriptor.pid ?? 0) > 0 && (descriptor.processStartId === void 0 || typeof descriptor.processStartId === "string") && (descriptor.ownerClientId === void 0 || typeof descriptor.ownerClientId === "string") && (descriptor.rlmLedgerSessionDir === void 0 || typeof descriptor.rlmLedgerSessionDir === "string") && typeof descriptor.socketPath === "string" && typeof descriptor.authenticationToken === "string" && (descriptor.workerInstanceId === void 0 || typeof descriptor.workerInstanceId === "string") && typeof descriptor.rootActiveSessionId === "string" && typeof descriptor.createdAt === "string" && typeof descriptor.updatedAt === "string" && Number.isInteger(descriptor.consecutiveFailures) && descriptor.createCommand !== void 0 && typeof descriptor.createCommand === "object" && descriptor.createCommand.type === "create";
|
|
67107
67140
|
}
|
|
67108
67141
|
var PreRosterWorkerError = class extends Error {
|
|
67109
67142
|
};
|
|
@@ -68353,7 +68386,7 @@ var DaemonSupervisor = class {
|
|
|
68353
68386
|
}
|
|
68354
68387
|
const owner = this.rlmCapacityOwner(worker);
|
|
68355
68388
|
const journal = this.assertRlmJournalAdmission();
|
|
68356
|
-
const scope = this.rlmJournalScope(worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir);
|
|
68389
|
+
const scope = this.rlmJournalScope(worker.descriptor.rlmLedgerSessionDir ?? worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir);
|
|
68357
68390
|
if (canonicalSessionPath(scope.journalPath) !== journal.ledgerPath) {
|
|
68358
68391
|
throw new Error("Worker RLM family is not owned by this supervisor");
|
|
68359
68392
|
}
|
|
@@ -68465,7 +68498,7 @@ var DaemonSupervisor = class {
|
|
|
68465
68498
|
throw new Error("Worker authentication failed for RLM ledger mutation");
|
|
68466
68499
|
}
|
|
68467
68500
|
const owner = this.assertRlmJournalAdmission();
|
|
68468
|
-
const scope = this.rlmJournalScope(worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir);
|
|
68501
|
+
const scope = this.rlmJournalScope(worker.descriptor.rlmLedgerSessionDir ?? worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir);
|
|
68469
68502
|
if (canonicalSessionPath(scope.journalPath) !== owner.ledgerPath) {
|
|
68470
68503
|
throw new Error("Worker RLM ledger family is not owned by this supervisor");
|
|
68471
68504
|
}
|
|
@@ -69209,12 +69242,12 @@ var DaemonSupervisor = class {
|
|
|
69209
69242
|
if ("activeSessionId" in command) {
|
|
69210
69243
|
const match2 = await this.findWorkerForClient(client, command.activeSessionId);
|
|
69211
69244
|
cwd = match2.summary.cwd;
|
|
69212
|
-
sessionDir = this.defaultSessionConfig.sessionDir;
|
|
69245
|
+
sessionDir = match2.worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir;
|
|
69213
69246
|
} else {
|
|
69214
69247
|
cwd = resolve24(command.cwd);
|
|
69215
69248
|
sessionDir = command.sessionDir;
|
|
69216
69249
|
}
|
|
69217
|
-
const { agentDir, sessionsDir: ledgerSessionDir } = this.rlmJournalScope(
|
|
69250
|
+
const { agentDir, sessionsDir: ledgerSessionDir } = this.rlmJournalScope();
|
|
69218
69251
|
const page = await this.catalog.list(cwd, sessionDir, { page: pageQuery, scope, agentDir, ledgerSessionDir });
|
|
69219
69252
|
return success(command.id, "list_saved_sessions", page);
|
|
69220
69253
|
}
|
|
@@ -69429,6 +69462,7 @@ var DaemonSupervisor = class {
|
|
|
69429
69462
|
const recoveryJournalPath = existing?.descriptor.recoveryJournalPath ?? join31(this.descriptorDir, `${workerId}.recovery.jsonl`);
|
|
69430
69463
|
const orphanProcessJournalPath = existing?.descriptor.orphanProcessJournalPath ?? join31(this.descriptorDir, `${workerId}.orphans.jsonl`);
|
|
69431
69464
|
const launch = createCliSubprocessLaunchSpec(["--mode", "daemon", "--daemon-socket", socketPath]);
|
|
69465
|
+
const rlmLedgerSessionDir = this.rlmJournalScope().sessionsDir;
|
|
69432
69466
|
const workerEnvironment = createCliSubprocessEnv({
|
|
69433
69467
|
...process.env,
|
|
69434
69468
|
...launchEnv,
|
|
@@ -69437,6 +69471,7 @@ var DaemonSupervisor = class {
|
|
|
69437
69471
|
[DAEMON_WORKER_INSTANCE_ID_ENV]: workerInstanceId,
|
|
69438
69472
|
[DAEMON_WORKER_ACTIVE_SESSION_ID_ENV]: rootActiveSessionId,
|
|
69439
69473
|
[DAEMON_WORKER_SUPERVISOR_SOCKET_ENV]: this.socketPath,
|
|
69474
|
+
[DAEMON_WORKER_RLM_LEDGER_SESSION_DIR_ENV]: rlmLedgerSessionDir,
|
|
69440
69475
|
[DAEMON_WORKER_RECOVERY_JOURNAL_ENV]: recoveryJournalPath,
|
|
69441
69476
|
[DAEMON_WORKER_STARTUP_GATE_FD_ENV]: String(WORKER_STARTUP_GATE_FD),
|
|
69442
69477
|
[ORPHAN_PROCESS_JOURNAL_ENV]: orphanProcessJournalPath,
|
|
@@ -69504,6 +69539,7 @@ var DaemonSupervisor = class {
|
|
|
69504
69539
|
rootActiveSessionId,
|
|
69505
69540
|
ownerClientId: existing?.descriptor.ownerClientId ?? ownerClientId,
|
|
69506
69541
|
sessionDir: createCommand.config?.sessionDir,
|
|
69542
|
+
rlmLedgerSessionDir,
|
|
69507
69543
|
createdAt: existing?.descriptor.createdAt ?? now,
|
|
69508
69544
|
updatedAt: now,
|
|
69509
69545
|
lifecycle: "starting",
|
|
@@ -72770,38 +72806,38 @@ async function runPrintModeWithConnectionInternal(connection, options, bindHeadl
|
|
|
72770
72806
|
await connection.promptAndWait(message);
|
|
72771
72807
|
}
|
|
72772
72808
|
const autonomousStatus = await connection.waitForHeadlessCompletion();
|
|
72773
|
-
|
|
72774
|
-
|
|
72775
|
-
if (primary
|
|
72776
|
-
|
|
72777
|
-
|
|
72778
|
-
|
|
72779
|
-
|
|
72780
|
-
|
|
72781
|
-
|
|
72782
|
-
writeRawStdout(`${content.text}
|
|
72809
|
+
const { primary, compactionOutcomes } = selectHeadlessTerminalResult(await connection.getMessages());
|
|
72810
|
+
if (primary?.role === "assistant") {
|
|
72811
|
+
if (primary.stopReason === "error" || primary.stopReason === "aborted") {
|
|
72812
|
+
console.error(primary.errorMessage || `Request ${primary.stopReason}`);
|
|
72813
|
+
exitCode = 1;
|
|
72814
|
+
} else if (mode === "text") {
|
|
72815
|
+
for (const content of primary.content) {
|
|
72816
|
+
if (content.type === "text") {
|
|
72817
|
+
writeRawStdout(`${content.text}
|
|
72783
72818
|
`);
|
|
72784
|
-
}
|
|
72785
72819
|
}
|
|
72786
72820
|
}
|
|
72787
|
-
}
|
|
72821
|
+
}
|
|
72822
|
+
} else if (primary) {
|
|
72823
|
+
if (mode === "text")
|
|
72788
72824
|
writeRawStdout(`${primary.content}
|
|
72789
72825
|
`);
|
|
72790
|
-
|
|
72791
|
-
|
|
72792
|
-
|
|
72793
|
-
|
|
72826
|
+
if (!primary.details.success || primary.details.severity === "error")
|
|
72827
|
+
exitCode = 1;
|
|
72828
|
+
}
|
|
72829
|
+
for (const outcome of compactionOutcomes) {
|
|
72830
|
+
if (mode === "text" || outcome.details.outcome === "failed")
|
|
72794
72831
|
console.error(outcome.content);
|
|
72795
|
-
|
|
72796
|
-
|
|
72797
|
-
}
|
|
72832
|
+
if (outcome.details.outcome === "failed")
|
|
72833
|
+
exitCode = 1;
|
|
72798
72834
|
}
|
|
72799
72835
|
const autonomousLimit = autonomousLimitReason(autonomousStatus);
|
|
72800
72836
|
if (autonomousStatus.enabled && autonomousStatus.gates.commands.length > 0 && autonomousStatus.lastGateFailure) {
|
|
72801
72837
|
const limitText = autonomousLimit ? `; autonomous limit reached: ${describeAutonomousLimit(autonomousStatus, autonomousLimit)}` : "";
|
|
72802
72838
|
console.error(`Autonomous quality gate still failing after attempt ${latestAutonomousGateAttempt(autonomousStatus)}/${autonomousStatus.gates.maxRetries}: ${autonomousStatus.lastGateFailure.exitText}${limitText}`);
|
|
72803
72839
|
exitCode = 1;
|
|
72804
|
-
} else if (autonomousStatus.enabled && autonomousStatus.gates.commands.length === 0
|
|
72840
|
+
} else if (autonomousStatus.enabled && autonomousLimit && (autonomousStatus.gates.commands.length === 0 || autonomousStatus.gates.commands.some((command) => autonomousStatus.gateAttempts[command] !== 0))) {
|
|
72805
72841
|
console.error(`Autonomous run stopped before terminal evidence; ${describeAutonomousLimit(autonomousStatus, autonomousLimit)}`);
|
|
72806
72842
|
exitCode = 1;
|
|
72807
72843
|
}
|
|
@@ -74208,7 +74244,7 @@ function buildSessionOptions(config, scopedModels, hasExistingSession, modelRegi
|
|
|
74208
74244
|
diagnostics.push({ type: "warning", message: resolved.warning });
|
|
74209
74245
|
}
|
|
74210
74246
|
if (resolved.error) {
|
|
74211
|
-
|
|
74247
|
+
throw new Error(resolved.error);
|
|
74212
74248
|
}
|
|
74213
74249
|
if (resolved.model) {
|
|
74214
74250
|
options.model = resolved.model;
|
|
@@ -337,7 +337,7 @@ import {
|
|
|
337
337
|
supportsFastMode,
|
|
338
338
|
truncateRawPayload,
|
|
339
339
|
withRequestBody
|
|
340
|
-
} from "./chunk-
|
|
340
|
+
} from "./chunk-JKKXN6JE.js";
|
|
341
341
|
import {
|
|
342
342
|
__export
|
|
343
343
|
} from "./chunk-BAWSWWEU.js";
|
|
@@ -1948,7 +1948,7 @@ function createLazySimpleStream(loadModule) {
|
|
|
1948
1948
|
};
|
|
1949
1949
|
}
|
|
1950
1950
|
function loadAnthropicProviderModule() {
|
|
1951
|
-
anthropicProviderModulePromise ||= import("./anthropic-
|
|
1951
|
+
anthropicProviderModulePromise ||= import("./anthropic-AXUXEET7.js").then((module) => {
|
|
1952
1952
|
const provider = module;
|
|
1953
1953
|
return {
|
|
1954
1954
|
stream: provider.streamAnthropic,
|
|
@@ -1958,7 +1958,7 @@ function loadAnthropicProviderModule() {
|
|
|
1958
1958
|
return anthropicProviderModulePromise;
|
|
1959
1959
|
}
|
|
1960
1960
|
function loadAzureOpenAIResponsesProviderModule() {
|
|
1961
|
-
azureOpenAIResponsesProviderModulePromise ||= import("./azure-openai-responses-
|
|
1961
|
+
azureOpenAIResponsesProviderModulePromise ||= import("./azure-openai-responses-J3NTJKEO.js").then((module) => {
|
|
1962
1962
|
const provider = module;
|
|
1963
1963
|
return {
|
|
1964
1964
|
stream: provider.streamAzureOpenAIResponses,
|
|
@@ -1968,7 +1968,7 @@ function loadAzureOpenAIResponsesProviderModule() {
|
|
|
1968
1968
|
return azureOpenAIResponsesProviderModulePromise;
|
|
1969
1969
|
}
|
|
1970
1970
|
function loadGoogleProviderModule() {
|
|
1971
|
-
googleProviderModulePromise ||= import("./google-
|
|
1971
|
+
googleProviderModulePromise ||= import("./google-QLKV2ZLC.js").then((module) => {
|
|
1972
1972
|
const provider = module;
|
|
1973
1973
|
return {
|
|
1974
1974
|
stream: provider.streamGoogle,
|
|
@@ -1978,7 +1978,7 @@ function loadGoogleProviderModule() {
|
|
|
1978
1978
|
return googleProviderModulePromise;
|
|
1979
1979
|
}
|
|
1980
1980
|
function loadGoogleVertexProviderModule() {
|
|
1981
|
-
googleVertexProviderModulePromise ||= import("./google-vertex-
|
|
1981
|
+
googleVertexProviderModulePromise ||= import("./google-vertex-UGLUZV6B.js").then((module) => {
|
|
1982
1982
|
const provider = module;
|
|
1983
1983
|
return {
|
|
1984
1984
|
stream: provider.streamGoogleVertex,
|
|
@@ -1988,7 +1988,7 @@ function loadGoogleVertexProviderModule() {
|
|
|
1988
1988
|
return googleVertexProviderModulePromise;
|
|
1989
1989
|
}
|
|
1990
1990
|
function loadMistralProviderModule() {
|
|
1991
|
-
mistralProviderModulePromise ||= import("./mistral-
|
|
1991
|
+
mistralProviderModulePromise ||= import("./mistral-2ITSLHYF.js").then((module) => {
|
|
1992
1992
|
const provider = module;
|
|
1993
1993
|
return {
|
|
1994
1994
|
stream: provider.streamMistral,
|
|
@@ -1998,7 +1998,7 @@ function loadMistralProviderModule() {
|
|
|
1998
1998
|
return mistralProviderModulePromise;
|
|
1999
1999
|
}
|
|
2000
2000
|
function loadOpenAICodexResponsesProviderModule() {
|
|
2001
|
-
openAICodexResponsesProviderModulePromise ||= import("./openai-codex-responses-
|
|
2001
|
+
openAICodexResponsesProviderModulePromise ||= import("./openai-codex-responses-FRREQXS3.js").then((module) => {
|
|
2002
2002
|
const provider = module;
|
|
2003
2003
|
return {
|
|
2004
2004
|
stream: provider.streamOpenAICodexResponses,
|
|
@@ -2008,7 +2008,7 @@ function loadOpenAICodexResponsesProviderModule() {
|
|
|
2008
2008
|
return openAICodexResponsesProviderModulePromise;
|
|
2009
2009
|
}
|
|
2010
2010
|
function loadOpenAICompletionsProviderModule() {
|
|
2011
|
-
openAICompletionsProviderModulePromise ||= import("./openai-completions-
|
|
2011
|
+
openAICompletionsProviderModulePromise ||= import("./openai-completions-HF6UPPLW.js").then((module) => {
|
|
2012
2012
|
const provider = module;
|
|
2013
2013
|
return {
|
|
2014
2014
|
stream: provider.streamOpenAICompletions,
|
|
@@ -2018,7 +2018,7 @@ function loadOpenAICompletionsProviderModule() {
|
|
|
2018
2018
|
return openAICompletionsProviderModulePromise;
|
|
2019
2019
|
}
|
|
2020
2020
|
function loadOpenAIResponsesProviderModule() {
|
|
2021
|
-
openAIResponsesProviderModulePromise ||= import("./openai-responses-
|
|
2021
|
+
openAIResponsesProviderModulePromise ||= import("./openai-responses-LRTMBDFW.js").then((module) => {
|
|
2022
2022
|
const provider = module;
|
|
2023
2023
|
return {
|
|
2024
2024
|
stream: provider.streamOpenAIResponses,
|