Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

Merge autonomy (d6571ae)

Lin (kwant bot)9999694ca363
diff --cc src/server/delegation.rs
index cbaebba3,41ae8c44..fd37a7e5
--- a/src/server/delegation.rs
+++ b/src/server/delegation.rs
@@@ -299,9 -292,11 +310,10 @@@ async fn run
});
let prompt = format!(
"{lead} delegated this task to you. Work on it here; when you finish, your reply is posted back to {lead} \
- and the chat it came from, so make it a complete, self-contained answer.\n\n{task}",
- and the chat it came from, so make it a complete, self-contained answer.\n\nTask: {title}\n\n{task}{again}",
++ and the chat it came from, so make it a complete, self-contained answer.\n\n{task}{again}",
lead = lead.name,
- title = d.title,
- task = d.task,
+ task = crate::drivers::peer_message(&lead.name, &format!("Task: {}\n\n{}", d.title, d.task)),
+ again = if after_restart { RESTARTED_NOTE } else { "" },
);
let mut opts = TurnOpts::default();
opts.on_started = Some(on_started);
diff --cc src/server/routes.rs
index b0087164,90bedb29..24cd0677
--- a/src/server/routes.rs
+++ b/src/server/routes.rs
@@@ -2001,9 -1959,13 +2086,13 @@@ async fn run_kwant_turn_inner
reasoning_content: with_notices(opts.label.clone()),
..scope.message("kwant", &target_kwant.name, text.clone())
};
- scope.save(&msg, None).await;
+ scope.save(&msg, gave_up_meta).await;
return Err(text);
} else if let Some(Ok(Ok(output))) = driver_result {
+ // This chat got through: a turn parked behind a usage limit would only repeat it
+ let _ = db
+ .drop_parked_for_chat(&target_kwant.id, scope.channel_id.as_deref(), scope.kwant_id.as_deref(), scope.thread_id.as_deref())
+ .await;
// Post-turn sync: If bot response outputs a URL, sync navigation so the user sees it in Sandbox VM
if let Some(bot_url) = extract_url_from_text(&output.text) {
if let Some(ctrl) = get_or_create_browser_controller(state, &sandbox_target).await {