Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions crates/coding-agent/src/memory/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use floppy::{
TaskEndInput, UserInputSource,
};

use super::capture::truncate_chars;
use super::runtime::MemoryRuntime;

/// Create all memory tools wired to the shared runtime.
Expand Down Expand Up @@ -66,7 +67,11 @@ async fn execute_start_task(runtime: Arc<MemoryRuntime>, args: Value) -> Result<
.filter(|s| !s.is_empty())
.ok_or_else(|| anyhow::anyhow!("`description` is required"))?;

let StartTaskResult { task_id, memories } = runtime.start_task(description).await?;
let StartTaskResult {
task_id,
memories,
related_tasks,
} = runtime.start_task(description).await?;

let memory_list: Vec<Value> = memories
.iter()
Expand Down Expand Up @@ -116,12 +121,46 @@ async fn execute_start_task(runtime: Arc<MemoryRuntime>, args: Value) -> Result<
format!("{summary}\n\n{}", lines.join("\n"))
};

// Related past tasks: how a similar task went before (cost, outcome).
let related_text = if related_tasks.is_empty() {
String::new()
} else {
let lines: Vec<String> = related_tasks
.iter()
.map(|t| {
let status = match t.completed {
Some(true) => "completed",
Some(false) => "failed",
None => "in-progress",
};
let score = t.task_score.map(|s| format!("{s:.2}")).unwrap_or_else(|| "?".into());
let tokens = t.tokens_used.map(|n| n.to_string()).unwrap_or_else(|| "?".into());
let errors = t.errors.unwrap_or(0);
let corr = t.user_corrections.unwrap_or(0);
format!(
"- [{}] sim={:.2} score={} | {}tok, {}err, {}corr\n {}",
status,
t.similarity,
score,
tokens,
errors,
corr,
truncate_chars(&t.description, 120),
)
})
.collect();
format!("\n\nRelated past tasks (how similar tasks went before):\n{}", lines.join("\n"))
};

