Repository navigation
Description
Problem
On macOS, every Grok pane shows "Conversation unavailable" and falls back to Terminal, even when nothing about the session is ambiguous. The Grok reader binds a pane by the process's held events.jsonl and its GROK_HOME, and today it reads both from /proc only (#1207: "macOS and Windows still show the terminal view, because that evidence is read from /proc"). Claude Code and Codex panes already get chat on macOS. #776 first proposed Linux, macOS and Windows paths; the reader that shipped (#777) binds on Linux only.
Proposal
Read the same evidence on macOS and keep the binding rule exactly as on Linux. Chat shows only when the Grok process holds one events.jsonl session and that session is the ID Herdr reports. Anything else stays on Terminal.
- Held files:
lsof -nPbw -a -p <pid> -Ffn, the callagy-store.tsmakes for Antigravity's lock, plus descriptor fields (-Ffnrather than-Fn). Numeric descriptors are the holds. The firsttxtentry is the executable; macOS lists mapped files as latertxtentries. GROK_HOME:ps -E -ww -p <pid> -o command=, ascodex.tsandclaude-store.tsalready readCODEX_HOMEandCLAUDE_CONFIG_DIR.- Fail closed: a failed or timed-out command, an over-long or incomplete listing, or a name that cannot be read back keeps the pane on Terminal. It never produces a shorter list.
- Windows: unchanged.
I have this working on a branch, with unit tests and a macOS-only test that runs the real lsof and ps against a stand-in process. I also checked it by hand against live Grok 1.0.52 and 1.0.60 on Apple silicon. I'll open the PR if this is welcome. It touches server/grok-store.ts, the same place as #1352, so it would follow whichever binding rule lands there.
Where
Chat and prompt cards
Where it exists today
herdr web ui itself: Grok chat on Linux (#777, #1207), Claude Code and Codex chat on macOS, which read process environment with ps -E; Antigravity, which reads held files with lsof.
Workarounds and alternatives
Today: use Terminal for Grok panes on macOS.
Alternative: have Grok, or a status-line helper, report the current session file, as #776 sketched. That needs configuration on the user's side; reading the process needs none.
Activity
devswha commentedon Oct 24, 2026
Thanks, this is welcome; please open the PR. It brings Grok chat on macOS closer to the existing Linux support.
lsofandps -Eare reads already used byagy-store.ts,codex.tsandclaude-store.ts.#1352 has merged since this issue was opened, so please build on
server/grok-store.tsas it is on main. Change the evidence-reading platform path, not the binding rule:herdr:grok) chooses the conversation; held-file evidence must never select another session.GROK_HOME, otherwise itsHOME/.grok); do not substitute the bridge’s home.events.jsonl; ties fail closed.grokHeldSessionschecks this with device/inode identity on Linux.Please run
lsofandpsas awaited children with bounded timeouts, notspawnSync: resolution runs periodically for watched panes. Keep Windows on Terminal and updatedocs/grok-chat.mdto describe macOS support. The Native macOS session identity job in.github/workflows/ci.ymlruns a fixed test list, so add the macOS-only test there if it should run in CI.devswha commentedon Oct 24, 2026
Thanks, this is welcome: please open the PR. It brings Grok chat on macOS level with Linux.
lsofandps -Eare the same readsagy-store.ts,codex.tsandclaude-store.tsalready make.#1352 has merged since you wrote this, so please build on
server/grok-store.tsas it is on main. Change only where the evidence comes from, not the binding rule:herdr:grok) chooses the session. A held file never chooses a different one.GROK_HOME, else itsHOME/.grok). The bridge never falls back to its own home.events.jsonlfiles, and a tie fails closed. So "the process holds oneevents.jsonlsession" in the proposal becomes "the process holds herdr's session, and it is the newest held".events.jsonlthat is deleted, renamed (events.jsonl.old) or not the same file as its path keeps the pane on Terminal. On Linux,grokHeldSessionschecks this by comparing device and inode.A few more points for the PR:
lsofandpsas awaited children with a timeout, asagy-store.tsdoes, never withspawnSync. The resolver runs every few seconds for each watched pane.docs/grok-chat.md..github/workflows/ci.yml). To run your macOS-only test on every PR, add it to that list, and mention it in the description because that change touches a workflow.345ml commentedon Oct 24, 2026
@devswha
Thanks!
I made this PR. #1858
feat(chat): show Grok chat on macOS when Herdr's session is newest (d…