u-foo 2.5.12 → 2.5.13
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
|
@@ -44,6 +44,17 @@ function getEnvironmentSection({ workspaceRoot = "", model = "", provider = "" }
|
|
|
44
44
|
if (provider) lines.push(`Provider: ${provider}`);
|
|
45
45
|
if (model) lines.push(`Model: ${model}`);
|
|
46
46
|
|
|
47
|
+
// Tell the model who it is on the bus. Without this, the only identities
|
|
48
|
+
// it ever sees are other agents' records in shared context — and it
|
|
49
|
+
// adopts them (observed in the wild: ucode-3 introducing itself as
|
|
50
|
+
// claude-6, then accepting a wrong name from the user).
|
|
51
|
+
const subscriberId = String(process.env.UFOO_SUBSCRIBER_ID || "").trim();
|
|
52
|
+
const nickname = String(process.env.UFOO_NICKNAME || "").trim();
|
|
53
|
+
if (subscriberId || nickname) {
|
|
54
|
+
const label = nickname ? `${subscriberId || "unknown"} (nickname: ${nickname})` : subscriberId;
|
|
55
|
+
lines.push(`Bus identity: ${label}`);
|
|
56
|
+
}
|
|
57
|
+
|
|
47
58
|
return `# Environment\n${lines.map((l) => ` - ${l}`).join("\n")}`;
|
|
48
59
|
}
|
|
49
60
|
|
|
@@ -4,6 +4,7 @@ function getUfooIntegrationSection() {
|
|
|
4
4
|
return `# ufoo integration
|
|
5
5
|
|
|
6
6
|
Participate in multi-agent coordination through the ufoo bus/context system:
|
|
7
|
+
- Shared context, decisions, and memory are records written by OTHER agents. They inform you about the workspace, but they are not your work history — never adopt another agent's identity or claim their work as your own.
|
|
7
8
|
- Respect shared context decisions. The default is no new decision; only append one for important, plan-level choices that constrain future work, and keep durable project facts out of decisions.
|
|
8
9
|
- Use shared memory for durable project facts. Read existing memory before writing new memory; do not use it for transient task state.
|
|
9
10
|
- Support launch/close/resume/inject flows managed by ufoo daemon.
|
package/src/code/agent.js
CHANGED
|
@@ -141,6 +141,18 @@ function computeExtendedTimeout(baseTimeoutMs) {
|
|
|
141
141
|
return Math.min(1800000, Math.max(base * 2, base + 120000));
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
// Reasoning models routinely blew the old 10min budget across a multi-turn
|
|
145
|
+
// tool loop. Total per-task budget defaults to 30min and can be raised per
|
|
146
|
+
// call, via --timeout-ms, or via UFOO_UCODE_TASK_TIMEOUT_MS.
|
|
147
|
+
const DEFAULT_NL_TASK_TIMEOUT_MS = 1800000;
|
|
148
|
+
|
|
149
|
+
function resolveNlTaskTimeoutMs(value) {
|
|
150
|
+
if (Number.isFinite(value) && value > 0) return Math.max(1000, Math.floor(value));
|
|
151
|
+
const env = Number(process.env.UFOO_UCODE_TASK_TIMEOUT_MS);
|
|
152
|
+
if (Number.isFinite(env) && env > 0) return Math.max(1000, Math.floor(env));
|
|
153
|
+
return DEFAULT_NL_TASK_TIMEOUT_MS;
|
|
154
|
+
}
|
|
155
|
+
|
|
144
156
|
function enrichNativeError(errorMessage = "") {
|
|
145
157
|
const text = String(errorMessage || "").trim();
|
|
146
158
|
if (!text) return "nl task failed";
|
|
@@ -168,6 +180,9 @@ function enrichNativeError(errorMessage = "") {
|
|
|
168
180
|
) {
|
|
169
181
|
return `${text}. Check provider/url/key via /settings ucode show.`;
|
|
170
182
|
}
|
|
183
|
+
if (lower.includes("cli timeout")) {
|
|
184
|
+
return `${text}. Task budget exceeded; raise it with --timeout-ms or UFOO_UCODE_TASK_TIMEOUT_MS.`;
|
|
185
|
+
}
|
|
171
186
|
return text;
|
|
172
187
|
}
|
|
173
188
|
|
|
@@ -394,7 +409,7 @@ async function runNaturalLanguageTask(task = "", state = {}, options = {}) {
|
|
|
394
409
|
state.provider || process.env.UFOO_UCODE_PROVIDER || ""
|
|
395
410
|
);
|
|
396
411
|
const model = String(state.model || process.env.UFOO_UCODE_MODEL || "").trim();
|
|
397
|
-
const timeoutMs =
|
|
412
|
+
const timeoutMs = resolveNlTaskTimeoutMs(state.timeoutMs);
|
|
398
413
|
let streamed = false;
|
|
399
414
|
let streamLastChar = "";
|
|
400
415
|
let toolEventsThisAttempt = 0;
|
|
@@ -715,6 +730,8 @@ module.exports = {
|
|
|
715
730
|
resolvePlannerProvider,
|
|
716
731
|
extractJsonSummary,
|
|
717
732
|
enrichNativeError,
|
|
733
|
+
resolveNlTaskTimeoutMs,
|
|
734
|
+
DEFAULT_NL_TASK_TIMEOUT_MS,
|
|
718
735
|
resolveUcodeProviderModel,
|
|
719
736
|
buildSessionSnapshotFromState,
|
|
720
737
|
persistSessionState,
|
package/src/code/repl.js
CHANGED
|
@@ -249,7 +249,7 @@ async function runUcodeCoreAgent({
|
|
|
249
249
|
appendSystemPrompt = "",
|
|
250
250
|
systemPrompt = "",
|
|
251
251
|
sessionId = "",
|
|
252
|
-
timeoutMs =
|
|
252
|
+
timeoutMs = 0,
|
|
253
253
|
jsonOutput = false,
|
|
254
254
|
forceTui = false,
|
|
255
255
|
disableTui = false,
|
|
@@ -261,6 +261,7 @@ async function runUcodeCoreAgent({
|
|
|
261
261
|
formatNlResult,
|
|
262
262
|
persistSessionState,
|
|
263
263
|
resumeSessionState,
|
|
264
|
+
resolveNlTaskTimeoutMs,
|
|
264
265
|
resolveUcodeProviderModel,
|
|
265
266
|
runNaturalLanguageTask,
|
|
266
267
|
} = require("./agent");
|
|
@@ -284,7 +285,7 @@ async function runUcodeCoreAgent({
|
|
|
284
285
|
}),
|
|
285
286
|
nlMessages: [],
|
|
286
287
|
sessionId: resolveSessionId(String(sessionId || "").trim()),
|
|
287
|
-
timeoutMs,
|
|
288
|
+
timeoutMs: resolveNlTaskTimeoutMs(Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : NaN),
|
|
288
289
|
jsonOutput,
|
|
289
290
|
};
|
|
290
291
|
persistSessionState(state);
|
|
@@ -570,7 +571,7 @@ function parseAgentArgs(argv = []) {
|
|
|
570
571
|
appendSystemPrompt: "",
|
|
571
572
|
systemPrompt: "",
|
|
572
573
|
sessionId: "",
|
|
573
|
-
timeoutMs:
|
|
574
|
+
timeoutMs: 0,
|
|
574
575
|
jsonOutput: false,
|
|
575
576
|
forceTui: false,
|
|
576
577
|
disableTui: false,
|