ai-devkit
ai-devkit copied to clipboard
spike+feat: report agent status to Rex via OSC 7501 program status
Summary
Spike, then implement: make every agent ai-devkit supports report its state to Rex through the Program Status Protocol (OSC 7501), and add ai-devkit's own workflow context (lifecycle phase, task progress) as child records.
Why
Rex shows OSC 7501 state as tab spinners, blocked markers, and session picker indicators. Today only agents that emit it natively light up (Claude Code reports app=claude-code in this pane). rex skill setup covers Claude Code, Codex, OpenCode and Pi, with no hook for OpenCode/Pi. ai-devkit already tracks running/waiting/idle for ~12 harnesses (Gemini, Kiro, Copilot, Devin, OpenCode, Pi, ...), so it can fill the gap. This is the main thing ai-devkit adds on top of Rex.
Spike questions
- [ ] Which harnesses already emit OSC 7501 natively? (avoid double-reporting the root record)
- [ ] Can a harness hook write the sequence to the pane? The escape has to come from a process attached to the pane's pty, so likely hook ->
/dev/tty, not the daemon. Verify per harness. - [ ] Mapping:
running->working,waiting->blocked(kind=permission/ input),idle->idle, finished turn ->done.
Implementation (after spike)
- Report the root record only for harnesses that don't do it themselves.
- Child records owned by ai-devkit, e.g.
id=devkit/phasewithtitle= current dev-lifecycle phase, andprogressfrom the task CLI. - Feature-detect with
OSC 7501 ; ? STand keep it a no-op outside Rex. msg/titlemust be base64, single line, no control characters (per spec limits).
Acceptance criteria
- [ ] Spike write-up with findings per harness
- [ ] At least one non-native harness shows working/blocked in Rex tab headers
- [ ] Lifecycle phase visible as a child record for agents running dev-lifecycle