Files
loki/scripts
g-butandClaude Sonnet 4.6 b8ceebd421 fix(hooks): sync state after bash injection so Control panel & beacon stay aligned
Root disconnect: when a choice was injected via bash (web beacon or PyQt popup),
the /tmp state files were never updated — agent-ready-<TAB> stayed written
(UI showed "waiting for input"), agent-current-prompt-<TAB> was never written
(no "running" banner), and the Control panel stayed stale until the NEXT stop
hook fired.

Fixes:
- agent-hook-lib.sh: add write_inject_state(tab, key, label) that clears the
  ready/closed sentinels and writes the current-prompt sentinel immediately
  after injection — same state update that /api/inject does for Control panel
  inject button flows
- agent-hook-bridge.sh: extract inject_key and inject_label from the resolved
  choice, then call write_inject_state after emit_or_inject_prompt
- agent-hook-lib.sh: add -- before prompt in write-chars call to prevent
  prompts starting with - from being parsed as flags

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 14:09:12 +02:00
..