refactor: cherry-pick improvements from dev-agent's PR #700

Two wins from the dev-agent's implementation:

1. exec-briefing.sh: rewritten to just call exec-inject.sh with a
   briefing prompt (57 lines, down from 154). No more duplicated
   compass/character/context loading.

2. exec-inject.sh: response capture now uses agent_wait_for_claude_ready
   + pane line diff instead of custom EXEC-RESPONSE-START/END markers.
   Claude just responds naturally — no special output format needed.

Also: matrix listener uses nohup for robustness and validates TOML
path before passing to exec-inject.sh.
This commit is contained in:
disinto-exec 2026-03-25 16:15:10 +00:00
parent 8375611244
commit c3acce7f8f
5 changed files with 111 additions and 230 deletions

View file

@ -345,10 +345,12 @@ Interpret this response and decide how to proceed."
# Route message to exec session — spawn on demand if needed
EXEC_PROJECT=$(awk -F'\t' -v id="$THREAD_ROOT" '$1 == id {print $5}' "$THREAD_MAP" 2>/dev/null || true)
EXEC_PROJECT="${EXEC_PROJECT:-${PROJECT_NAME:-disinto}}"
EXEC_TOML="${FACTORY_ROOT}/projects/${EXEC_PROJECT}.toml"
[ -f "$EXEC_TOML" ] || EXEC_TOML=""
# Delegate entirely to exec-inject.sh (handles spawn + inject + capture + Matrix post)
bash "${FACTORY_ROOT}/exec/exec-inject.sh" "$SENDER" "$BODY" "$THREAD_ROOT" \
"${FACTORY_ROOT}/projects/${EXEC_PROJECT}.toml" >> "$LOGFILE" 2>&1 &
# Delegate to exec-inject.sh (handles spawn + inject + capture + Matrix post)
nohup bash "${FACTORY_ROOT}/exec/exec-inject.sh" "$SENDER" "$BODY" "$THREAD_ROOT" \
"$EXEC_TOML" >> "$LOGFILE" 2>&1 &
log "exec message from ${SENDER} dispatched to exec-inject.sh"
if ! grep -qF "$THREAD_ROOT" "$ACKED_FILE" 2>/dev/null; then