Per-pane session recording + replay #908
Replies: 1 comment
|
Adding a concrete consumer for this, with a use case that only the PR 1 half solves — recording at the PTY tap, before the parser. Putting the measurements here because they say something specific about where the tap has to be, and because I don't think the read-side APIs can be extended to cover it. I run an unattended supervisor around a coding agent. It has to notice one-shot things in the agent's output —/a login prompt, a rate-limit message, a crash banner / and act on each exactly once. On tmux that's Measured on 0.8.0 (protocol 19, schema_version 1) against an isolated server, in case it helps scope PR 1:
Which is the argument for your tap point being the load-bearing decision in PR 1, more than the storage format: the PTY actor is the only place where bytes still exist. A recorder fed from the grid would inherit all three limits above and be no better than Two asks from the consumer side, both cheap, both about being able to trust the file:
On your two open questions, for what one data point is worth: 100MB is generous for my case (a day of one agent's output is single-digit MB), and I'd take a smaller default with the rotation marker over a larger one without it. One scoping note that might help this land: PR 1 is fully useful on its own to programmatic consumers. Related threads, since they keep converging on this one: #1277 (race-free change detection — a moving revision tells you that something changed; this is the only proposal that gives you what), #1270 (subscribe replay semantics), #2577 (a CLI verb for the event stream). Happy to run a build of PR 1 against a 24/7 workload and report back specifically on rotation and the loss path — those only misbehave after days, which is awkward to cover in a round-trip test. |
Uh oh!
There was an error while loading. Please reload this page.
First-time contributor here, working through your contribution flow per CONTRIBUTING.md.
The thing I keep reaching for in herdr: durable recording of what an agent did in a pane, so I can play it back after it exits or wanders off-course. tmux scrollback is lossy and dies with the session; herdr currently has nothing equivalent.
I had in mind splitting this into 2-3 narrow PRs, scoped like this:
PR 1 — server-side recording (foundation)
src/pty/actor/; writes happen off the PTY hot path so live-display latency is unchangedsrc/persist/recording/module; no new top-level dependenciesPR 2 — replay surface
herdr replay <pane-id>andherdr recording listCLI subcommandssrc/api/recordings.rsdocs/next/api/herdr-api.schema.jsontests/recording_roundtrip.rsPR 3 — TUI scrubber
?-bindings help is my reference)ctrl+bthenrto open; arrows to scrub, enter to seek; click-drag on the timelinesrc/app/state.rs; server-runtime stays clean per your runtime/client boundary in AGENTS.mdAlignment
Sits next to
src/agent_resume.rs— recording is the runtime-level layer the metadata layer orchestrates. The vendoredlibghostty-vtis reused for replay rendering, no parallel parser.Test surface
Just
just checkandjust ci. No new deps. Unit tests next to the new code, integration test intests/recording_roundtrip.rs. Round-trip + replay-fidelity tests cover the new behavior.Two open questions to start:
~/.local/share/herdr/recordings/<pane-id>/(XDG) or do you have a per-platform convention?(I'll save the input-vs-output and PR-split-vs-single questions for after you signal this lands.)
If this is something you'd accept, I'll go through your approval flow per CONTRIBUTING.md.
— AnandSundar
All reactions