Ok(AgentToolResult {
content: vec![elph_agent::ToolResultContent::Text(elph_ai::TextContent::new(text))],
content: vec![elph_agent::ToolResultContent::Text(elph_ai::TextContent::new(format!(
"{text}{related_text}"
)))],
details: json!({
"taskId": task_id,
"memoryCount": memories.len(),
"memories": memory_list,
"relatedTasks": related_tasks,
}),
added_tool_names: None,
terminate: None,
Expand Down
11 changes: 7 additions & 4 deletions crates/elph-ai/models/agnes.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
"agnes-2.0-flash": {
"api": "openai-completions",
"baseUrl": "https://apihub.agnes-ai.com/v1",
"contextWindow": 256000,
"contextWindow": 512000,
"cost": {
"cacheRead": 0.0,
"cacheWrite": 0.0,
"input": 0.0,
"output": 0.0
},
"description": "Fast and efficient model for agent workflows, tool calling, coding, and image understanding.",
"id": "agnes-2.0-flash",
"input": ["text", "image"],
"maxTokens": 64000,
"maxTokens": 65536,
"name": "Agnes 2.0 Flash",
"provider": "agnes",
"reasoning": true,
Expand All @@ -36,6 +37,7 @@
"input": 0.03,
"output": 0.15
},
"description": "Upgraded model with improved coding, agent workflows, tool calling, and multimodal understanding.",
"id": "agnes-2.5-flash",
"input": ["text", "image"],
"maxTokens": 65536,
Expand Down Expand Up @@ -83,13 +85,14 @@
"baseUrl": "https://apihub.agnes-ai.com/v1",
"contextWindow": 1000000,
"cost": {
"cacheRead": 0.0,
"cacheRead": 0.0038,
"cacheWrite": 0.0,
"input": 0.45,
"output": 0.9
},
"description": "Paid reasoning model for advanced coding, scientific reasoning, long-context analysis, agentic workflows, and multimodal understanding.",
"id": "agnes-2.5-pro-alpha",
"input": ["text", "image", "video"],
"input": ["text", "image"],
"maxTokens": 65536,
"name": "Agnes 2.5 Pro Alpha",
"provider": "agnes",
Expand Down
32 changes: 16 additions & 16 deletions crates/elph-ai/models/amazon_bedrock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1385,10 +1385,10 @@
"baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com",
"contextWindow": 1050000,
"cost": {
"cacheRead": 0.022,
"cacheWrite": 0.275,
"input": 0.22,
"output": 1.32
"cacheRead": 0.02,
"cacheWrite": 0.25,
"input": 0.2,
"output": 1.2
},
"description": "Cost-efficient GPT-5.6 model for fast, high-volume workloads",
"id": "global.openai.gpt-5.6-luna",
Expand All @@ -1414,10 +1414,10 @@
"baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com",
"contextWindow": 1050000,
"cost": {
"cacheRead": 0.55,
"cacheWrite": 6.875,
"input": 5.5,
"output": 33.0
"cacheRead": 0.4,
"cacheWrite": 5.0,
"input": 4.0,
"output": 20.0
},
"description": "Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows",
"id": "global.openai.gpt-5.6-sol",
Expand All @@ -1443,10 +1443,10 @@
"baseUrl": "https://bedrock-runtime.us-east-1.amazonaws.com",
"contextWindow": 1050000,
"cost": {
"cacheRead": 0.22,
"cacheWrite": 2.75,
"input": 2.2,
"output": 13.2
"cacheRead": 0.2,
"cacheWrite": 2.5,
"input": 2.0,
"output": 12.0
},
"description": "Balanced GPT-5.6 model for capable, cost-efficient everyday work",
"id": "global.openai.gpt-5.6-terra",
Expand Down Expand Up @@ -2585,10 +2585,10 @@
},
"contextWindow": 1050000,
"cost": {
"cacheRead": 0.55,
"cacheWrite": 6.875,
"input": 5.5,
"output": 33.0
"cacheRead": 0.44,
"cacheWrite": 5.5,
"input": 4.4,
"output": 22.0
},
"description": "Frontier GPT-5.6 model for complex professional work, coding, and agentic workflows",
"id": "openai.gpt-5.6-sol",
Expand Down
27 changes: 27 additions & 0 deletions crates/elph-ai/models/baseten.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,5 +353,32 @@
"off": "off",
"xhigh": null
}
},
"zai-org/GLM-5.3-Flash": {
"api": "openai-completions",
"baseUrl": "https://inference.baseten.co/v1",
"contextWindow": 1048576,
"cost": {
"cacheRead": 0.03,
"cacheWrite": 0.0,
"input": 0.15,
"output": 0.5
},
"description": "Native multimodal GLM model for efficient coding and long-horizon agent tasks",
"id": "zai-org/GLM-5.3-Flash",
"input": ["text", "image", "video", "pdf"],
"maxTokens": 131072,
"name": "GLM-5.3-Flash",
"provider": "baseten",
"reasoning": true,
"thinkingLevelMap": {
"high": "high",
"low": "low",
"max": "max",
"medium": null,
"minimal": null,
"off": null,
"xhigh": null
}
}
}
50 changes: 25 additions & 25 deletions crates/elph-ai/models/cline.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"baseUrl": "https://api.cline.bot/api/v1",
"contextWindow": 1048576,
"cost": {
"cacheRead": 0.0112,
"cacheRead": 0.015904,
"cacheWrite": 0.0,
"input": 0.056,
"output": 0.112
"input": 0.07952,
"output": 0.15904
},
"description": "DeepSeek V4 Flash is an efficiency-optimized Mixture-of-Experts model from DeepSeek with 284B total parameters and 13B activated parameters, supporting a 1M-token context window. It is designed for fast inference and...",
"id": "deepseek/deepseek-v4-flash",
Expand Down Expand Up @@ -135,55 +135,55 @@
"xhigh": null
}
},
"stealth/ox-alpha": {
"x-ai/grok-4.5": {
"api": "openai-completions",
"baseUrl": "https://api.cline.bot/api/v1",
"contextWindow": 1048576,
"contextWindow": 500000,
"cost": {
"cacheRead": 0.0,
"cacheRead": 0.3,
"cacheWrite": 0.0,
"input": 0.0,
"output": 0.0
"input": 2.0,
"output": 6.0
},
"description": "Ox Alpha is a reasoning model designed for coding, sustained agentic work, and production workloads. It is suited for long-horizon software engineering, complex reasoning, and workflows that combine text with...",
"id": "stealth/ox-alpha",
"input": ["text", "image", "video"],
"description": "Grok 4.5 is a model from SpaceXAI with frontier performance on coding, knowledge work, and STEM.",
"id": "x-ai/grok-4.5",
"input": ["text", "image"],
"maxTokens": 128000,
"name": "Ox Alpha",
"name": "SpaceXAI: Grok 4.5",
"provider": "cline",
"reasoning": true,
"thinkingLevelMap": {
"high": "high",
"low": "low",
"max": "max",
"medium": null,
"max": null,
"medium": "medium",
"minimal": null,
"off": null,
"xhigh": null
}
},
"x-ai/grok-4.5": {
"z-ai/glm-5.3-flash": {
"api": "openai-completions",
"baseUrl": "https://api.cline.bot/api/v1",
"contextWindow": 500000,
"contextWindow": 1310720,
"cost": {
"cacheRead": 0.3,
"cacheRead": 0.015,
"cacheWrite": 0.0,
"input": 2.0,
"output": 6.0
"input": 0.075,
"output": 0.25
},
"description": "Grok 4.5 is a model from SpaceXAI with frontier performance on coding, knowledge work, and STEM.",
"id": "x-ai/grok-4.5",
"input": ["text", "image"],
"description": "GLM-5.3-Flash is a native multimodal model from Z.ai. It is suited for efficient coding and long-horizon agent tasks. Its hybrid sparse and linear attention architecture maintains accurate long-context behavior while...",
"id": "z-ai/glm-5.3-flash",
"input": ["text", "image", "video"],
"maxTokens": 128000,
"name": "SpaceXAI: Grok 4.5",
"name": "Z.ai: GLM 5.3 Flash",
"provider": "cline",
"reasoning": true,
"thinkingLevelMap": {
"high": "high",
"low": "low",
"max": null,
"medium": "medium",
"max": "max",
"medium": null,
"minimal": null,
"off": null,
"xhigh": null
Expand Down
22 changes: 11 additions & 11 deletions crates/elph-ai/models/cline_pass.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"baseUrl": "https://api.cline.bot/api/v1",
"contextWindow": 1048576,
"cost": {
"cacheRead": 0.0112,
"cacheRead": 0.015904,
"cacheWrite": 0.0,
"input": 0.056,
"output": 0.112
"input": 0.07952,
"output": 0.15904
},
"description": "DeepSeek V4 Flash is an efficiency-optimized Mixture-of-Experts model from DeepSeek with 284B total parameters and 13B activated parameters, supporting a 1M-token context window. It is designed for fast inference and...",
"id": "cline-pass/deepseek-v4-flash",
Expand All @@ -32,10 +32,10 @@
"baseUrl": "https://api.cline.bot/api/v1",
"contextWindow": 1048576,
"cost": {
"cacheRead": 0.0435,
"cacheRead": 0.0725,
"cacheWrite": 0.0,
"input": 0.522,
"output": 1.044
"input": 0.87,
"output": 1.74
},
"description": "DeepSeek V4 Pro is a large-scale Mixture-of-Experts model from DeepSeek with 1.6T total parameters and 49B activated parameters, supporting a 1M-token context window. It is designed for advanced reasoning, coding,...",
"id": "cline-pass/deepseek-v4-pro",
Expand All @@ -59,10 +59,10 @@
"baseUrl": "https://api.cline.bot/api/v1",
"contextWindow": 1048576,
"cost": {
"cacheRead": 0.1932,
"cacheRead": 0.221,
"cacheWrite": 0.0,
"input": 0.966,
"output": 3.036
"input": 1.19,
"output": 3.74
},
"description": "GLM 5.2 is a large-scale reasoning model from Z.ai. It supports text input and output with a 1M-token context window, and is suited for long-horizon agent workflows, project-level software engineering,...",
"id": "cline-pass/glm-5.2",
Expand Down Expand Up @@ -346,8 +346,8 @@
"low": "low",
"max": null,
"medium": "medium",
"minimal": null,
"off": "off",
"minimal": "minimal",
"off": null,
"xhigh": "xhigh"
}
}
Expand Down
Loading