fix(attach): hints print the row's attach_command (Issue #72, comments 926/930, U1)
create's closing hint, the delegate-job wrapper's dispatch hint and stop's stuck-TUI message printed the pre-#71 forms (`herdr session attach <name>`, `HERDR_SESSION_NAME=... herdr agent attach <name>`), which miss an agent whose name is over 32 characters or has upper case. They now print the session row's attach_command, or lib_py.agents.sanitize.attach_command(server, name) when there is no row (lib.sh session_attach_command). deploy/INSTALL.md and install_mam.sh show the `herdr --session <server> agent attach <herdr name>` form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0e1e2e87de
commit
ec378e82c9
7 files changed
+205
-5
No files matched your search
@@ -1671,6 +1671,22 @@ print(resolved)
|
||||
"
|
||||
}
|
||||
|
||||
# session_attach_command <session_name> [server]
|
||||
#
|
||||
# Issue #72: the attach hint a script prints - the session row's
|
||||
# attach_command, else the one lib_py.agents.sanitize.attach_command builds for
|
||||
# <server> (default: `default`).
|
||||
session_attach_command() {
|
||||
MAM_STATE_JSON="$(load_state_json)" SESSION_NAME="$1" ATTACH_SERVER="${2:-default}" python3 -c "
|
||||
import os, json
|
||||
from lib_py.agents.sanitize import attach_command
|
||||
name = os.environ['SESSION_NAME']
|
||||
d = json.loads(os.environ.get('MAM_STATE_JSON') or '{}')
|
||||
row = next((s for s in d.get('herdr_sessions', []) if s.get('name') == name), {})
|
||||
print(row.get('attach_command') or attach_command(os.environ['ATTACH_SERVER'], name))
|
||||
"
|
||||
}
|
||||
|
||||
# resolve_herdr_session <session_name> [workspace]
|
||||
#
|
||||
# returns the isolated herdr *session* name (socket/daemon) to use for this MAM session row,
|
||||
|
||||
Reference in new issue
Block a user