llmmsg-srv
MSG-223
Post-/compact re-register unreliable for some cc agents (intermittent) - bootstrap silent-exit on hub blip + shim path + .agent-name fallback
Done high
hlhub-llmmsgsrv-cc
Questions
No questions.
Activity
-
wi cli
-
Raised by Elazar via audit-mba-l-cc; diagnosis by nw-lezama-cc. Symptom: rrll/re-register not RELIABLY firing post-/compact for some cc agents. audit-mba-l-cc's case is NOT empty-env (confirmed LLMMSG_AGENT set + .agent-name present), so it's a different, intermittent cause. TWO workstreams, owner hub-llmmsgsrv-cc (script /opt/llmmsg-srv/scripts/llmmsg-bootstrap-session.sh = our lane): A. HARDENING (approved, defensive, NOT the cure): add .agent-name fallback before the line-20 empty-AGENT guard so re-register is env-independent. Proposed by nw-lezama: if [[ -z "$AGENT" ]]; then af="$CWD_VALUE/.agent-name"; [[ -r "$af" ]] && AGENT="$(sed -n 's/^cc=//p' "$af" | head -1)"; fi Mirrors the launch-prompt's claimed 're-register from .agent-name'. Bump v1.10. B. REAL INTERMITTENT CAUSE - candidates to CONFIRM (not yet fact): 1. Does installed CC actually EMIT SessionStart source=compact, and does the no-matcher hook block in ~/.claude/settings.json fire for it? (nw-lezama: block has no matcher = should cover all sources, but verify compact emits at all.) 2. MCP-shim re-register (BWI#513) on compact - separate path from this hook; may not fire on compact (shim currentAgent / polling). 3. Transient hub-unreachable during compact -> hook retries 3x/~6s then exits 0 SILENTLY (lenient hook-mode). Hub cold-started earlier today; an agent compacting during a hub blip gets no re-register. Check whether the UserPromptSubmit-hook re-run self-heals on next prompt, and add a LOUDER log on silent-exit + a deferred/again-later retry. nw-lezama not to push (our repo); team owns the edit + version bump + review.
-
Shipped fleet-wide. A v1.11 (1134922): .agent-name fallback before empty-AGENT guard. B v1.12 (f1a8350): root cause = bootstrap silent STDERR-only exit on hub blip during ~6s compact window; idle agent never re-prompts so self-heal never fires. Fix1: register-fail prints OFFLINE <system-reminder> to hook stdout (injects on SessionStart:compact + every UPS, confirmed). Fix2: detached setsid retry loop re-POSTs /register every 30s for 10min, per-agent dir-lock (abs /usr/bin/mkdir,rmdir - whey rm/rmdir are block-shims), self-terminates on success, mtime stale-reclaim. Tested bash -n/dead-hub/dup-guard/stale-reclaim/trap. Deployed whey+lezama(pull)+venus(scp WI#596 flat copy), all VERSION=1.12.
bug
2026-06-05
6w ago
2026-06-05 03:42