@ponythewhite/base-context 1.0.13 → 1.0.14

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/base-context-runtime/pyproject.toml +1 -1
  3. package/dist/base-context-runtime/uv.lock +1 -1
  4. package/dist/build-info.json +1 -1
  5. package/dist/bundle/amazon-bedrock.js +3 -3
  6. package/dist/bundle/{anthropic-BJVPUMPB.js → anthropic-AXUXEET7.js} +1 -1
  7. package/dist/bundle/{azure-openai-responses-ERRMAXK6.js → azure-openai-responses-J3NTJKEO.js} +2 -2
  8. package/dist/bundle/{bundled-modules-URKVA3UB.js → bundled-modules-UODO7ZR7.js} +5 -5
  9. package/dist/bundle/{chunk-FOGKLC7V.js → chunk-72LSQYUV.js} +1 -1
  10. package/dist/bundle/{chunk-MUFZODP5.js → chunk-EGFIZABJ.js} +1 -1
  11. package/dist/bundle/{chunk-AEMRBMI2.js → chunk-IEM74GZ5.js} +9 -9
  12. package/dist/bundle/{chunk-25VYRAC6.js → chunk-JKKXN6JE.js} +72 -0
  13. package/dist/bundle/{chunk-TXVF6Q5H.js → chunk-NLRWERWA.js} +37 -32
  14. package/dist/bundle/{chunk-TKOBEJ5E.js → chunk-SX7CAXWU.js} +22 -4
  15. package/dist/bundle/{chunk-Q6UAHLII.js → chunk-V6LOBH6X.js} +2 -2
  16. package/dist/bundle/{cli-main-ZTJM5EEH.js → cli-main-6GXXIMQQ.js} +4 -4
  17. package/dist/bundle/cli.js +1 -1
  18. package/dist/bundle/{google-4GA4YMUX.js → google-QLKV2ZLC.js} +2 -2
  19. package/dist/bundle/{google-vertex-7AMALD7D.js → google-vertex-UGLUZV6B.js} +2 -2
  20. package/dist/bundle/{main-53I74INO.js → main-HF64B4HM.js} +5 -5
  21. package/dist/bundle/{mistral-74BXMNRM.js → mistral-2ITSLHYF.js} +1 -1
  22. package/dist/bundle/{openai-codex-responses-COXNC4IH.js → openai-codex-responses-FRREQXS3.js} +5 -4
  23. package/dist/bundle/{openai-completions-BCSA5Q6S.js → openai-completions-HF6UPPLW.js} +1 -1
  24. package/dist/bundle/{openai-responses-ONCIZSJS.js → openai-responses-LRTMBDFW.js} +2 -2
  25. package/dist/core/agent-session.d.ts.map +1 -1
  26. package/dist/core/agent-session.js +6 -1
  27. package/dist/core/agent-session.js.map +1 -1
  28. package/dist/core/autonomous.d.ts +2 -0
  29. package/dist/core/autonomous.d.ts.map +1 -1
  30. package/dist/core/autonomous.js +4 -0
  31. package/dist/core/autonomous.js.map +1 -1
  32. package/dist/core/canonical-context.d.ts.map +1 -1
  33. package/dist/core/canonical-context.js +7 -0
  34. package/dist/core/canonical-context.js.map +1 -1
  35. package/dist/core/public-context.d.ts.map +1 -1
  36. package/dist/core/public-context.js +2 -0
  37. package/dist/core/public-context.js.map +1 -1
  38. package/dist/core/view-units.d.ts.map +1 -1
  39. package/dist/core/view-units.js +3 -0
  40. package/dist/core/view-units.js.map +1 -1
  41. package/dist/main.d.ts.map +1 -1
  42. package/dist/main.js +1 -1
  43. package/dist/main.js.map +1 -1
  44. package/dist/modes/daemon/daemon-mode.d.ts.map +1 -1
  45. package/dist/modes/daemon/daemon-mode.js +4 -3
  46. package/dist/modes/daemon/daemon-mode.js.map +1 -1
  47. package/dist/modes/daemon/daemon-supervisor.d.ts.map +1 -1
  48. package/dist/modes/daemon/daemon-supervisor.js +11 -5
  49. package/dist/modes/daemon/daemon-supervisor.js.map +1 -1
  50. package/dist/modes/daemon/daemon-worker-protocol.d.ts +3 -0
  51. package/dist/modes/daemon/daemon-worker-protocol.d.ts.map +1 -1
  52. package/dist/modes/daemon/daemon-worker-protocol.js +2 -0
  53. package/dist/modes/daemon/daemon-worker-protocol.js.map +1 -1
  54. package/dist/modes/print-mode.d.ts.map +1 -1
  55. package/dist/modes/print-mode.js +24 -21
  56. package/dist/modes/print-mode.js.map +1 -1
  57. package/docs/json.md +14 -1
  58. package/docs/long-running-agents.md +23 -2
  59. package/docs/providers.md +17 -0
  60. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.14] - 2026-09-23
