Open
Conversation
…ocesses
API Endpoints:
- POST /v1/process - Start a new process
- GET /v1/process - List all processes
- GET /v1/process/{id} - Get process details
- POST /v1/process/{id}/stop - Stop a process (SIGTERM)
- POST /v1/process/{id}/kill - Kill a process (SIGKILL)
- DELETE /v1/process/{id} - Delete a process and clean up logs
- GET /v1/process/{id}/logs - Read process logs (supports tail, follow via SSE)
Features:
- Log files written to ~/.local/share/sandbox-agent/processes/{id}/
- stdout.log, stderr.log, combined.log
- Process state persisted to state.json for server restart survival
- Status tracking: starting, running, stopped (with exit_code), killed
- Real-time log streaming via SSE with follow=true query param
- Environment variables and working directory support
Cleanup rules:
- Process exits naturally → logs preserved
- DELETE endpoint → logs removed
Backend changes:
- Add timestamps to log lines: [2026-01-30T12:32:45.123Z] <line>
- stdout.log and stderr.log get timestamps per line
- combined.log includes [stdout]/[stderr] prefix after timestamp
- Add strip_timestamps query param to GET /process/{id}/logs
- Use time crate with RFC3339 format for timestamps
Frontend changes:
- Add Processes tab to inspector debug panel
- Show list of processes with status badges (running/stopped/killed)
- Click to expand and view logs
- Log viewer options:
- Select stream: combined, stdout, stderr
- Toggle strip_timestamps
- Refresh logs button
- Action buttons: stop (SIGTERM), kill (SIGKILL), delete
- Auto-refresh process list every 5 seconds
|
🚅 Deployed to the sandbox-agent-pr-42 environment in sandbox-agent
|
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.
Summary
Adds a Process Manager API for spawning and managing background processes.
API Endpoints
POST /v1/process— Start a new processGET /v1/process— List all processesGET /v1/process/{id}— Get process detailsPOST /v1/process/{id}/stop— Stop (SIGTERM)POST /v1/process/{id}/kill— Kill (SIGKILL)DELETE /v1/process/{id}— Delete process + logsGET /v1/process/{id}/logs— Read logs (with streaming support)Features
Inspector UI