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