Feature request: expose agent lifecycle events / observability surface for external tools #3531
soyomarvaldezg
started this conversation in
Ideas
Replies: 2 comments 1 reply
|
Wonderful good feedback here, @soyomarvaldezg. A few initial notes:
|
1 reply
|
Thanks @meowgorithm — just reviewed #3146. The new hooks map directly onto what crush-tmux currently scrapes and probes for:
Once merged I'll port crush-tmux to consume these hooks (likely via a small listener that writes the same Also added screenshots to the repo: https://github.com/soyomarvaldezg/crush-tmux#screenshots |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
Crush currently exposes only one hook event:
PreToolUse(top-level agent only, noPostToolUse,Stop,Notification,UserPromptSubmit, etc. — the docs explicitly say "please let us know which hooks you'd like to see next").For people running multiple Crush instances at once (one per project, each in its own terminal pane), there is no supported way to know which agent is busy, which is blocked waiting for a permission decision, and which finished its turn without manually flipping through every pane.
What I built as a workaround
I built crush-tmux: a small Go tool that shows a tmux status-bar summary (working / blocked-on-permission / done-but-unseen, per live instance) plus an fzf popup that jumps to the pane that needs you.
It works, but "vibe-coded" on top of three fragile, unsupported surfaces:
psTTY → tmux pane match) to answer "which instances exist"tmux capture-paneof the last 15 lines) to detect theAllow/Denypermission barrier and the working spinner — these are Crush TUI internals with no stable surface, so any reworded prompt breaks detection<cwd>/.crush/crush.db(MAX(messages.created_at)watermark) to tell "busy" from "done" — the internal DB schema is also not a public APIWhat would help (feature request)
An official, stable observability/lifecycle surface for external tools, any subset of which would remove the screen-scraping and DB-probing fragility:
PostToolUse,Stop/TurnComplete,UserPromptSubmit(already planned perdocs/hooks/FUTURE.md), and aPermissionRequest/PermissionResponseevent carrying the tool/command being approvedGET /v1/workspaces/{id}/events— payloadsmessage,session,permission_request,agent_event,run_complete) in server mode is exactly the right shape; documenting it as a supported integration point, or exposing an equivalentcrush events/crush session eventsCLI, would let tools like crush-tmux subscribe instead of scrapingon_state_change-style notification ("working" / "permission_requested" / "done") — with the session id they already expose (CRUSH_SESSION_ID,/v1session events) for correlationWhy it matters
Multi-instance orchestration (tmux dashboards, status bars, notification drivers, CI-style supervision of Crush agents, tools like agent-deck/ccmux for other CLIs) is a real emerging use case. A stable lifecycle surface would let the ecosystem build on Crush instead of on its TUI pixels and private DB schema.
I would be happy to port crush-tmux to consume such an API and help validate it.
All reactions