subagent: say the dir a session was started in, not "pass dir"

A session cannot be moved between directories, so a hint reading
"pass dir" could be misread as pointing an existing session at any
directory. Say instead that dir names the directory the session was
started in.

Refs #4405
This commit is contained in:
atlas 2026-09-14 20:20:58 +02:00 committed by mara
commit 31c76ddf32
2 changed files with 5 additions and 5 deletions

View file

@ -71,7 +71,7 @@ turn's end-of-turn todo, carrying claude's own message plus the location
this daemon searched.
```
claude error: no session matched the requested id or title (searched /home/agent/.claude for cwd /home/agent/work; if the session was started elsewhere, pass `dir`)
claude error: no session matched the requested id or title (searched /home/agent/.claude for cwd /home/agent/work; if it was started elsewhere, pass the `dir` it was started in)
```
The directory is the part claude's own message never names, and the part

View file

@ -130,7 +130,7 @@ fn searched_location(config: &Config) -> Option<String> {
let home = config.resolved_claude_home().ok()?;
let cwd = config.resolved_cwd().ok()?;
Some(format!(
"(searched {} for cwd {}; if the session was started elsewhere, pass `dir`)",
"(searched {} for cwd {}; if it was started elsewhere, pass the `dir` it was started in)",
home.display(),
cwd.display()
))
@ -1410,8 +1410,8 @@ mod tests {
// where this daemon looked. claude's own message names the value it
// failed to match but never the directory, which is the fact that
// was missing.
let searched = "(searched /home/agent/.claude for cwd /home/agent/work; if the session \
was started elsewhere, pass `dir`)";
let searched = "(searched /home/agent/.claude for cwd /home/agent/work; if it was started \
elsewhere, pass the `dir` it was started in)";
let end = classify_end(Err(hive_claude::Error::SessionNotFound), Some(searched));
let TurnEnd::Failed(msg) = end else {
panic!("a missed resume is a failed turn");
@ -1425,7 +1425,7 @@ mod tests {
"and the search location must be appended to it: {msg}"
);
assert!(
msg.contains("pass `dir`"),
msg.contains("pass the `dir` it was started in"),
"naming the directory is only half of it — say what to do about it: {msg}"
);
}