4
+
5
+ - Fixed compaction recovery after failed or interrupted partial tool calls, including resuming affected saved sessions without exposing failed replies to the provider.
6
+ - 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.
7
+ - 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.
8
+ - Documented headless error handling, client-owned versus resident lifetimes, stable session IDs, and goal/autonomous token-budget semantics.
9
+ - Fixed unknown explicit CLI models falling back to a saved model during startup.
10
+ - Fixed daemon sessions using `--session-dir` so custom transcript storage no longer fails RLM family ownership checks.
11
+
3
12
  ## [1.0.13] - 2026-09-21
4
13
 
5
14
  - 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.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "base-context-runtime"
3
- version = "1.0.13"
3
+ version = "1.0.14"
4
4
  description = "Kernel-side runtime shim for Base Context recursion"
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE", "NOTICE"]
@@ -367,7 +367,7 @@ wheels = [
367
367
 
368
368
  [[package]]
369
369
  name = "base-context-runtime"
370
- version = "1.0.13"
370
+ version = "1.0.14"
371
371
  source = { editable = "." }
372
372
  dependencies = [
373
373
  { name = "mcp" },
@@ -1,5 +1,5 @@
1
1
  {
2
- "sourceCommit": "c29f87f196ab576d986a95a2f3dd3feb3fc02a4a",
2
+ "sourceCommit": "1c9651df8abd812cdba9e323517067363acc621c",
3
3
  "sourceDirty": false,
4
4
  "buildHost": {
5
5
  "platform": "linux",
@@ -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-Q6UAHLII.js";
5
- import "./chunk-AEMRBMI2.js";
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-25VYRAC6.js";
11
+ import "./chunk-JKKXN6JE.js";
12
12
  import "./chunk-BAWSWWEU.js";
13
13
 
14
14
  // dist/node/amazon-bedrock.js
@@ -36,7 +36,7 @@ import {
36
36
  streamFailureFromStopReason,
37
37
  streamFailureMessage,
38
38
  truncateRawPayload
39
- } from "./chunk-25VYRAC6.js";
39
+ } from "./chunk-JKKXN6JE.js";
40
40
  import "./chunk-BAWSWWEU.js";
41
41
 
42
42
  // ../../node_modules/@anthropic-ai/sdk/internal/tslib.mjs
@@ -3,7 +3,7 @@ import {
3
3
  convertResponsesMessages,
4
4
  convertResponsesTools,
5
5
  processResponsesStream
6
- } from "./chunk-MUFZODP5.js";
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-25VYRAC6.js";
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-TXVF6Q5H.js";
54
+ } from "./chunk-NLRWERWA.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-TKOBEJ5E.js";
146
+ } from "./chunk-SX7CAXWU.js";
147
147
  import "./chunk-CFNASUYO.js";
148
- import "./chunk-Q6UAHLII.js";
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-AEMRBMI2.js";
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-25VYRAC6.js";
165
+ import "./chunk-JKKXN6JE.js";
166
166
  import {
167
167
  __export
168
168
  } from "./chunk-BAWSWWEU.js";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-4GXPNXOJ.js";
6
6
  import {
7
7
  require_base64_js
8
- } from "./chunk-25VYRAC6.js";
8
+ } from "./chunk-JKKXN6JE.js";
9
9
  import {
10
10
  __commonJS,
11
11
  __require,
@@ -14,7 +14,7 @@ import {
14
14
  calculateCost,
15
15
  classifyStreamFailure,
16
16
  withRequestBody
17
- } from "./chunk-25VYRAC6.js";
17
+ } from "./chunk-JKKXN6JE.js";
18
18
 
