open-agents-ai 0.187.354 → 0.187.355

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
@@ -270535,7 +270535,21 @@ ${body}`;
270535
270535
  */
270536
270536
  microcompact(messages2, recentToolResults) {
270537
270537
  const tier = this.options.modelTier ?? "large";
270538
- const keepResults = tier === "small" ? 6 : tier === "medium" ? 10 : 20;
270538
+ let keepResults = tier === "small" ? 6 : tier === "medium" ? 10 : 20;
270539
+ let lastAssistant;
270540
+ for (let i2 = messages2.length - 1; i2 >= 0; i2--) {
270541
+ if (messages2[i2].role === "assistant") {
270542
+ lastAssistant = messages2[i2];
270543
+ break;
270544
+ }
270545
+ }
270546
+ if (lastAssistant && typeof lastAssistant._timestamp === "number") {
270547
+ const gapMs = Date.now() - lastAssistant._timestamp;
270548
+ const IDLE_THRESHOLD_MS = 5 * 6e4;
270549
+ if (gapMs > IDLE_THRESHOLD_MS) {
270550
+ keepResults = Math.min(keepResults, 3);
270551
+ }
270552
+ }
270539
270553
  const toolResultIndices = [];
270540
270554
  for (let i2 = 0; i2 < messages2.length; i2++) {
270541
270555
  if (messages2[i2].role === "tool") {
@@ -273167,10 +273181,15 @@ ${errOutput}`;
273167
273181
  ${result.output}`, "utf-8");
273168
273182
  } catch {
273169
273183
  }
273170
- return `[${toolName} succeeded output externalized: ${result.output.length} chars, ${lineCount} lines]
273171
- Handle: ${handleId}
273172
- Preview: ${preview}...
273173
- Full content available via: repl_exec(code="data = retrieve('${handleId}')") or memex_retrieve(id="${handleId}")`;
273184
+ const { join: _pj } = __require("node:path");
273185
+ const savedPath = _pj(process.cwd(), ".oa", "tool-results", `${handleId}.txt`);
273186
+ const folded = this.foldOutput(result.output, maxLen);
273187
+ return `[Tool output truncated ${result.output.length} chars, ${lineCount} lines]
273188
+ Full output saved to: ${savedPath}
273189
+ To read the complete output, use file_read with path="${savedPath}".
273190
+
273191
+ Truncated preview (beginning + end):
273192
+ ${folded}`;
273174
273193
  }
273175
273194
  /**
273176
273195
  * WO-INF-02: Build structured error recovery guidance for small/medium models.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.354",
3
+ "version": "0.187.355",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) \u2014 interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,9 +1,44 @@
1
- You are a context compaction assistant. Given a transcript of agent-tool interactions, produce a structured markdown summary that preserves:
2
- 1. **Goal**: What the agent was trying to accomplish
3
- 2. **Completed Steps**: Specific actions taken and their outcomes
4
- 3. **Files Modified**: List of files changed with what was done
5
- 4. **Key Findings**: Important information discovered during exploration
6
- 5. **Errors & Fixes**: Any errors encountered and how they were resolved
7
- 6. **Current Status**: Where things stand right now
8
-
9
- Be concise. Use bullet points. Preserve file paths and error messages verbatim. Do NOT include the raw transcript — only the structured summary.
1
+ You are the component that summarizes internal chat history into a structured snapshot.
2
+
3
+ When the conversation history grows too large, you will be invoked to distill the entire history into a concise, structured XML snapshot. This snapshot is CRITICAL it will become the agent's ONLY memory of the past. The agent will resume its work based solely on this snapshot. All crucial details, plans, errors, and user directives MUST be preserved.
4
+
5
+ First, review the user's overall goal, the agent's actions, tool outputs, file modifications, and any unresolved questions. Identify every piece of information essential for future actions.
6
+
7
+ Then generate the final snapshot. Be incredibly dense with information. Omit conversational filler.
8
+
9
+ The structure MUST be as follows:
10
+
11
+ <state_snapshot>
12
+ <overall_goal>
13
+ <!-- A single, concise sentence describing the user's high-level objective. -->
14
+ </overall_goal>
15
+
16
+ <key_knowledge>
17
+ <!-- Crucial facts, conventions, and constraints the agent must remember. Use bullet points. -->
18
+ <!-- Include: file paths, commands, tool names, patterns discovered, user preferences -->
19
+ </key_knowledge>
20
+
21
+ <file_system_state>
22
+ <!-- List files created, read, modified, or deleted. Note status and critical learnings. -->
23
+ <!-- Format: - CWD: /path - READ: file.ts - purpose - MODIFIED: file.ts - what changed -->
24
+ </file_system_state>
25
+
26
+ <recent_actions>
27
+ <!-- Summary of the last significant agent actions and their outcomes. Focus on facts. -->
28
+ <!-- Include tool names, arguments, and whether they succeeded or failed. -->
29
+ </recent_actions>
30
+
31
+ <errors_and_fixes>
32
+ <!-- Any errors encountered, their root causes, and how they were resolved. -->
33
+ <!-- Preserve error messages verbatim where possible. -->
34
+ </errors_and_fixes>
35
+
36
+ <current_plan>
37
+ <!-- The agent's step-by-step plan. Mark completed steps. -->
38
+ <!-- Format: 1. [DONE] Step description 2. [IN PROGRESS] Step 3. [TODO] Step -->
39
+ </current_plan>
40
+
41
+ <failed_approaches>
42
+ <!-- Approaches that were tried and failed. The agent must NOT repeat these. -->
43
+ </failed_approaches>
44
+ </state_snapshot>