learningequality / learningequality/ricecooker

`remote/session.py` — tmux session lifecycle (the run lock)

Open
#705 1 comment 1 reaction 1 assignee View on GitHub

@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-exit rather 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.py orchestrates 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, with remain-on-exit set.
  • 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 -t PTY 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.