Skip to content

feat(web): sandbox settings, open sessions and computer time on the sandbox toolkit page (#225) - #317

Merged
ian-pascoe merged 1 commit into
mainfrom
issue-225-sandbox-panel
Oct 21, 2026
Merged

ian-pascoe merged 1 commit into
mainfrom
issue-225-sandbox-panel

Conversation

@ian-pascoe

Copy link
Copy Markdown
Collaborator

Closes #225

Summary

The sandbox toolkit's page (/tools/sandbox) now has what the browser toolkit's has: its settings, the org's open sessions, and computer time in usage.

<ToolkitPage> (apps/web/src/pages/ToolkitSandbox.tsx)
  facts: Network, Computer (members read them too)
  Prices: price per computer hour (same field as the browser's)
  <SandboxSettings>            org admins: ceiling network + "May use the computer", saves only what changed
    <NetworkPicker>            components/NetworkPicker, shared with the agent editor's sandbox
  <SandboxSessions>            every member: GET /sandbox-sessions, own first, End (confirmed)

Usage › tool calls: computer time column, log text, totals and facts

GET|DELETE /v9/management/sandbox-sessions
  Tools part listSandboxSessions / endSandboxSession
    mayBeOpen(now, 200+1, member?)          member filter in SQL, then the cap
    SandboxProvider.status (RPC SandboxSession.status)   read only, no use of the session
    end = purge(settle) → #chargeClosed → #countTime("computerHours")
  • A member sees their own sessions, an org admin the org's; a session's files are never read or shown.
  • The list holds the oldest 200 of the caller's view and says so (truncated); a session the provider cannot be asked about is listed without network and computer, one it does not know is forgotten.
  • Ending a session charges its last computer stretch to the opener's Spend limits and counts it toward the plan's computer hours. endBrowserSession had the same gap for browser hours; fixed here.
  • Where the deployment has no computer, admins see the checkbox off with a reason; members are told nothing.
  • The agent editor's network picker is now the shared NetworkPicker: the hosts textarea sits under "Only these hosts" and carries aria-invalid when an entry is wrong.
  • browserDuration is now meteredDuration, as it words computer time too.

Evidence

  • Before: endSandboxSession and endBrowserSession charged Spend limits but left the plan's hours unchanged.
    After: both count the last stretch (packages/tools/test/plan-limits.test.ts; the two new cases fail without the fix):

    run `git status` on the computer; advance 1 min; endSandboxSession(alice)
    expect(used().computerHours).toBeCloseTo(1 / 60)
    open browser session; advance 1 min; endBrowserSession(alice)
    expect(used().browserHours).toBeCloseTo(1 / 60)
    
  • Real SandboxSession objects (packages/tools/test/sandbox-sessions.test.ts): the 201-session cap, one usage record of 60 000 µ$ when a session is ended (and none more from a late alarm or a second end), a shared agent run's session (admin only), an unreachable and a vanished session, a failed end that leaves the session open.

  • Router and Access gate (apps/app/test/sandbox-sessions.test.ts): member and admin lists, end by the member and by an admin, 404 for another member's session.

  • Panel models: sandbox-settings, sandbox-sessions, usage-tools tests in apps/web/test.

  • pnpm typecheck and pnpm lint pass; touched test files run one at a time.

Merge Danger

Door: two-way

Blast Radius: sandbox toolkit page, agent editor's network picker

The app Worker's new routes call listSandboxSessions and endSandboxSession, which a State Worker from before lacks: both routes answer 502 control plane unavailable until the State Worker is deployed; nothing else reads them.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Preview pr-317 destroyed.

…andbox toolkit page (#225)

The sandbox toolkit's page gains its network and computer among the facts (members read them), and,
for org admins, Sandbox settings: the org's ceiling as a network picker (none, only these hosts
with the package registries preset, the internet) and "may use the computer", under a note that
network access and prompt-injected tool results together leak data. Without deployment.computer
admins see the computer turned off with a one-line reason and a link to DEPLOY.md's Optional
pieces; members are told nothing. The price per computer hour is the existing prices field.

Open sessions lists a member's own sandbox sessions (when each opened, its network, whether its
computer runs) and, for org admins, the org's others, with no file details; any may be ended, which
deletes the files, writes the usage record and charges the computer's last stretch. New: the
sandbox sessions management routes (GET and DELETE /sandbox-sessions, contract and Tools part) and
SandboxProvider.status. Usage's tool-call view words computer time as it words browser time.

The agent editor's network picker is now the shared NetworkPicker.
@ian-pascoe
ian-pascoe force-pushed the issue-225-sandbox-panel branch from 365aad0 to f8a7240 Compare October 21, 2026 16:45
@ian-pascoe
ian-pascoe merged commit ba039f6 into main Oct 21, 2026
11 checks passed
@ian-pascoe
ian-pascoe deleted the issue-225-sandbox-panel branch October 21, 2026 16:53

This branch was successfully deployed

1 active deployment
preview — f8a7240f Deployed Oct 21, 2026 by ian-pascoe via destroy preview #563
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.

Sandbox toolkit panel: sandbox settings, the computer-hour price and sandbox usage

1 participant