Skip to content

Commit 00ef049

Browse files
RoyLinRoyLin
authored andcommitted
chore: bump version to 1.3.2 and fix Python SDK dependencies
1 parent 1fc4a03 commit 00ef049

14 files changed

Lines changed: 521 additions & 2105 deletions

File tree

Cargo.lock

Lines changed: 10 additions & 1210 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 36 additions & 483 deletions
Large diffs are not rendered by default.

core/Cargo.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "a3s-code-core"
3-
version = "1.3.1"
3+
version = "1.3.2"
44
edition = "2021"
55
authors = ["A3S Lab Team"]
66
license = "MIT"
@@ -17,8 +17,7 @@ a3s-common = { version = "0.1", path = "../../common" }
1717
a3s-memory = { version = "0.1.1", path = "../../memory" }
1818
a3s-lane = { version = "0.4", path = "../../lane" }
1919
a3s-search = { version = "0.8", path = "../../search", default-features = false }
20-
# Sandbox integration (optional — requires `sandbox` feature)
21-
a3s-box-sdk = { version = "0.7", path = "../../box/src/sdk", optional = true }
20+
a3s-ahp = { version = "2.0", path = "../../ahp", optional = true }
2221

2322
# Async runtime
2423
tokio = { version = "1.35", features = [
@@ -98,10 +97,6 @@ chrono = { version = "0.4", features = ["serde"] }
9897

9998
[features]
10099
default = []
101-
# Enable A3S Box sandbox integration for the `bash` tool.
102-
# When active, `SessionOptions::with_sandbox()` routes bash commands through
103-
# a MicroVM sandbox instead of `std::process::Command`.
104-
sandbox = ["dep:a3s-box-sdk"]
105100
# Enable OpenTelemetry OTLP export for traces and metrics.
106101
# When active, `TelemetryConfig::init()` sets up OTLP exporter + tracing subscriber.
107102
telemetry = [
@@ -110,6 +105,8 @@ telemetry = [
110105
"dep:opentelemetry-otlp",
111106
"dep:tracing-opentelemetry",
112107
]
108+
# Enable AHP (Agent Harness Protocol) integration for external supervision
109+
ahp = ["dep:a3s-ahp"]
113110

114111
[dev-dependencies]
115112
tempfile = "3.10"

core/src/agent_api.rs

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,20 @@ pub struct SessionOptions {
128128
/// aborting in non-streaming mode (overrides default of 3).
129129
/// `None` uses the `AgentConfig` default.
130130
pub circuit_breaker_threshold: Option<u32>,
131-
/// Optional sandbox configuration.
131+
/// Optional sandbox configuration (kept for backward compatibility).
132132
///
133-
/// When set, `bash` tool commands are routed through an A3S Box MicroVM
134-
/// sandbox instead of `std::process::Command`. Requires the `sandbox`
135-
/// Cargo feature to be enabled.
133+
/// Setting this alone has no effect; the host application must also supply
134+
/// a concrete [`BashSandbox`] implementation via [`with_sandbox_handle`].
135+
///
136+
/// [`BashSandbox`]: crate::sandbox::BashSandbox
137+
/// [`with_sandbox_handle`]: Self::with_sandbox_handle
136138
pub sandbox_config: Option<crate::sandbox::SandboxConfig>,
139+
/// Optional concrete sandbox implementation.
140+
///
141+
/// When set, `bash` tool commands are routed through this sandbox instead
142+
/// of `std::process::Command`. The host application constructs and owns
143+
/// the implementation (e.g., an A3S Box–backed handle).
144+
pub sandbox_handle: Option<Arc<dyn crate::sandbox::BashSandbox>>,
137145
/// Enable auto-compaction when context usage exceeds threshold.
138146
pub auto_compact: bool,
139147
/// Context usage percentage threshold for auto-compaction (0.0 - 1.0).
@@ -469,6 +477,21 @@ impl SessionOptions {
469477
self
470478
}
471479

480+
/// Provide a concrete [`BashSandbox`] implementation for this session.
481+
///
482+
/// When set, `bash` tool commands are routed through the given sandbox
483+
/// instead of `std::process::Command`. The host application is responsible
484+
/// for constructing and lifecycle-managing the sandbox.
485+
///
486+
/// [`BashSandbox`]: crate::sandbox::BashSandbox
487+
pub fn with_sandbox_handle(
488+
mut self,
489+
handle: Arc<dyn crate::sandbox::BashSandbox>,
490+
) -> Self {
491+
self.sandbox_handle = Some(handle);
492+
self
493+
}
494+
472495
/// Enable auto-compaction when context usage exceeds threshold.
473496
///
474497
/// When enabled, the agent loop automatically prunes large tool outputs
@@ -1186,23 +1209,13 @@ impl Agent {
11861209
}
11871210
tool_context = tool_context.with_agent_event_tx(agent_event_tx);
11881211

1189-
// Wire sandbox when configured.
1190-
#[cfg(feature = "sandbox")]
1191-
if let Some(ref sandbox_cfg) = opts.sandbox_config {
1192-
let handle: Arc<dyn crate::sandbox::BashSandbox> =
1193-
Arc::new(crate::sandbox::BoxSandboxHandle::new(
1194-
sandbox_cfg.clone(),
1195-
canonical.display().to_string(),
1196-
));
1197-
// Update the registry's default context so that direct
1198-
// `AgentSession::bash()` calls also use the sandbox.
1212+
// Wire sandbox when a concrete handle is provided by the host application.
1213+
if let Some(handle) = opts.sandbox_handle.clone() {
11991214
tool_executor.registry().set_sandbox(Arc::clone(&handle));
12001215
tool_context = tool_context.with_sandbox(handle);
1201-
}
1202-
#[cfg(not(feature = "sandbox"))]
1203-
if opts.sandbox_config.is_some() {
1216+
} else if opts.sandbox_config.is_some() {
12041217
tracing::warn!(
1205-
"sandbox_config is set but the `sandbox` Cargo feature is not enabled \
1218+
"sandbox_config is set but no sandbox_handle was provided \
12061219
— bash commands will run locally"
12071220
);
12081221
}

0 commit comments

Comments
 (0)