19
19
  // ../ai/src/providers/openai-responses-shared.ts
20
20
  function encodeTextSignatureV1(id, phase) {
@@ -337,7 +337,7 @@ import {
337
337
  supportsFastMode,
338
338
  truncateRawPayload,
339
339
  withRequestBody
340
- } from "./chunk-25VYRAC6.js";
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-BJVPUMPB.js").then((module) => {
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-ERRMAXK6.js").then((module) => {
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-4GA4YMUX.js").then((module) => {
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-7AMALD7D.js").then((module) => {
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-74BXMNRM.js").then((module) => {
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-COXNC4IH.js").then((module) => {
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-BCSA5Q6S.js").then((module) => {
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-ONCIZSJS.js").then((module) => {
2021
+ openAIResponsesProviderModulePromise ||= import("./openai-responses-LRTMBDFW.js").then((module) => {
2022
2022
  const provider = module;
2023
2023
  return {
2024
2024
  stream: provider.streamOpenAIResponses,
@@ -8703,6 +8703,42 @@ var MODELS = {
8703
8703
  contextWindow: 105e4,
8704
8704
  maxTokens: 128e3
8705
8705
  },
8706
+ "gpt-6-luna": {
8707
+ id: "gpt-6-luna",
8708
+ name: "GPT-6 Luna",
8709
+ api: "openai-responses",
8710
+ provider: "openai",
8711
+ baseUrl: "https://api.openai.com/v1",
8712
+ reasoning: true,
8713
+ thinkingLevelMap: { "off": "none", "minimal": null, "xhigh": "xhigh", "max": "max" },
8714
+ input: ["text", "image"],
8715
+ cost: {
8716
+ input: 0.1,
8717
+ output: 0.5,
8718
+ cacheRead: 0.01,
8719
+ cacheWrite: 0.125
8720
+ },
8721
+ contextWindow: 105e4,
8722
+ maxTokens: 128e3
8723
+ },
8724
+ "gpt-6-sol": {
8725
+ id: "gpt-6-sol",
8726
+ name: "GPT-6 Sol",
8727
+ api: "openai-responses",
8728
+ provider: "openai",
8729
+ baseUrl: "https://api.openai.com/v1",
8730
+ reasoning: true,
8731
+ thinkingLevelMap: { "off": "none", "minimal": null, "xhigh": "xhigh", "max": "max" },
8732
+ input: ["text", "image"],
8733
+ cost: {
8734
+ input: 2,
8735
+ output: 10,
8736
+ cacheRead: 0.2,
8737
+ cacheWrite: 2.5
8738
+ },
8739
+ contextWindow: 105e4,
8740
+ maxTokens: 128e3
8741
+ },
8706
8742
  "gpt-realtime-2.1": {
8707
8743
  id: "gpt-realtime-2.1",
8708
8744
  name: "GPT-Realtime-2.1",
@@ -9073,6 +9109,42 @@ var MODELS = {
9073
9109
  },
9074
9110
  contextWindow: 272e3,
9075
9111
  maxTokens: 128e3
9112
+ },
9113
+ "gpt-6-luna": {
9114
+ id: "gpt-6-luna",
9115
+ name: "GPT-6 Luna",
9116
+ api: "openai-codex-responses",
9117
+ provider: "openai-codex",
9118
+ baseUrl: "https://chatgpt.com/backend-api",
9119
+ reasoning: true,
9120
+ thinkingLevelMap: { "off": null, "minimal": null, "xhigh": "xhigh", "max": "max" },
9121
+ input: ["text", "image"],
9122
+ cost: {
9123
+ input: 0.1,
9124
+ output: 0.5,
9125
+ cacheRead: 0.01,
9126
+ cacheWrite: 0.125
9127
+ },
9128
+ contextWindow: 872e3,
9129
+ maxTokens: 128e3
9130
+ },
9131
+ "gpt-6-sol": {
9132
+ id: "gpt-6-sol",
9133
+ name: "GPT-6 Sol",
9134
+ api: "openai-codex-responses",
9135
+ provider: "openai-codex",
9136
+ baseUrl: "https://chatgpt.com/backend-api",
9137
+ reasoning: true,
9138
+ thinkingLevelMap: { "off": null, "minimal": null, "xhigh": "xhigh", "max": "max" },
9139
+ input: ["text", "image"],
9140
+ cost: {
9141
+ input: 2,
9142
+ output: 10,
9143
+ cacheRead: 0.2,
9144
+ cacheWrite: 2.5
9145
+ },
9146
+ contextWindow: 872e3,
9147
+ maxTokens: 128e3
9076
9148
  }
9077
9149
  },
9078
9150
  "opencode": {
@@ -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-TKOBEJ5E.js";
355
+ } from "./chunk-SX7CAXWU.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-Q6UAHLII.js";
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-AEMRBMI2.js";
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-25VYRAC6.js";
442
+ } from "./chunk-JKKXN6JE.js";
442
443
  import {
443
444
  __commonJS,
444
445
  __export,
@@ -61120,7 +61121,8 @@ var AgentDaemon = class {
61120
61121
  }
61121
61122
  /** Root sessions dir that keys this daemon's spawn ledger. */
61122
61123
  rlmLedgerSessionsDir() {
61123
- return this.options.defaultSessionConfig.sessionDir ?? getSessionsDir(this.agentDir);
61124
+ const assigned = this.options.worker ? process.env[DAEMON_WORKER_RLM_LEDGER_SESSION_DIR_ENV] : void 0;
61125
+ return assigned ?? this.options.defaultSessionConfig.sessionDir ?? getSessionsDir(this.agentDir);
61124
61126
  }
61125
61127
  async openRlmJournalOwner() {
61126
61128
  if (this.options.worker)
@@ -63563,7 +63565,7 @@ var AgentDaemon = class {
63563
63565
  cwd,
63564
63566
  sessionDir,
63565
63567
  agentDir: this.agentDir,
63566
- ledgerSessionDir: sessionDir ?? this.rlmLedgerSessionsDir(),
63568
+ ledgerSessionDir: this.rlmLedgerSessionsDir(),
63567
63569
  scope: command.scope
63568
63570
  }, pageQuery);
63569
63571
  return success(command.id, "list_saved_sessions", page);
@@ -67103,7 +67105,7 @@ function isDaemonWorkerDescriptor(value, socketPath) {
67103
67105
  return false;
67104
67106
  }
67105
67107
  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";
67108
+ 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
67109
  }
67108
67110
  var PreRosterWorkerError = class extends Error {
67109
67111
  };
@@ -68353,7 +68355,7 @@ var DaemonSupervisor = class {
68353
68355
  }
68354
68356
  const owner = this.rlmCapacityOwner(worker);
68355
68357
  const journal = this.assertRlmJournalAdmission();
68356
- const scope = this.rlmJournalScope(worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir);
68358
+ const scope = this.rlmJournalScope(worker.descriptor.rlmLedgerSessionDir ?? worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir);
68357
68359
  if (canonicalSessionPath(scope.journalPath) !== journal.ledgerPath) {
68358
68360
  throw new Error("Worker RLM family is not owned by this supervisor");
68359
68361
  }
@@ -68465,7 +68467,7 @@ var DaemonSupervisor = class {
68465
68467
  throw new Error("Worker authentication failed for RLM ledger mutation");
68466
68468
  }
68467
68469
  const owner = this.assertRlmJournalAdmission();
68468
- const scope = this.rlmJournalScope(worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir);
68470
+ const scope = this.rlmJournalScope(worker.descriptor.rlmLedgerSessionDir ?? worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir);
68469
68471
  if (canonicalSessionPath(scope.journalPath) !== owner.ledgerPath) {
68470
68472
  throw new Error("Worker RLM ledger family is not owned by this supervisor");
68471
68473
  }
@@ -69209,12 +69211,12 @@ var DaemonSupervisor = class {
69209
69211
  if ("activeSessionId" in command) {
69210
69212
  const match2 = await this.findWorkerForClient(client, command.activeSessionId);
69211
69213
  cwd = match2.summary.cwd;
69212
- sessionDir = this.defaultSessionConfig.sessionDir;
69214
+ sessionDir = match2.worker.descriptor.sessionDir ?? this.defaultSessionConfig.sessionDir;
69213
69215
  } else {
69214
69216
  cwd = resolve24(command.cwd);
69215
69217
  sessionDir = command.sessionDir;
69216
69218
  }
69217
- const { agentDir, sessionsDir: ledgerSessionDir } = this.rlmJournalScope(sessionDir);
69219
+ const { agentDir, sessionsDir: ledgerSessionDir } = this.rlmJournalScope();
69218
69220
  const page = await this.catalog.list(cwd, sessionDir, { page: pageQuery, scope, agentDir, ledgerSessionDir });
69219
69221
  return success(command.id, "list_saved_sessions", page);
69220
69222
  }
@@ -69429,6 +69431,7 @@ var DaemonSupervisor = class {
69429
69431
  const recoveryJournalPath = existing?.descriptor.recoveryJournalPath ?? join31(this.descriptorDir, `${workerId}.recovery.jsonl`);
69430
69432
  const orphanProcessJournalPath = existing?.descriptor.orphanProcessJournalPath ?? join31(this.descriptorDir, `${workerId}.orphans.jsonl`);
69431
69433
  const launch = createCliSubprocessLaunchSpec(["--mode", "daemon", "--daemon-socket", socketPath]);
69434
+ const rlmLedgerSessionDir = this.rlmJournalScope().sessionsDir;
69432
69435
  const workerEnvironment = createCliSubprocessEnv({
69433
69436
  ...process.env,
69434
69437
  ...launchEnv,
@@ -69437,6 +69440,7 @@ var DaemonSupervisor = class {
69437
69440
  [DAEMON_WORKER_INSTANCE_ID_ENV]: workerInstanceId,
69438
69441
  [DAEMON_WORKER_ACTIVE_SESSION_ID_ENV]: rootActiveSessionId,
69439
69442
  [DAEMON_WORKER_SUPERVISOR_SOCKET_ENV]: this.socketPath,
69443
+ [DAEMON_WORKER_RLM_LEDGER_SESSION_DIR_ENV]: rlmLedgerSessionDir,
69440
69444
  [DAEMON_WORKER_RECOVERY_JOURNAL_ENV]: recoveryJournalPath,
69441
69445
  [DAEMON_WORKER_STARTUP_GATE_FD_ENV]: String(WORKER_STARTUP_GATE_FD),
69442
69446
  [ORPHAN_PROCESS_JOURNAL_ENV]: orphanProcessJournalPath,
@@ -69504,6 +69508,7 @@ var DaemonSupervisor = class {
69504
69508
  rootActiveSessionId,
69505
69509
  ownerClientId: existing?.descriptor.ownerClientId ?? ownerClientId,
69506
69510
  sessionDir: createCommand.config?.sessionDir,
69511
+ rlmLedgerSessionDir,
69507
69512
  createdAt: existing?.descriptor.createdAt ?? now,
69508
69513
  updatedAt: now,
69509
69514
  lifecycle: "starting",
@@ -72770,38 +72775,38 @@ async function runPrintModeWithConnectionInternal(connection, options, bindHeadl
72770
72775
  await connection.promptAndWait(message);
72771
72776
  }
72772
72777
  const autonomousStatus = await connection.waitForHeadlessCompletion();
72773
- if (mode === "text") {
72774
- const { primary, compactionOutcomes } = selectHeadlessTerminalResult(await connection.getMessages());
72775
- if (primary?.role === "assistant") {
72776
- if (primary.stopReason === "error" || primary.stopReason === "aborted") {
72777
- console.error(primary.errorMessage || `Request ${primary.stopReason}`);
72778
- exitCode = 1;
72779
- } else {
72780
- for (const content of primary.content) {
72781
- if (content.type === "text") {
72782
- writeRawStdout(`${content.text}
72778
+ const { primary, compactionOutcomes } = selectHeadlessTerminalResult(await connection.getMessages());
72779
+ if (primary?.role === "assistant") {
72780
+ if (primary.stopReason === "error" || primary.stopReason === "aborted") {
72781
+ console.error(primary.errorMessage || `Request ${primary.stopReason}`);
72782
+ exitCode = 1;
72783
+ } else if (mode === "text") {
72784
+ for (const content of primary.content) {
72785
+ if (content.type === "text") {
72786
+ writeRawStdout(`${content.text}
72783
72787
  `);
72784
- }
72785
72788
  }
72786
72789
  }
72787
- } else if (primary) {
72790
+ }
72791
+ } else if (primary) {
72792
+ if (mode === "text")
72788
72793
  writeRawStdout(`${primary.content}
72789
72794
  `);
72790
- if (!primary.details.success || primary.details.severity === "error")
72791
- exitCode = 1;
72792
- }
72793
- for (const outcome of compactionOutcomes) {
72795
+ if (!primary.details.success || primary.details.severity === "error")
72796
+ exitCode = 1;
72797
+ }
72798
+ for (const outcome of compactionOutcomes) {
72799
+ if (mode === "text" || outcome.details.outcome === "failed")
72794
72800
  console.error(outcome.content);
72795
- if (outcome.details.outcome === "failed")
72796
- exitCode = 1;
72797
- }
72801
+ if (outcome.details.outcome === "failed")
72802
+ exitCode = 1;
72798
72803
  }
72799
72804
  const autonomousLimit = autonomousLimitReason(autonomousStatus);
72800
72805
  if (autonomousStatus.enabled && autonomousStatus.gates.commands.length > 0 && autonomousStatus.lastGateFailure) {
72801
72806
  const limitText = autonomousLimit ? `; autonomous limit reached: ${describeAutonomousLimit(autonomousStatus, autonomousLimit)}` : "";
72802
72807
  console.error(`Autonomous quality gate still failing after attempt ${latestAutonomousGateAttempt(autonomousStatus)}/${autonomousStatus.gates.maxRetries}: ${autonomousStatus.lastGateFailure.exitText}${limitText}`);
72803
72808
  exitCode = 1;
72804
- } else if (autonomousStatus.enabled && autonomousStatus.gates.commands.length === 0 && autonomousLimit) {
72809
+ } else if (autonomousStatus.enabled && autonomousLimit && (autonomousStatus.gates.commands.length === 0 || autonomousStatus.gates.commands.some((command) => autonomousStatus.gateAttempts[command] !== 0))) {
72805
72810
  console.error(`Autonomous run stopped before terminal evidence; ${describeAutonomousLimit(autonomousStatus, autonomousLimit)}`);
72806
72811
  exitCode = 1;
72807
72812
  }
@@ -74208,7 +74213,7 @@ function buildSessionOptions(config, scopedModels, hasExistingSession, modelRegi
74208
74213
  diagnostics.push({ type: "warning", message: resolved.warning });
74209
74214
  }
74210
74215
  if (resolved.error) {
74211
- diagnostics.push({ type: "error", message: resolved.error });
74216
+ throw new Error(resolved.error);
74212
74217
  }
74213
74218
  if (resolved.model) {
74214
74219
  options.model = resolved.model;
@@ -32,7 +32,7 @@ import {
32
32
  typebox_exports,
33
33
  validateToolArguments,
34
34
  waitForChildProcess
35
- } from "./chunk-AEMRBMI2.js";
35
+ } from "./chunk-IEM74GZ5.js";
36
36
  import {
37
37
  cleanupSessionResources,
38
38
  registerSessionResourceCleanup
@@ -67,7 +67,7 @@ import {
67
67
  requestTokenRouteIdentity,
68
68
  supportsFastMode,
69
69
  withRequestBody
70
- } from "./chunk-25VYRAC6.js";
70
+ } from "./chunk-JKKXN6JE.js";
71
71
  import {
72
72
  __commonJS,
73
73
  __export,
@@ -28483,6 +28483,8 @@ ${data}`,
28483
28483
  function renderPublicHistory(message2, entryId, maxBytes) {
28484
28484
  if (message2.role !== "assistant" && message2.role !== "toolResult")
28485
28485
  return message2;
28486
+ if (message2.role === "assistant" && (message2.stopReason === "error" || message2.stopReason === "aborted"))
28487
+ return message2;
28486
28488
  const content = [];
28487
28489
  for (const part of message2.content) {
28488
28490
  switch (part.type) {
@@ -31328,6 +31330,8 @@ function bindMessageReplayUnits(messages, units, limits, policy = "complete-cont
31328
31330
  }
31329
31331
  if (message2.role === "assistant") {
31330
31332
  closeCalls();
31333
+ if (message2.stopReason === "error" || message2.stopReason === "aborted")
31334
+ continue;
31331
31335
  for (const part of message2.content)
31332
31336
  if (part.type === "toolCall") {
31333
31337
  if (calls.has(part.id))
@@ -31459,6 +31463,8 @@ function preparePublicContextWindow(messages, firstMessageIndex = 0) {
31459
31463
  for (const [index, message2] of captured.entries()) {
31460
31464
  if (index < firstMessageIndex || message2.role !== "assistant" && message2.role !== "toolResult")
31461
31465
  continue;
31466
+ if (message2.role === "assistant" && (message2.stopReason === "error" || message2.stopReason === "aborted"))
31467
+ continue;
31462
31468
  if (message2.content.some((part) => !["text", "toolCall", "thinking"].includes(part.type)))
31463
31469
  return;
31464
31470
  const reference = references[index];
@@ -32346,6 +32352,8 @@ ${JSON.stringify(selections.map((skill) => ({
32346
32352
  ...actual ? { result: { id: actual.id, sequence: actual.sequence, revision: actual.revision } } : {}
32347
32353
  });
32348
32354
  }
32355
+ if ((candidate.message.stopReason === "error" || candidate.message.stopReason === "aborted") && calls.every((call) => call.admission === "absent"))
32356
+ continue;
32349
32357
  toolContinuations.push({ assistantEntryId: candidate.reference.ref.entryId, calls });
32350
32358
  pendingPublicMessageGroups.push(members.sort((left, right) => left - right));
32351
32359
  }
@@ -41475,6 +41483,7 @@ var DAEMON_WORKER_INSTANCE_ID_ENV = "BASE_CONTEXT_INTERNAL_DAEMON_WORKER_INSTANC
41475
41483
  var DAEMON_WORKER_ACTIVE_SESSION_ID_ENV = "BASE_CONTEXT_INTERNAL_DAEMON_WORKER_ACTIVE_SESSION_ID";
41476
41484
  var DAEMON_WORKER_SUPERVISOR_SOCKET_ENV = "BASE_CONTEXT_INTERNAL_DAEMON_SUPERVISOR_SOCKET";
41477
41485
  var DAEMON_WORKER_RECOVERY_JOURNAL_ENV = "BASE_CONTEXT_INTERNAL_DAEMON_WORKER_RECOVERY_JOURNAL";
41486
+ var DAEMON_WORKER_RLM_LEDGER_SESSION_DIR_ENV = "BASE_CONTEXT_INTERNAL_DAEMON_WORKER_RLM_LEDGER_SESSION_DIR";
41478
41487
  var DAEMON_WORKER_STARTUP_GATE_FD_ENV = "BASE_CONTEXT_INTERNAL_DAEMON_WORKER_STARTUP_GATE_FD";
41479
41488
  var DAEMON_WORKER_STARTUP_GATE_COMMIT = "start\n";
41480
41489
  var DAEMON_WORKER_ROSTER_CAPABILITY = "agent_roster";
@@ -41510,6 +41519,7 @@ function durableDaemonWorkerDescriptor(descriptor2) {
41510
41519
  ...descriptor2.rootSessionId !== void 0 ? { rootSessionId: descriptor2.rootSessionId } : {},
41511
41520
  ...descriptor2.sessionFile !== void 0 ? { sessionFile: descriptor2.sessionFile } : {},
41512
41521
  ...sessionDir !== void 0 ? { sessionDir } : {},
41522
+ ...descriptor2.rlmLedgerSessionDir !== void 0 ? { rlmLedgerSessionDir: descriptor2.rlmLedgerSessionDir } : {},
41513
41523
  createdAt: descriptor2.createdAt,
41514
41524
  updatedAt: descriptor2.updatedAt,
41515
41525
  lifecycle: descriptor2.lifecycle,
@@ -42390,6 +42400,9 @@ function autonomousLimitReason(state, now2 = Date.now()) {
42390
42400
  if (state.continuationsUsed >= state.limits.maxContinuations) {
42391
42401
  return "maxContinuations";
42392
42402
  }
42403
+ return autonomousRunLimitReason(state, now2);
42404
+ }
42405
+ function autonomousRunLimitReason(state, now2 = Date.now()) {
42393
42406
  if (state.turnsUsed >= state.limits.maxTurns) {
42394
42407
  return "maxTurns";
42395
42408
  }
@@ -46083,7 +46096,7 @@ async function loadExtensionModule(extensionPath) {
46083
46096
  // (file-path aliases would load a second, divergent copy of each package).
46084
46097
  // Also disable tryNative so jiti handles ALL imports (not just the entry point)
46085
46098
  // Node/dev must also share the native AI registry and implementation identities.
46086
- ...isBunBinary || isBundledCli ? { virtualModules: (await import("./bundled-modules-URKVA3UB.js")).VIRTUAL_MODULES, tryNative: false } : {
46099
+ ...isBunBinary || isBundledCli ? { virtualModules: (await import("./bundled-modules-UODO7ZR7.js")).VIRTUAL_MODULES, tryNative: false } : {
46087
46100
  alias: getAliases(),
46088
46101
  virtualModules: {
46089
46102
  "@ponythewhite/base-context-ai": src_exports,
@@ -61106,6 +61119,8 @@ var AgentSession = class _AgentSession {
61106
61119
  return (await this._getTurnOutcome({ ...context, hasMoreToolCalls: !!last && last.role !== "assistant" })).kind !== "proceed";
61107
61120
  }
61108
61121
  async _getTurnOutcome(context, signal) {
61122
+ if (this._autonomousState.enabled)
61123
+ await this._agentEventQueue;
61109
61124
  const sourceOwner = signal ? this._invocationCompactionOwner : this._captureCompactionOwner();
61110
61125
  if (!sourceOwner || signal?.aborted || signal && sourceOwner.signal !== signal || !this._isCompactionSourceOwnerCurrent(sourceOwner))
61111
61126
  return { kind: "cancelled" };
@@ -61123,6 +61138,8 @@ var AgentSession = class _AgentSession {
61123
61138
  return { kind: "finish" };
61124
61139
  if (!current())
61125
61140
  return { kind: "cancelled" };
61141
+ if (this._autonomousState.enabled && autonomousRunLimitReason(this._autonomousState))
61142
+ return { kind: "finish" };
61126
61143
  try {
61127
61144
  if (await this._accountGoalUsageForAssistantMessage(context.message, goalOwner)) {
61128
61145
  this._assertGoalContinuationOwner(goalOwner);
@@ -70912,7 +70929,7 @@ import { resolve as resolve15 } from "node:path";
70912
70929
  var BASE_CONTEXT_BUILD_ID_ENV = "BASE_CONTEXT_BUILD_ID";
70913
70930
  var BASE_CONTEXT_LAUNCHER_PATH_ENV = "BASE_CONTEXT_LAUNCHER_PATH";
70914
70931
  function bundledBuildId() {
70915
- return false ? void 0 : "v1.0.12-2-gc29f87f19";
70932
+ return false ? void 0 : "v1.0.14";
70916
70933
  }
70917
70934
  function getDaemonRuntimeIdentity(environment = process.env) {
70918
70935
  const entrypoint = process.argv[1];
@@ -71720,6 +71737,7 @@ export {
71720
71737
  DAEMON_WORKER_ACTIVE_SESSION_ID_ENV,
71721
71738
  DAEMON_WORKER_SUPERVISOR_SOCKET_ENV,
71722
71739
  DAEMON_WORKER_RECOVERY_JOURNAL_ENV,
71740
+ DAEMON_WORKER_RLM_LEDGER_SESSION_DIR_ENV,
71723
71741
  DAEMON_WORKER_STARTUP_GATE_FD_ENV,
71724
71742
  DAEMON_WORKER_STARTUP_GATE_COMMIT,
71725
71743
  DAEMON_WORKER_ROSTER_CAPABILITY,
@@ -2,11 +2,11 @@ import { createRequire as __piBundleCreateRequire } from 'node:module'; const re
2
2
  import {
3
3
  appendRotatingLog,
4
4
  getAgentLogPath
5
- } from "./chunk-AEMRBMI2.js";
5
+ } from "./chunk-IEM74GZ5.js";
6
6
  import {
7
7
  setLogSink,
8
8
  stringifyLogEntry
9
- } from "./chunk-25VYRAC6.js";
9
+ } from "./chunk-JKKXN6JE.js";
10
10
 
11
11
  // dist/core/logging.js
12
12
  var AGENT_LOG_MAX_BYTES = 20 * 1024 * 1024;