Skip to content

orca sessions sleep: put a session's sandbox to sleep now (D6.7) - #54

Merged
ahokik merged 1 commit into
mainfrom
sandbox-sleep
Oct 20, 2026
Merged

ahokik merged 1 commit into
mainfrom
sandbox-sleep

Conversation

@ahokik

@ahokik ahokik commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What it adds

  • orca sessions sleep <id> [--no-wait]: puts a session's sandbox to sleep now; its next message wakes it. It calls POST /api/sessions/{id}/sandbox/sleep, then reads GET /api/sessions/{id}/sandbox every second for up to 10 minutes while the sandbox is going to sleep.
    • Exit 0: asleep, already asleep, no sandbox, --no-wait, and the 10-minute limit (the sleep goes on on the server).
    • Exit 1 with the server's message: too_large, failed, interrupted (last_sleep.message) and a 409 refusal (a turn is running, or the sandbox is waking up). 404 stays exit 4.
    • --json prints the final session.sandbox object, with the same exit codes.
  • orca sessions get gains a sandbox line (awake, going to sleep, asleep, waking up, none). If the read fails, as on a server without the route, the line is left out and the command still succeeds.
  • MCP: new tool sleep_session (waits up to 60 seconds, returns state and last_sleep; the last poll starts by 55 seconds so the answer lands inside the 60-second request timeout MCP clients default to). get_session gains sandbox.
  • ApiClient.sessionSandbox / sleepSessionSandbox, type SessionSandbox (last_sleep.reason is an open string; an unknown reason is shown like any other).
  • README, the cheatsheet and the use-orca skill list the command and tool.
  • Version 1.5.0 (package.json, package-lock.json, plugin.json). Not published.

Design: https://github.com/okikorg/orca-design/blob/main/designs/sandbox-sleep.md (orca-design #123).

Needs the server first: the orca-agent-server PR for D6.7 (being opened in parallel) must be deployed before this is released. Until then the routes do not exist: sessions sleep fails as not found, and sessions get just leaves out the sandbox line.

Local CI

GitHub Actions minutes are used up, so these ran locally on a985348:

npm run typecheck   > tsc --noEmit            (no errors)
npm run lint        > eslint .                (no problems)
npm run build       ESM ⚡️ Build success
npm test            Test Files  41 passed (41)
                    Tests  537 passed (537)

Also checked the built CLI against a local mock server: the wait-then-asleep path, --json, --no-wait, and a 409 refusal (exit 1, the server's message).

The D6.7 PRs

🤖 Generated with Claude Code

… (D6.7)

- sessions sleep <id> [--no-wait]: POST /api/sessions/{id}/sandbox/sleep,
  then reads GET /api/sessions/{id}/sandbox every second for up to 10
  minutes. Exit 0 for asleep, already asleep, none, --no-wait and the
  10-minute limit; exit 1 with the server's message for too_large, failed,
  interrupted and a 409 refusal. --json prints the final session.sandbox.
- sessions get and get_session gain sandbox (the state), left out when the
  server cannot say.
- MCP tool sleep_session: waits up to 60 seconds, returns the view.
- README, cheatsheet and use-orca skill list the command and tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant