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
{{ message }}
Repository navigation
Agent lifecycle via first-party hooks (Claude Code plugin, Codex notify) instead of inferring from OSC 9;4 #361
Inspired by fut (mikker/fut, docs/agents.md, integrations/claude-code, integrations/codex, integrations/pi). Related to #358, which covers the same need through OSC 7501.
Problem
The pane busy indicator comes from OSC 9;4 (GHOSTTY_ACTION_PROGRESS_REPORT, macapp/WorkroomApp/Core/GhosttyRuntimeAdapter.swift:61). Claude Code emits it once at start and once at end. Codex never emits it, so Codex panes show no busy state at all. OSC 9;4 also can't express "blocked" (a permission prompt, question or login).
#358 fixes this via OSC 7501, but it is blocked on ghostty-org/ghostty#14560 (still a draft) and on emitters actually shipping support.
What fut does
Ships first-party lifecycle adapters: a Claude Code plugin, a Codex plugin plus the documented notify setting for authoritative turn completion, and a Pi integration.
The adapters call fut agent report working|blocked|completed|idle|exited, with --source, --agent-session-id and --turn-id. The terminal defaults to FUT_TERMINAL_ID.
A report is owned by the reporting process's live branch, so state clears when the agent process ends even without a final exited.
Codex screen-detection fallback: when Codex is the foreground process and hasn't reported, fut infers idle, working and blocked from the live bottom viewport. Inferred state is marked under activity.detection.rule, and explicit reports always take precedence. FUT_AGENT_DETECTION_LOG=1 logs the matches for debugging.
Proposal
Add workroom agent report <state>, which sends the report to wr-agent with the pane's terminal ID taken from an env var.
Ship a Claude Code plugin that maps its hooks onto these reports (UserPromptSubmit → working, Notification/permission → blocked, Stop → completed), and document Codex's notify setting.
The need behind this issue is met without hooks. #358 shipped OSC 7501 program status through wr-agent (ADR 0050). Claude Code 2.1.295 and later report working, blocked, done and clear, and Codex does too since openai/codex#52725 and #54114 (app=codex, with kind on blocked). So Codex panes are no longer without a busy state, and both agents get marks across reattach and on remote hosts with no adapter.
ADR 0050 already rejected hooks as the source: one agent each, edits to the user's own agent settings, no lifetime rules, and reattach and remote correctness belonging to the agent that owns the session. A report CLI and screen detection have even less reason now that the agents report themselves. The reasoning and what would reopen it are in .out-of-scope/agent-lifecycle-hooks.md.
One gap turned up in triage: Codex reports without first probing for support, so Workroom shows its marks but never alerts or counts its requests. That's tracked in #481.
Activity
joelmoss commentedon Oct 16, 2026
Closing as wontfix.
The need behind this issue is met without hooks. #358 shipped OSC 7501 program status through wr-agent (ADR 0050). Claude Code 2.1.295 and later report working, blocked, done and clear, and Codex does too since openai/codex#52725 and #54114 (
app=codex, withkindon blocked). So Codex panes are no longer without a busy state, and both agents get marks across reattach and on remote hosts with no adapter.ADR 0050 already rejected hooks as the source: one agent each, edits to the user's own agent settings, no lifetime rules, and reattach and remote correctness belonging to the agent that owns the session. A report CLI and screen detection have even less reason now that the agents report themselves. The reasoning and what would reopen it are in
.out-of-scope/agent-lifecycle-hooks.md.One gap turned up in triage: Codex reports without first probing for support, so Workroom shows its marks but never alerts or counts its requests. That's tracked in #481.
🤖 Left by Claude Code.
docs: record why agent lifecycle comes only from OSC 7501