feat: add raw session args/opts for agent passthrough

This commit is contained in:
Nathan Flurry 2026-02-05 11:32:39 -08:00
parent 375d73e4cb
commit 2f26f76d9b
14 changed files with 365 additions and 37 deletions

View file

@ -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