Add sandbox
ci/woodpecker/push/tests Pipeline was canceled

This commit is contained in:
2026-09-17 13:16:15 +00:00
parent 536c55f27b
commit 99d1c2feef
16 changed files with 1537 additions and 12 deletions
+16
View File
@@ -2,6 +2,7 @@ use crate::{
bot::Bot,
gitea::{GiteaAPI, WebhookType},
open_router::OpenRouterClient,
sandbox::SandboxConfig,
state::AppState,
};
@@ -20,6 +21,7 @@ mod errors;
mod gitea;
mod metrics;
mod open_router;
mod sandbox;
mod state;
fn main() -> anyhow::Result<()> {
@@ -76,6 +78,19 @@ async fn run() -> anyhow::Result<()> {
let shutdown = CancellationToken::new();
let sandbox = SandboxConfig {
enabled: config.sandbox_enabled,
runtime: devcontainer_rs::ContainerRuntime::new(config.container_runtime.clone()),
max_iterations: config.sandbox_max_iterations,
};
if sandbox.enabled && !sandbox.runtime.available().await {
warn!(
runtime = sandbox.runtime.program(),
"Sandbox is enabled but the container runtime is not available"
);
}
let bot = Bot::new(
gitea_user.login,
gitea_api,
@@ -83,6 +98,7 @@ async fn run() -> anyhow::Result<()> {
reqwest::Client::new(),
config.bot_max_concurrent,
config.open_router_model.clone(),
sandbox,
);
let (tx, rx) = tokio::sync::mpsc::channel::<WebhookType>(config.bot_max_concurrent * 2);