learningequality / learningequality/ricecooker
`remote/session.py` — tmux session lifecycle (the run lock)
Open
@rtibblesbot is already working on this.
Since Jul 24, 2026.
TAG: new feature
- Dominant language
- Python
- Stars
- 31
- Forks
- 77
- Avg merge
- 5d 4h
- Merged PRs (30d)
- 3
Description
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
A session.py module that manages the tmux session which is the run: create it detached, attach, report status, kill. The session is the lock — a live session means that script is busy, so there is no separate lockfile to go stale.
Complexity: Medium
Target branch: main
Context
- Session name
ricecooker-<name>. - Runs its tmux commands over ssh through
transport.py(#704). - Bookkeeping lives under
.ricecooker-remote/in the chef dir on the box; the exit code is written there when the command finishes.
The Change
- Model three states of a session: none, live, and finished-but-lingering.
- Identify a finished pane by the presence of
.ricecooker-remote/exitcode, so nothing separate can go stale. - Keep a finished pane readable with
remain-on-exitrather than letting it vanish. - Refuse to attach silently when stdin is not a TTY.
Out of Scope
- Deciding whether to attach or start fresh (
driver.pyorchestrates that from status). - Building the command that runs inside the session, and its env (
driver.py).
Acceptance Criteria
- Creates a detached session
ricecooker-<name>running a supplied command, withremain-on-exitset. - Status reports "no session" when none exists.
- Status reports a live session with its start time.
- Status reports a finished pane with its exit code, read from
.ricecooker-remote/exitcode. - Attach connects via transport's
-tPTY form. - Attach from non-TTY stdin refuses with a distinct exit code instead of silently attaching.
- Kill tears down the session and any lingering pane.
AI usage
Claude (Claude Code) drafted this from the design spec; I directed the design and reviewed it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.