open-agents-ai 0.138.65 → 0.138.67
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/dist/index.js +26 -1
- package/package.json +1 -1
- package/prompts/agentic/system-small.md +13 -0
package/dist/index.js
CHANGED
|
@@ -22332,6 +22332,28 @@ Integrate this guidance into your current approach. Continue working on the task
|
|
|
22332
22332
|
});
|
|
22333
22333
|
}
|
|
22334
22334
|
const turnTier = this.options.modelTier ?? "large";
|
|
22335
|
+
if (turn === 1 && (turnTier === "small" || turnTier === "medium")) {
|
|
22336
|
+
const goal = this._taskState.goal || "";
|
|
22337
|
+
const wordCount = goal.split(/\s+/).length;
|
|
22338
|
+
const hasMultipleActions = /\band\b.*\band\b|then.*then|also.*also/i.test(goal);
|
|
22339
|
+
const hasMultipleFiles = /files?.*files?|\.ts.*\.ts|create.*write|modify.*create/i.test(goal);
|
|
22340
|
+
const isComplex = wordCount > 40 || hasMultipleActions || hasMultipleFiles;
|
|
22341
|
+
if (isComplex) {
|
|
22342
|
+
messages.push({
|
|
22343
|
+
role: "user",
|
|
22344
|
+
content: `[TASK DECOMPOSITION \u2014 Complete these steps IN ORDER]
|
|
22345
|
+
|
|
22346
|
+
This task has multiple parts. Do them one at a time:
|
|
22347
|
+
1. LOCATE: Find and read the relevant file(s). List what you found.
|
|
22348
|
+
2. UNDERSTAND: Describe the current behavior in one sentence.
|
|
22349
|
+
3. PLAN: State exactly what changes you'll make (file, function, change).
|
|
22350
|
+
4. IMPLEMENT: Make the changes one file at a time. Test after each file.
|
|
22351
|
+
5. COMPLETE: Call task_complete only after ALL parts are verified.
|
|
22352
|
+
|
|
22353
|
+
Start with step 1 \u2014 read the relevant files NOW.`
|
|
22354
|
+
});
|
|
22355
|
+
}
|
|
22356
|
+
}
|
|
22335
22357
|
const turnBudget = turnTier === "small" ? 5 : turnTier === "medium" ? 8 : 0;
|
|
22336
22358
|
if (turnBudget > 0 && turn > 0 && turn % turnBudget === 0) {
|
|
22337
22359
|
const repetitionRatio = this.detectRepetition(toolCallLog);
|
|
@@ -23606,7 +23628,10 @@ ${trimmedNew}`;
|
|
|
23606
23628
|
return `The path "${lastFilePath}" does not exist. Call list_directory(".") to find correct paths, then try again.`;
|
|
23607
23629
|
}
|
|
23608
23630
|
if (/FAIL|test.*fail|assert/i.test(lastError)) {
|
|
23609
|
-
return `Tests are failing.
|
|
23631
|
+
return `Tests are failing. Do these TWO steps in order:
|
|
23632
|
+
STEP 1: Write a 5-line script isolating JUST the failing case, run it with shell, and observe the actual output.
|
|
23633
|
+
STEP 2: Based on what you observed (not assumed), edit ONLY the specific line(s) causing the failure.
|
|
23634
|
+
Do NOT rewrite the entire function. Patch the specific fault, then re-run tests.`;
|
|
23610
23635
|
}
|
|
23611
23636
|
if (/permission denied/i.test(lastError)) {
|
|
23612
23637
|
return `Permission denied on "${lastFilePath}". Try a different approach or check file permissions.`;
|
package/package.json
CHANGED
|
@@ -32,3 +32,16 @@ Debugging — OBSERVE before reasoning:
|
|
|
32
32
|
- For type questions: run `typeof x` or `x instanceof Date` in shell to check.
|
|
33
33
|
- For refactoring: before changing code, write the existing behavior as a test. Run it. Then change code. Run test again. If it breaks, your refactor has a bug.
|
|
34
34
|
- NEVER reason about 10+ lines of code in your head. Use shell to execute and observe instead.
|
|
35
|
+
|
|
36
|
+
When a test fails — TWO-STEP debug:
|
|
37
|
+
1. ISOLATE: Write a 5-line script reproducing JUST the failing case. Run it. Read the output.
|
|
38
|
+
2. PATCH: Based on what you SAW (not guessed), edit ONLY the failing line(s). Re-run test.
|
|
39
|
+
Do NOT rewrite whole functions. Patch the specific fault.
|
|
40
|
+
|
|
41
|
+
Complex tasks — DECOMPOSE first:
|
|
42
|
+
1. LOCATE: Find and read the relevant file(s).
|
|
43
|
+
2. UNDERSTAND: Describe current behavior in one sentence.
|
|
44
|
+
3. PLAN: State what changes you'll make (which file, which function, what change).
|
|
45
|
+
4. IMPLEMENT: Make changes one at a time.
|
|
46
|
+
5. TEST: Run tests after each change.
|
|
47
|
+
6. COMPLETE: Call task_complete when ALL parts are done.
|