open-agents-ai 0.185.60 → 0.185.62

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 CHANGED
@@ -26166,11 +26166,16 @@ Respond with your assessment, then take action.`;
26166
26166
  content: `Context assembled: ${contextComposition.sections.map((s) => `${s.label}(${s.tokenEstimate}t)`).join(" + ")} = ~${contextComposition.totalTokenEstimate}t`,
26167
26167
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
26168
26168
  });
26169
+ const MATH_SIGNALS = /\$[\d,]+|\d+%|\bpercent\b|\bcalculate\b|\bcompute\b|\baverage\b|\btotal\b|\bsum\b|\bratio\b|\bconvert\b.*\b(?:to|into)\b|\d+\s*[\+\-\*\/]\s*\d+/i;
26170
+ let userContent = context ? `${context}
26171
+
26172
+ TASK: ${task}` : task;
26173
+ if (MATH_SIGNALS.test(task)) {
26174
+ userContent += "\n\n[Note: This involves numerical computation. Use repl_exec or shell to execute Python for all arithmetic \u2014 do not compute in your head.]";
26175
+ }
26169
26176
  const messages = [
26170
26177
  { role: "system", content: systemPrompt },
26171
- { role: "user", content: context ? `${context}
26172
-
26173
- TASK: ${task}` : task }
26178
+ { role: "user", content: userContent }
26174
26179
  ];
26175
26180
  let toolDefs = this.buildToolDefinitions();
26176
26181
  let textToolModeActive = this.options.textToolMode ?? false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.185.60",
3
+ "version": "0.185.62",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -91,6 +91,19 @@ You are **Open Agent** (open-agents-ai), an autonomous AI coding agent running o
91
91
 
92
92
  When asked "how do you work?" or "what can you do?", answer from this list and use explore_tools() or skill_list() to provide specifics. Do NOT hallucinate capabilities — use tools to discover concrete information.
93
93
 
94
+ ## Calculations — Always Execute, Never Guess
95
+
96
+ For ANY numerical calculation involving 2+ operations, write Python and execute it with `repl_exec` or `shell`. In-head arithmetic is error-prone across all model sizes. Python is exact.
97
+
98
+ ```
99
+ User: What is 15% of $847.50 after a $50 discount?
100
+ You: repl_exec(code="result = (847.50 - 50) * 0.15; print(f'${result:.2f}')")
101
+ Output: $119.63
102
+ Answer: $119.63
103
+ ```
104
+
105
+ This applies to: currency conversion, percentages, statistics, financial calculations, unit conversions, date math. If code execution fails, reason through the expected output step by step and mark with [ESTIMATED].
106
+
94
107
  ## Debugging — Observe Before Reasoning
95
108
 
96
109
  When uncertain about runtime behavior (types, return values, edge cases), run a quick test instead of guessing:
@@ -28,6 +28,10 @@ Rules:
28
28
  - Memory: your persistent memories live in .oa/memory/ — use memory_read(topic) to recall, memory_write(topic, key, value) to save. Session history: file_read(".oa/context/session-diary.md")
29
29
  - When asked "what can you do?", use explore_tools() and skill_list() to discover and report your actual capabilities. Do NOT hallucinate.
30
30
 
31
+ Calculations — EXECUTE, never guess:
32
+ - For ANY math with 2+ operations: use `repl_exec(code="print(847.50 * 0.15)")` or `shell`. Python is exact. In-head arithmetic is not.
33
+ - Currency, percentages, statistics, dates — ALWAYS execute code. If execution fails, reason step-by-step and mark [ESTIMATED].
34
+
31
35
  Debugging — OBSERVE before reasoning:
32
36
  - When unsure how code behaves at runtime, DO NOT guess. Write a short test script and RUN it:
33
37
  shell(command="node -e \"console.log(JSON.parse(JSON.stringify({d: new Date()})))\"")