kick_agent: use per-recipient state path
manager keeps /state (legacy mount); sub-agents see their state at /agents/<name>/state. wake message hardcoded /state/ for everyone, which is wrong for sub-agents post-refactor — they get a path they can't ls. switch on MANAGER_NAME and format the right path.
This commit is contained in:
parent
6ba4241a45
commit
90f5162076
1 changed files with 16 additions and 6 deletions
|
|
@ -178,15 +178,25 @@ impl Coordinator {
|
|||
/// Drop a system message into the given agent's inbox. Wakes the
|
||||
/// turn loop with a "you were just (re)started" hint — operator
|
||||
/// caused the transition, agent picks up where it left off
|
||||
/// (notes are in /state/, last turn is in --continue's session).
|
||||
/// Best-effort; broker errors are logged but don't propagate.
|
||||
/// (notes are in the bind-mounted state dir, last turn is in
|
||||
/// --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/")
|
||||
};
|
||||
let body = format!(
|
||||
"{reason}\n\nYou were just (re)started by the operator. \
|
||||
If you were mid-task, check `/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."
|
||||
If you were mid-task, check `{state_path}` for your \
|
||||
notes and pick up where you left off. claude's \
|
||||
`--continue` session is intact, so prior context is \
|
||||
still in your window."
|
||||
);
|
||||
if let Err(e) = self.broker.send(&hive_sh4re::Message {
|
||||
from: hive_sh4re::SYSTEM_SENDER.to_owned(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue