You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(hooks): fire remaining lifecycle events; harden session save + child env
Wires the four declared-but-not-firing hook events through HookManager
so user-defined hooks see the full lifecycle:
UserPromptSubmit via bundle.submitUserPrompt, called from App.tsx /
headless run / plan-mode approve / /redo. Exit-code-2
veto bubbles back as { submitted: false, reason }.
SessionStart once per createAgent — lets hooks pre-seed context.
Stop fires on agent_end with the final assistant text —
"ping my phone when this finishes" style hooks.
PostEdit fires from afterToolCall for write-family tools so
formatters / linters / commit-on-save can target
edits specifically.
Also fixes two audit-flagged silent-failure / mutation bugs:
- Session save errors now surface to stderr instead of vanishing, so a
full disk no longer loses work without warning. Adds a workDir-
exists check on load so a deleted/moved project refuses to resume
instead of re-anchoring the session to a bogus path.
- child_process spawns in hooks/runner.ts + tools/shell.ts now clone
process.env instead of passing the reference, so a tool / hook that
does `export FOO=bar` can't leak into every subsequent spawn.
0 commit comments