@ouro.bot/cli 0.1.0-alpha.1166 → 0.1.0-alpha.1167

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.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1167",
6
+ "changes": [
7
+ "An agent's context window now follows its model's real limit (200k for Claude, 400k for GPT) unless agent.json sets context.maxTokens to something other than the old 80000 default; new agents no longer get maxTokens written. scripts/measure-prompt.cjs counts the system prompt and tool schemas per channel, with no model calls."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1166",
6
12
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1166",
2
+ "runtimeVersion": "0.1.0-alpha.1167",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1166</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1167</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -149,9 +149,9 @@ const registryData = [
149
149
  {
150
150
  path: "context.maxTokens",
151
151
  tier: "self",
152
- description: "Maximum context window size in tokens.",
152
+ description: "Override for the context window size in tokens. Unset, it follows the configured model's real window.",
153
153
  default: 80000,
154
- effects: "Larger values allow more context but increase cost and latency. Must match model capability.",
154
+ effects: "Larger values allow more context but increase cost and latency. Must not exceed the model's window. 80000 applies only to a model whose window is unknown.",
155
155
  topics: ["context", "tokens", "notes", "performance"],
156
156
  validate: validateInteger(1000, 1000000),
157
157
  },
@@ -66,6 +66,7 @@ exports.sessionPath = sessionPath;
66
66
  exports.logPath = logPath;
67
67
  const fs = __importStar(require("fs"));
68
68
  const path = __importStar(require("path"));
69
+ const model_capabilities_1 = require("./model-capabilities");
69
70
  const identity_1 = require("./identity");
70
71
  const provider_credentials_1 = require("./provider-credentials");
71
72
  const runtime_credentials_1 = require("./runtime-credentials");
@@ -271,20 +272,24 @@ function getTeamsSecondaryConfig() {
271
272
  const config = loadConfig();
272
273
  return { ...config.teamsSecondary };
273
274
  }
274
- function getContextConfig() {
275
+ /**
276
+ * The context window follows the model: an agent.json `context.maxTokens` that differs from the old hatch-time
277
+ * default is an explicit override; otherwise the model's real window applies, and the default only when it is unknown.
278
+ */
279
+ function getContextConfig(model) {
275
280
  if (_testContextOverride) {
276
281
  return { ..._testContextOverride };
277
282
  }
278
283
  const defaults = identity_1.DEFAULT_AGENT_CONTEXT;
279
- const agentContext = (0, identity_1.loadAgentConfig)().context;
280
- if (!agentContext || typeof agentContext !== "object") {
281
- return { ...defaults };
282
- }
284
+ const agentConfig = (0, identity_1.loadAgentConfig)();
285
+ const agentContext = agentConfig.context;
286
+ const override = typeof agentContext?.maxTokens === "number" && agentContext.maxTokens !== defaults.maxTokens
287
+ ? agentContext.maxTokens
288
+ : undefined;
289
+ const modelId = model ?? agentConfig.humanFacing?.model;
283
290
  return {
284
- maxTokens: typeof agentContext.maxTokens === "number" ? agentContext.maxTokens : defaults.maxTokens,
285
- contextMargin: typeof agentContext.contextMargin === "number"
286
- ? agentContext.contextMargin
287
- : defaults.contextMargin,
291
+ maxTokens: override ?? (modelId ? (0, model_capabilities_1.getModelCapabilities)(modelId).contextWindowTokens : undefined) ?? defaults.maxTokens,
292
+ contextMargin: typeof agentContext?.contextMargin === "number" ? agentContext.contextMargin : defaults.contextMargin,
288
293
  };
289
294
  }
290
295
  function getOAuthConfig() {
@@ -1171,7 +1171,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
1171
1171
  requiredPromptEvidence: options.requiredPromptEvidence,
1172
1172
  provider: providerRuntime.id,
1173
1173
  model: providerRuntime.model,
1174
- contextWindowTokens: (0, config_1.getContextConfig)().maxTokens,
1174
+ contextWindowTokens: (0, config_1.getContextConfig)(providerRuntime.model).maxTokens,
1175
1175
  });
1176
1176
  }
1177
1177
  catch (error) {
@@ -1594,7 +1594,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
1594
1594
  requiredPromptEvidence: options?.requiredPromptEvidence,
1595
1595
  provider: providerRuntime.id,
1596
1596
  model: providerRuntime.model,
1597
- contextWindowTokens: (0, config_1.getContextConfig)().maxTokens,
1597
+ contextWindowTokens: (0, config_1.getContextConfig)(providerRuntime.model).maxTokens,
1598
1598
  };
1599
1599
  const canonicalBudget = (0, prompt_budget_1.applyPromptBudget)({ ...budgetOptions, messages });
1600
1600
  const currentUserMessage = budgetOptions.requiredPromptEvidence?.currentUserMessage
@@ -1658,7 +1658,7 @@ async function runAgent(messages, callbacks, channel, signal, options) {
1658
1658
  const overflowMessages = attemptMessages.slice(0, protectedStart).map((message) => message.role === "assistant" ? { ...message } : message);
1659
1659
  stripLastToolCalls(overflowMessages);
1660
1660
  overflowMessages.push(...currentAttempt);
1661
- const { maxTokens, contextMargin } = (0, config_1.getContextConfig)();
1661
+ const { maxTokens, contextMargin } = (0, config_1.getContextConfig)(providerRuntime.model);
1662
1662
  const trimmed = (0, context_1.trimMessages)(overflowMessages, maxTokens, contextMargin, maxTokens * 2);
1663
1663
  const requiredEvidence = options?.requiredPromptEvidence;
1664
1664
  const requiredMessages = new Set([
@@ -81,6 +81,7 @@ exports.PROVIDER_CREDENTIALS = {
81
81
  "openai-compatible-gemini": { required: ["apiKey", "baseUrl"], envVars: {}, promptLabels: { apiKey: "Gemini API key", baseUrl: "Gemini canonical base URL" } },
82
82
  };
83
83
  exports.SHEPHERD_NOTICE_POLICIES = ["every", "needs-me", "off"];
84
+ /** maxTokens is only the fallback for a model whose window is unknown; known models carry their own. */
84
85
  exports.DEFAULT_AGENT_CONTEXT = {
85
86
  maxTokens: 80000,
86
87
  contextMargin: 20,
@@ -357,7 +358,7 @@ function buildDefaultAgentTemplate(_agentName) {
357
358
  enabled: true,
358
359
  humanFacing: { provider: "anthropic", model: "claude-opus-5-5" },
359
360
  agentFacing: { provider: "anthropic", model: "claude-opus-5-5" },
360
- context: { ...exports.DEFAULT_AGENT_CONTEXT },
361
+ context: { contextMargin: exports.DEFAULT_AGENT_CONTEXT.contextMargin },
361
362
  habitPaidTurnsPerDay: autonomy_budget_1.DEFAULT_HABIT_PAID_TURNS_PER_DAY,
362
363
  senses: {
363
364
  cli: { ...exports.DEFAULT_AGENT_SENSES.cli },
@@ -9,88 +9,103 @@ exports.MODEL_CAPABILITIES = {
9
9
  "claude-opus-5.5": {
10
10
  reasoningEffort: ["low", "medium", "high", "xhigh", "max"],
11
11
  maxOutputTokens: 128000,
12
+ contextWindowTokens: 200000,
12
13
  vision: true,
13
14
  },
14
15
  "claude-sonnet-5.5": {
15
16
  reasoningEffort: ["low", "medium", "high", "xhigh", "max"],
16
17
  maxOutputTokens: 128000,
18
+ contextWindowTokens: 200000,
17
19
  vision: true,
18
20
  },
19
21
  "claude-haiku-5.5": {
20
22
  reasoningEffort: ["low", "medium", "high", "xhigh", "max"],
21
23
  maxOutputTokens: 128000,
24
+ contextWindowTokens: 200000,
22
25
  vision: true,
23
26
  },
24
27
  "claude-opus-5-5": {
25
28
  reasoningEffort: ["low", "medium", "high", "xhigh", "max"],
26
29
  thinkingFormat: "anthropic",
27
30
  maxOutputTokens: 128000,
31
+ contextWindowTokens: 200000,
28
32
  vision: true,
29
33
  },
30
34
  "claude-sonnet-5-5": {
31
35
  reasoningEffort: ["low", "medium", "high", "xhigh", "max"],
32
36
  thinkingFormat: "anthropic",
33
37
  maxOutputTokens: 128000,
38
+ contextWindowTokens: 200000,
34
39
  vision: true,
35
40
  },
36
41
  "claude-haiku-5-5": {
37
42
  reasoningEffort: ["low", "medium", "high", "xhigh", "max"],
38
43
  thinkingFormat: "anthropic",
39
44
  maxOutputTokens: 128000,
45
+ contextWindowTokens: 200000,
40
46
  vision: true,
41
47
  },
42
48
  "gpt-6.1-sol": {
43
49
  reasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
44
50
  phase: true,
45
51
  maxOutputTokens: 128000,
52
+ contextWindowTokens: 400000,
46
53
  vision: true,
47
54
  },
48
55
  "gpt-6-sol": {
49
56
  reasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
50
57
  phase: true,
51
58
  maxOutputTokens: 128000,
59
+ contextWindowTokens: 400000,
52
60
  vision: true,
53
61
  },
54
62
  "gpt-6-luna": {
55
63
  reasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
56
64
  phase: true,
57
65
  maxOutputTokens: 128000,
66
+ contextWindowTokens: 400000,
58
67
  vision: true,
59
68
  },
60
69
  "gpt-6-astra": {
61
70
  reasoningEffort: ["low", "medium", "high", "xhigh", "max"],
62
71
  phase: true,
63
72
  maxOutputTokens: 128000,
73
+ contextWindowTokens: 400000,
64
74
  vision: true,
65
75
  },
66
76
  "gpt-5.6-sol": {
67
77
  reasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
68
78
  phase: true,
69
79
  maxOutputTokens: 128000,
80
+ contextWindowTokens: 400000,
70
81
  vision: true,
71
82
  },
72
83
  "gpt-5.6-sol-fast": {
73
84
  reasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
74
85
  phase: true,
75
86
  maxOutputTokens: 128000,
87
+ contextWindowTokens: 400000,
76
88
  vision: true,
77
89
  },
78
90
  "gpt-5.6-luna": {
79
91
  reasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
80
92
  phase: true,
81
93
  maxOutputTokens: 128000,
94
+ contextWindowTokens: 400000,
82
95
  vision: true,
83
96
  },
84
97
  "gpt-5.6-terra": {
85
98
  reasoningEffort: ["none", "low", "medium", "high", "xhigh", "max"],
86
99
  phase: true,
87
100
  maxOutputTokens: 128000,
101
+ contextWindowTokens: 400000,
88
102
  vision: true,
89
103
  },
90
104
  "gpt-5.5": {
91
105
  reasoningEffort: ["none", "low", "medium", "high", "xhigh"],
92
106
  phase: true,
93
107
  maxOutputTokens: 128000,
108
+ contextWindowTokens: 400000,
94
109
  vision: true,
95
110
  },
96
111
  "MiniMax-Text-01": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1166",
3
+ "version": "0.1.0-alpha.1167",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.1166",
9
+ "version": "0.1.0-alpha.1167",
10
10
  "bundleDependencies": [
11
11
  "@ouro.bot/friends"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1166",
3
+ "version": "0.1.0-alpha.1167",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },