Skip to content

feat: phase 3, jump to agents, pause, OpenCode and live Claude status - #4

Merged
darkstardevx merged 7 commits into
mainfrom
feat/phase3-polish
Nov 27, 2026
Merged

darkstardevx merged 7 commits into
mainfrom
feat/phase3-polish

Conversation

@darkstardevx

Copy link
Copy Markdown
Contributor

Phase 3 of the spec ("Delivery" item 3): Runeway can take you to an agent, pause, show OpenCode agents, and show a discovered Claude's real status. The README gets real screenshots.

Runeway world view from the demo

What changes

  • 🚪 Enter goes to the selected agent.
    • An agent-deck session with tmux: switch to it inside tmux, or show the tmux attach command outside.
    • Any other agent: Runeway finds its process and walks up to the window that owns it, then asks Hyprland to focus it.
      • Claude: the exact pid from Claude's session record.
      • Codex / OpenCode: the one terminal process of that name in the agent's folder. Background services are skipped, and a wrapper plus its child counts once.
    • Two real agents in one folder: it says it can't tell which instead of guessing.
    • The result shows as a 3-second footer notice in both views. tmux and hyprctl run without a shell, with their output captured.
    • Hyprland 0.57+ gets the Lua dispatch (hl.dsp.focus); older versions get focuswindow.
  • ⏸️ p pauses. Lanes freeze, keys still work, and resuming doesn't race through the missed time.
  • 🛸 OpenCode agents, from ~/.local/share/opencode/opencode.db:
    • Opened read-only, with a 200 ms busy timeout. Only session_v2 and session_message are read.
    • Tool calls map to the runner's moves (read, search, edit, shell running / passed / failed, a question = waiting). Only a tool's name, status, a file name and a command's first word are read.
    • A missing database is silent; a locked or odd one never panics or hangs, and a brief error keeps the lanes.
    • runeway check gains an opencode line, and --opencode-db PATH overrides the location.
  • 🧙 Live status for discovered Claude sessions, from ~/.claude/sessions/<pid>.json:
    • Only pid, sessionId, status and procStart are read; the .key files are never opened.
    • busy → running, idle → idle, waiting → the gate.
    • A record counts only while its process (with a matching start time) is alive.
  • 📸 Screenshots. cargo run --example screenshot draws the demo's world and list views as SVGs in docs/screenshots/. The README shows them and documents everything above.
  • 🔍 tests/originality.rs also scans examples/ and no longer trips on dates.
  • ⬆️ Minimum Rust 1.89, because rusqlite 0.43 (bundled SQLite) needs it. The CI MSRV job moves to 1.89.

Verification

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings and cargo test all pass (149 lib + 27 bin + 11 CLI + 4 originality tests).
  • Owner's machine:
    • Real opencode.db (v2.4.1) opens and queries with its real schema.
    • Both live Claude sessions show their own status.
    • In a pty, Enter on the agent-deck lane showed the attach command, and on a Claude lane focused its Ghostty window.
  • Whole-branch review: no critical findings. Four important ones are fixed in the last commit, each with a test that failed first:
    • notices invisible in the list view
    • reused pids
    • daemons counted as agents
    • OpenCode lanes vanishing on a brief error

Known follow-ups (minor):

  • hyprctl clients -j runs on every Enter, with no timeout.
  • SQLite is opened once per OpenCode lane per poll.
  • OpenCode busy/idle is coarse.
  • tmux -t is not exact-match.
  • The jump's folder match doesn't resolve symlinks.
  • check wording for a broken database.
  • Two README sentences.

Plan: docs/superpowers/plans/2026-11-27-runeway-phase3-polish.md.

👻 Code & Design by Darkstardevx 🤖 Generated with Claude Code

darkstardevx and others added 7 commits November 27, 2026 07:33
Live status for discovered Claude sessions from Claude's session
records, OpenCode agents from its SQLite database, Enter to jump to an
agent's tmux session or Ghostty window, p to pause, and SVG
screenshots for the README. The process fallback is dropped.

Project contributor

👻 Code & Design by Darkstardevx 🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code keeps a small record per running process in
~/.claude/sessions/<pid>.json. Runeway now reads three fields from it
(pid, sessionId, status) and never opens the .key files beside them.

- A discovered Claude session takes Claude's own status: busy →
  running, idle → idle, anything about waiting or permission →
  waiting, so a discovered agent can stop at the gate too. Unknown
  values keep the transcript-age status.
- Records whose process is gone are ignored.
- Session::pid carries the process id, for jumping to the agent.

Project contributor

👻 Code & Design by Darkstardevx 🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenCode keeps its sessions in one SQLite file
(~/.local/share/opencode/opencode.db). Runeway now opens it read-only,
with a 200 ms busy timeout, and reads only session_v2 and
session_message.

- Discovery lists top-level, unarchived OpenCode sessions updated in
  the last 10 minutes: named after their folder, running while
  OpenCode marks them busy. An agent-deck OpenCode session in the same
  folder is not shown twice.
- Each poll asks for the newest assistant message's last tool call:
  read → reading; grep, glob, web → searching; edit, write, patch →
  editing; shell running / done / failed; a question → waiting for
  you. Only the tool name, its status, a file name and a command's
  first word are read. Tokens come from the session totals.
- `runeway check` gains an opencode line; --opencode-db PATH overrides
  the location. A missing database is silent; a locked or unexpected
  one never panics or hangs.
- New dependency: rusqlite 0.43 (bundled SQLite), which needs Rust
  1.89, so rust-version and the CI MSRV job move to 1.89.

Project contributor

👻 Code & Design by Darkstardevx 🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An agent-deck session with a tmux session: inside tmux, Runeway
  switches to it; outside, the footer shows the attach command.
- Any other agent: Runeway finds its process (the exact pid from
  Claude's session record; for Codex and OpenCode, the one process of
  that name in the agent's folder) and walks up its parents to the
  window that owns it, then asks Hyprland to focus it. Two Codex or
  OpenCode agents in one folder: it says it can't tell which instead
  of guessing.
- jump::plan is pure and reads process info from a proc root passed
  in, so it is tested against a fake /proc (loops and odd process
  names included). The binary's jumper runs tmux / hyprctl without a
  shell, captures their output, and turns the result into a 3-second
  footer notice.
- Hyprland 0.57+ takes Lua dispatches (hl.dsp.focus); older versions
  get the classic focuswindow form.
- The help box no longer covers the top bar or the agent-deck notice.

Project contributor

👻 Code & Design by Darkstardevx 🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- p stops every lane where it is and says "paused · p resume" in the
  footer; p again carries on from the same frame. Keys, the help and
  jump notices keep working while paused, and nothing is drawn at the
  full frame rate.
- The animation clock keeps running while paused and the lanes simply
  skip those ticks, so resuming never races through the missed time.
- The footer and help list Enter and p.

Project contributor

👻 Code & Design by Darkstardevx 🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- examples/screenshot.rs plays the demo for 15 s and writes the world
  and list views as SVGs (docs/screenshots/): runs of one colour
  become one rect per half-row and text stays text, so they are small,
  sharp and reproducible with `cargo run --example screenshot`.
- README: the world screenshot at the top, the list one beside the
  jump notes; Enter and p; OpenCode and Claude's session records in
  the sources table; Rust 1.89.
- Demo agents now work at different paces, so their token counts and
  context meters differ.
- The list footer mentions ⏎ jump.
- tests/originality.rs also scans examples/, and matches "1-1" and
  "1up" only as words of their own, so dates no longer trip it.

Project contributor

👻 Code & Design by Darkstardevx 🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the whole-branch review:

- The list view (l) now shows jump notices and "paused" in its
  footer; before, Enter there gave no feedback at all.
- A Claude session record only counts when its process started when
  the record says (procStart = /proc/<pid>/stat field 22). A pid the
  kernel has reused for another program no longer shows as a busy
  Claude or gets its window focused.
- Finding a Codex or OpenCode agent's process now skips background
  services with no terminal (Codex's app server, `opencode serve`) and
  counts a wrapper and the process it starts once, so a single agent
  next to them is no longer "can't tell which".
- If OpenCode's database fails for a poll (locked, mid-migration), its
  lanes stay instead of vanishing and coming back.

Project contributor

👻 Code & Design by Darkstardevx 🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@darkstardevx
darkstardevx merged commit 3b8d810 into main Nov 27, 2026
2 checks passed
@darkstardevx
darkstardevx deleted the feat/phase3-polish branch November 27, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant