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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "a3s-code-core"
version = "4.2.6"
version = "4.2.7"
edition = "2021"
authors = ["A3S Lab Team"]
license = "MIT"
Expand Down
15 changes: 14 additions & 1 deletion core/src/tools/program_tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ use tokio::sync::Mutex;
use tokio::time::{timeout, Duration};

const DEFAULT_SCRIPT_TIMEOUT_MS: u64 = 30_000;
/// Scripts allowed to delegate (`task`/`parallel_task`) run child agents that
/// each take a full LLM turn, so they need a far more generous default timeout.
const DELEGATION_SCRIPT_TIMEOUT_MS: u64 = 600_000;
const DEFAULT_SCRIPT_MAX_TOOL_CALLS: usize = 20;
const DEFAULT_SCRIPT_MAX_OUTPUT_BYTES: usize = 64 * 1024;
const MAX_SCRIPT_SOURCE_BYTES: usize = 64 * 1024;
Expand Down Expand Up @@ -266,7 +269,17 @@ async fn run_quickjs_script(
allowed_tools: HashSet<String>,
limits: ScriptLimits,
) -> Result<ToolOutput> {
let timeout_ms = limits.timeout_ms.unwrap_or(DEFAULT_SCRIPT_TIMEOUT_MS);
// A script that can delegate runs child agents (each a full LLM turn, often
// 30s to several minutes), so the 30s default is far too short and silently
// times out real workflows. Default delegation-capable scripts to a generous
// timeout; pure compute/search scripts keep the short default. An explicit
// limits.timeoutMs always wins.
let delegating = allowed_tools.contains("parallel_task") || allowed_tools.contains("task");
let timeout_ms = limits.timeout_ms.unwrap_or(if delegating {
DELEGATION_SCRIPT_TIMEOUT_MS
} else {
DEFAULT_SCRIPT_TIMEOUT_MS
});
let max_tool_calls = limits
.max_tool_calls
.unwrap_or(DEFAULT_SCRIPT_MAX_TOOL_CALLS);
Expand Down
190 changes: 180 additions & 10 deletions sdk/node/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading