rename agents/main→assistant, role-based default entry agent
Nightly Build / build (push) Successful in 6m31s

This commit is contained in:
2026-07-21 21:40:06 +01:00
parent 17f5769e0d
commit 8ff64cbddc
22 changed files with 204 additions and 44 deletions
+3 -1
View File
@@ -585,7 +585,9 @@ impl ChatSessionHandler {
let stack = match chat_sessions_stack::active_for_session(pool, self.session_id).await? {
Some(s) => s,
None => {
chat_sessions_stack::create(pool, self.session_id, "main", None, 0, None).await?
// Lazy root frame: run this session's own entry agent (the same id
// `build_agent_config` resolves the prompt from), never a hardcoded default.
chat_sessions_stack::create(pool, self.session_id, &self.agent_id, None, 0, None).await?
}
};
+5 -1
View File
@@ -132,8 +132,12 @@ impl ChatSessionManager {
if let Some(rc) = run_context {
chat_sessions::set_run_context(&self.db, session.id, Some(&rc.to_db())).await?;
}
// The root stack frame runs the session's own entry agent — not a hardcoded
// default. Using the wrong id here would silently run that agent's prompt
// regardless of what the session was created with (llm_loop resolves the
// prompt from `config.agent_id`, which comes from the stack frame).
let stack = chat_sessions_stack::create(
&self.db, session.id, "main", None, 0, None,
&self.db, session.id, agent_id, None, 0, None,
).await?;
Ok((session.id, stack.id))
}