Repository navigation
Persistent computers: refuse to open one another run is using - #94
Merged
Merged
Conversation
This was referenced Dec 4, 2026
Merged
openPersistent() connected to a persistent computer that another run had
starting or running, and either run's close() then stopped it under the
other. It now throws SESSION_BUSY and leaves the computer alone, naming
attach(id, { stopOnClose: false }) for working next to that run and
attach(id) + close() for a computer a killed script left running. Same in
Python and Go.
Docs and the revyl-verify skill also list a Mac's input limits and the
cloud browser's 20-second first-page timeout.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…h once running A start Revyl refused with run_conflict no longer counts as attempted, so a later timeout can't stop a computer another run started meanwhile. The SESSION_BUSY message says to attach once a starting computer is running, since attach() needs a running one. Docs: hover sentence placement, how to type punctuation on a Mac, and the new SESSION_BUSY cause in errors.md. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
anamhira47
force-pushed
the
capy/persistent-refuse-running
branch
from
December 5, 2026 00:21
db7300a to
55ec27b
Compare
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e-running Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
…e-running Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the safety gap /verify dogfooding found (REV-6859):
openPersistent(name)connected to a persistent computer that another run already had starting or running, and either run'sclose()then stopped the computer under the other.What changes
openPersistent/open_persistent/OpenPersistentthrowSESSION_BUSY(GoErrSessionBusy) for a computer that isstartingorrunning, before connecting and without stopping it. That covers both the computer's state at open, and a computer another run starts while this call waits for a stop to finish saving. A computer that is stillstoppingis waited for, as before. A start Revyl refuses withrun_conflictno longer counts as attempted, so a timeout afterwards can't stop a computer another run started in the meantime. Before, the catch path could do that.fromSnapshot. It names the computer's ID in two existing calls:attach(id, { stopOnClose: false })to work next to that run without stopping it (for astartingcomputer, "once listPersistent() shows it running", sinceattach()needs a running computer), andattach(id)thenclose()to stop a computer a killed script left running, keeping its disk.api.md, the persistent-computers guide, the Python and Go READMEs) and therevyl-verifyskill say so. CHANGELOG entries are under 0.9.3, Python 0.7.3 and Go v0.8.3, after Verify 0.9.2 / Python 0.7.2 / Go v0.8.2: print a failure as CODE: message after close() in finally #84's 0.9.2.revyl-verifyskill (behaviour already in 0.9.1): a Mac's input limits ('meta'is Command and'cmd'throws, no punctuation keys, no hover,typeFocused()needs{ clear: false }) and the cloud browser's 20-second first-page timeout (SESSION_START_FAILED), with what to do about a cold dev server.No new public option
There's no opt-in to connect anyway. Both real reasons to touch a running persistent computer, working next to the run that holds it and recovering one a killed script left running, are covered by
attach(), which already ships in all three languages and was checked live against a persistent computer (below). One rule, "a persistent computer has one run at a time", is easier for an agent to get right than a flag.Where the check lives
Revyl reports a persistent computer's state on
GET /api/v1/computer-runs/persistentandGET /api/v1/computer-runs/{id}(starting,running,stopping,stopped; a run that is ending readsstopping).POST …/{id}/starton a computer that is alreadystartingorrunninganswers 200 with its status: it's idempotent and doesn't say who started it. So the SDK refuses on the state it reads. One window remains: two runs that start the same stopped computer within moments of each other both get 200 and both connect. Closing that needs the backend to refuse a start that it didn't perform (it already refuses pinned starts withcomputer_not_stopped); that's a backend follow-up, not in this PR.Proof
run_conflictcleanup gap, and attach advice for astartingcomputer), plus three low-severity doc fixes.npm run build,npm run typecheck,npm test(317 passed),check:package,check:links; Python ruff, format, mypy, pytest (780 passed); Go gofmt, vet,go test ./.... Existing tests unchanged; no tests added (org rule).openPersistentwith the same name and gotSESSION_BUSYwith the message above. The computer stayedrunning.attach(id, { stopOnClose: false })ranexec(['sw_vers', '-productName'])(macOS), and itsclose()left the computerrunning.running, andopenPersistentstill refused it.attach(id)+close()then stopped it, andlistPersistent()showed itstoppedwith a freshsavedAt.Release
Behaviour change for anyone who relied on connecting to a running computer, so it ships as its own release after 0.9.2 (#84). Never tagged or merged here. docs.revyl.com is updated in the draft RevylAI/cognisim-monorepo#8750, which merges with the release.
Note
Medium Risk
This is a breaking behavior change for anyone who relied on connecting to an already-running persistent computer; the new path is well-documented but agents and CI may need to use separate names or
attach.Overview
Persistent computers now enforce one run at a time.
openPersistent/open_persistent/OpenPersistentno longer attaches to a computer that isstartingorrunningin another run; they throwSESSION_BUSYand leave the machine alone, avoiding the case where either run'sclose()could stop the computer under the other. Waiting for astoppingsave still works; failed starts withrun_conflictno longer mark the open as "attempted," so error cleanup won't stop a computer another run started meanwhile. Errors point callers atattach(stopOnClose: falseto work alongside the other run, orattach+closeto recover a machine left running after a killed script), alternate names, or snapshot copies.Docs, CHANGELOG (0.9.3 / Python 0.7.3 / Go 0.8.3), and the
revyl-verifyskill describe the new rule and drop the note thattimeoutMsis skipped when reconnecting to an already-running persistent Mac.Documentation-only: Mac input limits (
metavscmd, no punctuation keys, no hover,typeFocusedneeds{ clear: false }) and the cloud browser's 20-second first-page timeout are spelled out incomputers.md,web.md, and the skill.Reviewed by Cursor Bugbot for commit 34365b7. Bugbot is set up for automated code reviews on this repo. Configure here.