Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,14 @@ pair-programming the sphere out loud, several people, quick turns.

**Backends.** With the [Claude Agent SDK](https://pypi.org/project/claude-agent-sdk/)
installed (`pip install -e '.[vibe]'`) and a `claude` CLI on PATH (logged
in, or `ANTHROPIC_API_KEY` set), each prompt runs as its own **Claude
Code session** in the checkout, read-only, shipping through one MCP
tool that validates on the spot and hands failures straight back —
the session iterates inside its own turn. It runs in Claude Code's
in, or `ANTHROPIC_API_KEY` set), one ongoing **Claude Code session**
in the checkout takes the prompts in turn — read-only, shipping
through one MCP tool that validates on the spot and hands failures
straight back, so it iterates inside its own turn — and it remembers
the night: what it shipped and what people asked, so "like #3 but
slower" works (every generation is on disk for it to read, too). A
session idle for twenty minutes closes; the next prompt starts a
fresh one. It runs in Claude Code's
**auto** permission mode: its read-only tools and the ship tool are
pre-approved, writes, shell and web are denied outright, and only a
call outside both lists goes to the permission classifier — nothing
Expand Down
7 changes: 4 additions & 3 deletions docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ seek.
`/vibe` needs a coding model reachable from the box. Two backends,
picked automatically (`LUMINARY_VIBE_BACKEND=session|api` forces one):

- **session** — each prompt is its own Claude Code session in the
checkout (read-only tools, one MCP tool to ship through). Needs the
Agent SDK and the CLI:
- **session** — one ongoing Claude Code session in the checkout takes
the prompts in turn (read-only tools, one MCP tool to ship through; it
remembers the night, closes after twenty idle minutes and reopens on
the next prompt). Needs the Agent SDK and the CLI:

```bash
pip install -e '.[vibe]' # in the service's venv
Expand Down
4 changes: 3 additions & 1 deletion luminary/server/static/vibe.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@ function genRow(g, playing) {
}
const who = document.createElement("span");
who.className = "who";
const done = g.status === "ok" || g.status === "failed";
who.textContent =
(g.author || "") +
(g.status === "queued" ? " · queued" : g.status === "cooking" ? " · cooking…" : "") +
(g.model ? ` · ${g.model.replace(/^claude-/, "")}` : "");
(g.model ? ` · ${g.model.replace(/^claude-/, "")}` : "") +
(done && g.seconds != null ? ` · ${Math.round(g.seconds)} s` : "");
head.appendChild(who);
row.appendChild(head);
const prompt = document.createElement("div");
Expand Down
6 changes: 6 additions & 0 deletions luminary/vibe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def submit(self, raw: Dict[str, Any]) -> Dict[str, Any]:
"status": "queued",
"error": "",
"file": "",
"seconds": None,
"created": _now(),
}
self.generations.append(entry)
Expand Down Expand Up @@ -178,6 +179,7 @@ def process_one(self, block: bool = False, timeout: float = 0.5) -> bool:
entry["status"] = "cooking"
self._working = entry
self._save_log()
started = time.monotonic()
try:
self._cook(request, entry)
except (
Expand All @@ -188,6 +190,7 @@ def process_one(self, block: bool = False, timeout: float = 0.5) -> bool:
logger.exception("vibe #%d failed", entry["n"])
finally:
with self._lock:
entry["seconds"] = round(time.monotonic() - started, 1)
self._working = None
self._save_log()
return True
Expand Down Expand Up @@ -283,6 +286,9 @@ def stop(self) -> None:
if self._thread is not None:
self._thread.join(timeout=2.0)
self._thread = None
close = getattr(self.coder, "close", None) # a session backend holds one
if callable(close):
close()

# ------------------------------------------------------------- helpers

Expand Down
Loading
Loading