@myvillage/cli 1.82.1 → 1.83.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myvillage/cli",
3
- "version": "1.82.1",
3
+ "version": "1.83.0",
4
4
  "description": "MyVillageOS CLI for community developers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -112,6 +112,14 @@ export async function agentLoop(agentName, { signal }) {
112
112
  model = anthropic(modelId);
113
113
  }
114
114
  const maxTokens = config.brain?.max_tokens_per_loop || 8000;
115
+ // Max agentic steps (one model turn + its tool executions) per loop
116
+ // iteration. A task like "enumerate N villagers' knowledge, then Slack each
117
+ // lead" needs a step per discovery wave plus the action steps; 10 was too low
118
+ // — the model would exhaust the budget mid-task (e.g. right after listing
119
+ // Slack channels but before sending). Configurable per agent via
120
+ // brain.max_steps_per_loop; default 25. Cost stays bounded by
121
+ // max_tokens_per_loop and the rate limiter regardless of this ceiling.
122
+ const maxSteps = config.brain?.max_steps_per_loop || 25;
115
123
 
116
124
  // Initialize MCP tools
117
125
  let tools;
@@ -293,10 +301,10 @@ Guidelines:
293
301
  // AI SDK v6 removed `maxSteps` — the loop now uses `stopWhen` with
294
302
  // a StopCondition predicate. The default is `stepCountIs(1)`, so
295
303
  // without this the model gets exactly ONE round of tool calls and
296
- // returns immediately. We give it up to 10 steps so a task like
297
- // "find any README under the workspace" can do
298
- // list_allowed_directories → list_directory → search_files → ...
299
- // until it's actually done.
304
+ // returns immediately. We give it up to `maxSteps` steps (default 25,
305
+ // see above) so a multi-step task like "find the low-activity villagers,
306
+ // then message each lead" can do discover → reason → act across enough
307
+ // turns to actually finish, instead of stopping mid-task.
300
308
  //
301
309
  // Anthropic prompt caching: we mark the system block as ephemeral so
302
310
  // everything before it (tool schemas + system prompt) is cached.
@@ -319,7 +327,7 @@ Guidelines:
319
327
  { role: 'user', content: context },
320
328
  ],
321
329
  tools,
322
- stopWhen: stepCountIs(10),
330
+ stopWhen: stepCountIs(maxSteps),
323
331
  maxOutputTokens: maxTokens,
324
332
  });
325
333