Skip to content
Merged
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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ runcoder ~/code/my-project
far. **Press q there (or Ctrl+C, or close the window) and it deletes the server**, then prints
what the session cost. q works from the deploy on, also while the model downloads (not during
the setup and session questions before it). While the session runs, r reopens Qwen Code where
you left off.
you left off. **On Windows, press q or Ctrl+C rather than closing the window**: Windows ends a
closed console's programs about 10 seconds later, which can be before the delete is done. If
you closed it anyway, run `runcoder down`.

If the folder has earlier Qwen Code sessions, runcoder asks whether to continue the latest
(c), pick one (p), or start fresh (Enter). `-c`, `-p` and `-n` answer that in advance.
Expand All @@ -68,7 +70,7 @@ Other commands:

Something that bills by the second must never be left running. runcoder deletes the server when:

- you press q, press Ctrl+C, or close its window;
- you press q, press Ctrl+C, or close its window (on Windows, see the note under "Use" above);
- Qwen Code has been closed for 15 minutes (`RUNCODER_QWEN_IDLE_MINUTES`);
- the session reaches 150 minutes (`RUNCODER_MAX_MINUTES`);
- the model is lost and does not come back after three tries;
Expand Down
5 changes: 3 additions & 2 deletions src/session.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ async function lock() {
other = JSON.parse(readFileSync(paths.lock, "utf8"));
} catch {}
// Only the runcoder that wrote the lock counts: a process ID reused since has another command
// line. If the command line could not be read then, any live process with that ID counts.
if (other.pid && alive(other.pid) && (!other.command || (await commandOf(other.pid)) === other.command)) {
// line. If the command line could not be read, then or now, any live process with that ID counts.
const now = other.pid && alive(other.pid) ? await commandOf(other.pid) : null;
if (now !== null && (!other.command || !now || now === other.command)) {
die(`runcoder is already running (process ${other.pid}). Use that window, or run: runcoder down`);
}
rmSync(paths.lock, { recursive: true, force: true });
Expand Down
Loading