kick_agent: use /agents/<name>/state uniformly

manager has /agents bind-mounted too, so /agents/hm1nd/state
resolves there alongside the legacy /state. one canonical path in
the wake message instead of branching on MANAGER_NAME.
This commit is contained in:
müde 2026-05-17 01:43:42 +02:00
parent 90f5162076
commit bf20d99142

View file

@ -182,19 +182,15 @@ impl Coordinator {
/// --continue's session). Best-effort; broker errors are logged /// --continue's session). Best-effort; broker errors are logged
/// but don't propagate. /// but don't propagate.
pub fn kick_agent(&self, name: &str, reason: &str) { pub fn kick_agent(&self, name: &str, reason: &str) {
// Manager keeps the legacy `/state` mount; sub-agents see // Sub-agents bind their state at /agents/<name>/state. The
// their state at `/agents/<name>/state` (see lifecycle.rs's // manager has both /state (legacy mount) and /agents
// `notes_mount`). Tell each agent the path it can actually // bind-mounted, so /agents/<name>/state resolves there too —
// ls without translating. // use that uniformly so the wake message has one canonical
let state_path = if name == crate::lifecycle::MANAGER_NAME { // path that works everywhere.
"/state/".to_owned()
} else {
format!("/agents/{name}/state/")
};
let body = format!( let body = format!(
"{reason}\n\nYou were just (re)started by the operator. \ "{reason}\n\nYou were just (re)started by the operator. \
If you were mid-task, check `{state_path}` for your \ If you were mid-task, check `/agents/{name}/state/` for \
notes and pick up where you left off. claude's \ your notes and pick up where you left off. claude's \
`--continue` session is intact, so prior context is \ `--continue` session is intact, so prior context is \
still in your window." still in your window."
); );