u-foo 3.1.6 → 3.1.7

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": "u-foo",
3
- "version": "3.1.6",
3
+ "version": "3.1.7",
4
4
  "description": "Multi-Agent Workspace Protocol. Just add u. claude → uclaude, codex → ucodex.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://ufoo.dev",
@@ -127,11 +127,10 @@ const NATIVE_SSE_DISPATCHER_OPTIONS = Object.freeze({
127
127
  });
128
128
  /** Max text-only auto-continues while a plan is waiting on a task (per user submit). */
129
129
  const DEFAULT_MAX_PLAN_AUTO_CONTINUES = 24;
130
- // Anthropic Messages rejects max_tokens above the model's real cap (64K on
131
- // current models), so the transports use different defaults. Override either
132
- // via UFOO_UCODE_MAX_TOKENS (positive integer).
133
- const DEFAULT_OPENAI_MAX_TOKENS = 131072;
134
- const DEFAULT_ANTHROPIC_MAX_TOKENS = 64000;
130
+ // Reserve 32K output tokens by default across transports. Override via
131
+ // UFOO_UCODE_MAX_TOKENS (positive integer).
132
+ const DEFAULT_OPENAI_MAX_TOKENS = 32768;
133
+ const DEFAULT_ANTHROPIC_MAX_TOKENS = 32768;
135
134
  // Extended thinking defaults live in thinkingLevels.js (medium = 10k).
136
135
  // UFOO_UCODE_THINKING=off|low|medium|high|max selects a preset; numeric
137
136
  // UFOO_UCODE_THINKING_BUDGET_TOKENS still overrides. 0 disables thinking.
@@ -1779,8 +1778,8 @@ async function runAnthropicTurn({
1779
1778
  tools: buildAnthropicToolSpecs(),
1780
1779
  stream: true,
1781
1780
  };
1782
- const thinkingBudget = resolveThinkingBudgetTokens();
1783
- if (thinkingBudget > 0) {
1781
+ const thinkingBudget = Math.min(resolveThinkingBudgetTokens(), payload.max_tokens - 1);
1782
+ if (thinkingBudget >= 1024) {
1784
1783
  payload.thinking = { type: "enabled", budget_tokens: thinkingBudget };
1785
1784
  }
1786
1785
  if (Array.isArray(systemBlocks) && systemBlocks.length > 0) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- const DEFAULT_RESPONSES_MAX_OUTPUT_TOKENS = 131072;
3
+ const DEFAULT_RESPONSES_MAX_OUTPUT_TOKENS = 32768;
4
4
  const RESPONSES_REASONING_ITEMS = Symbol("ufoo.responsesReasoningItems");
5
5
 
6
6
  function cloneJsonValue(value) {