mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-16 00:03:04 +00:00
feat: add raw session args/opts for agent passthrough
This commit is contained in:
parent
375d73e4cb
commit
2f26f76d9b
14 changed files with 365 additions and 37 deletions
|
|
@ -669,7 +669,9 @@
|
|||
"mcpTools",
|
||||
"streamingDeltas",
|
||||
"itemStarted",
|
||||
"sharedProcess"
|
||||
"sharedProcess",
|
||||
"rawSessionArgs",
|
||||
"rawSessionOptions"
|
||||
],
|
||||
"properties": {
|
||||
"commandExecution": {
|
||||
|
|
@ -702,6 +704,14 @@
|
|||
"questions": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"rawSessionArgs": {
|
||||
"type": "boolean",
|
||||
"description": "Whether this agent supports raw CLI arguments passed at session creation"
|
||||
},
|
||||
"rawSessionOptions": {
|
||||
"type": "boolean",
|
||||
"description": "Whether this agent supports raw options passed at session creation"
|
||||
},
|
||||
"reasoning": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
|
@ -1074,6 +1084,20 @@
|
|||
"variant": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"rawSessionArgs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"nullable": true,
|
||||
"description": "Raw CLI arguments to pass to the agent (for CLI-based agents like Claude, OpenCode, Amp)"
|
||||
},
|
||||
"rawSessionOptions": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"nullable": true,
|
||||
"description": "Raw options to pass to the agent (for long-running server agents like Codex)"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -62,6 +62,26 @@ await client.createSession("demo-session", {
|
|||
await client.postMessage("demo-session", { message: "Hello" });
|
||||
```
|
||||
|
||||
### Raw session arguments
|
||||
|
||||
Pass low-level arguments directly to agents at session creation:
|
||||
|
||||
```ts
|
||||
// CLI args for Claude, OpenCode, Amp (not Codex)
|
||||
await client.createSession("my-session", {
|
||||
agent: "claude",
|
||||
rawSessionArgs: ["--max-turns", "5"],
|
||||
});
|
||||
|
||||
// Options passed through agent's native protocol (long-running servers only)
|
||||
await client.createSession("my-session", {
|
||||
agent: "codex",
|
||||
rawSessionOptions: { sandbox: "workspace-write" },
|
||||
});
|
||||
```
|
||||
|
||||
Check `capabilities.rawSessionArgs` and `capabilities.rawSessionOptions` to see what each agent supports.
|
||||
|
||||
List agents and inspect feature coverage (available on `capabilities`):
|
||||
|
||||
```ts
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ This table shows which agent feature coverage appears in the universal event str
|
|||
| File Changes | - | ✓ | - | - |
|
||||
| MCP Tools | - | ✓ | - | - |
|
||||
| Streaming Deltas | ✓ | ✓ | ✓ | - |
|
||||
| Raw Session Args | ✓ | | ✓ | ✓ |
|
||||
| Raw Session Options| ✓ | ✓ | ✓ | ✓ |
|
||||
|
||||
Agents: [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview) · [Codex](https://github.com/openai/codex) · [OpenCode](https://github.com/opencode-ai/opencode) · [Amp](https://ampcode.com)
|
||||
|
||||
|
|
@ -76,6 +78,12 @@ Agents: [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude
|
|||
<Accordion title="Streaming Deltas">
|
||||
Native streaming of content deltas. When not supported, the daemon emits a single synthetic delta before `item.completed`.
|
||||
</Accordion>
|
||||
<Accordion title="Raw Session Args">
|
||||
Pass raw CLI arguments directly to the agent at session creation via `rawSessionArgs`. Only supported for CLI-based agents (Claude, OpenCode, Amp). Codex uses JSON-RPC, so CLI args are not applicable.
|
||||
</Accordion>
|
||||
<Accordion title="Raw Session Options">
|
||||
Pass raw options to the agent at session creation via `rawSessionOptions`. For long-running server agents, options are passed through the agent's native protocol. For Codex, options are merged into the `thread/start` config.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
Want support for another agent? [Open an issue](https://github.com/rivet-dev/sandbox-agent/issues/new) to request it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue