mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 08:03:46 +00:00
1,012 B
1,012 B
Spec: Command + Shell Execution
Proposed API Changes
- Add command execution APIs to the core session manager (non-PTY, single-shot).
- Define output capture and error handling semantics in the session event stream.
Summary OpenCode routes for command/shell execution should run real commands in the session context and stream outputs to OpenCode message parts and events.
OpenCode Endpoints (Reference)
GET /opencode/commandPOST /opencode/session/{sessionID}/commandPOST /opencode/session/{sessionID}/shell
Core Functionality Required
- Execute commands with cwd/env + timeout support.
- Capture stdout/stderr, exit code, and duration.
- Optional streaming output to session events.
- Map command output into OpenCode
message.part.updatedevents.
OpenCode Compat Wiring + Tests
- Replace stubs for
/command,/session/{sessionID}/command,/session/{sessionID}/shell. - Add E2E tests to run a simple command and validate output is returned and events are emitted.