Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/codexcw", "bindings/node", "bindings/python"]

[workspace.package]
version = "0.6.0"
version = "0.7.0"
edition = "2021"
rust-version = "1.90"
license = "CC0-1.0"
Expand All @@ -12,7 +12,7 @@ homepage = "https://github.com/c3-oss/codexcw"
authors = ["c3-oss"]

[workspace.dependencies]
codexcw = { path = "crates/codexcw", version = "0.6.0" }
codexcw = { path = "crates/codexcw", version = "0.7.0" }
tokio = { version = "1", default-features = false, features = [
"process",
"io-util",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Three agents share the same event model:
skipped.
- **Claude Code** — the `claude` agent — spawns
`claude -p --output-format stream-json` and normalizes its events into the
same event model, with model selection between the `haiku`, `sonnet`, and
`opus` aliases and Claude permission modes on the request.
same event model, with model selection between the `haiku`, `sonnet`,
`opus`, and `fable` aliases and Claude permission modes on the request.
- **Grok Build** — the `grok` agent — spawns Grok with
`--no-auto-update`, `--output-format streaming-messages-json`, a temporary
`--prompt-file`, and `--verbatim`. It uses read-only / `dontAsk` automation
Expand Down
2 changes: 1 addition & 1 deletion account_usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func GetAccountUsage(ctx context.Context, req AccountUsageRequest) (*AccountUsag
}

// #nosec G204 -- launching the configured Codex executable is the wrapper boundary.
cmd := exec.CommandContext(ctx, executable, "-s", "read-only", "-a", "untrusted", "app-server", "--stdio")
cmd := exec.CommandContext(ctx, executable, "-s", "read-only", "-a", "never", "app-server", "--stdio")
cmd.Env = accountUsageEnv(req.Env)
// Bound teardown when killed child processes keep the pipes open.
cmd.WaitDelay = time.Second
Expand Down
2 changes: 1 addition & 1 deletion account_usage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ done
assert.Contains(t, string(usage.RawAccount), "stub@example.com")

args := readArgs(t, argsFile)
assert.Equal(t, []string{"-s", "read-only", "-a", "untrusted", "app-server", "--stdio"}, args)
assert.Equal(t, []string{"-s", "read-only", "-a", "never", "app-server", "--stdio"}, args)

envBytes, err := os.ReadFile(envFile)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion bindings/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Grok must support `streaming-messages-json`.

The Claude agent is selected with `new Runner({ agent: 'claude' })`; its
events are normalized into the same event model, with model selection via the
`haiku`/`sonnet`/`opus` aliases (`ClaudeModel`).
`haiku`/`sonnet`/`opus`/`fable` aliases (`ClaudeModel`).

Select Grok with `new Runner({ agent: 'grok' })`. New runs use read-only
sandboxing and `dontAsk` permissions; Grok sessions are always persisted.
Expand Down
25 changes: 24 additions & 1 deletion bindings/node/__test__/smoke.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ test('claude and grok agents reject cyberAccessProgram', async () => {
}
})

test('effort is passed to codex as model_reasoning_effort', async () => {
const { runner, argsFile } = runnerWithCapture()

await runner.run({ prompt: 'x', effort: 'ultra' })

const args = readFileSync(argsFile, 'utf8').trim().split('\n')
const index = args.indexOf('model_reasoning_effort="ultra"')
assert.notEqual(index, -1)
assert.equal(args[index - 1], '-c')
})

test('invalid agent is rejected instead of falling back to codex', () => {
assert.throws(
() => new Runner({ agent: 'unknown-agent' }),
Expand Down Expand Up @@ -210,6 +221,7 @@ test('claude agent normalizes stream-json events', async () => {
const result = await runner.run({
prompt: 'create hello.txt',
model: ClaudeModel.Haiku,
effort: 'high',
permissionMode: PermissionMode.AcceptEdits,
})

Expand Down Expand Up @@ -263,11 +275,20 @@ test('claude agent normalizes stream-json events', async () => {
assert.ok(args.includes('--verbose'))
assert.ok(args.includes('--model'))
assert.ok(args.includes('haiku'))
assert.equal(args[args.indexOf('--effort') + 1], 'high')
assert.ok(args.includes('--permission-mode'))
assert.ok(args.includes('acceptEdits'))
assert.ok(args.includes('--no-session-persistence'))
})

test('ClaudeModel lists the claude --model aliases', () => {
assert.deepEqual(
{ ...ClaudeModel },
{ Haiku: 'haiku', Sonnet: 'sonnet', Opus: 'opus', Fable: 'fable' },
)
assert.ok(Object.isFrozen(ClaudeModel))
})

test('claude agent rejects codex-only fields', async () => {
const runner = new Runner({ agent: 'claude', executable: fakeClaude })

Expand Down Expand Up @@ -314,6 +335,7 @@ test('grok agent normalizes streaming-messages-json events', async () => {
const result = await runner.run({
prompt: 'inspect',
stdin: 'extra context',
effort: 'high',
allowedTools: ['Bash(git *)'],
})

Expand Down Expand Up @@ -348,6 +370,7 @@ test('grok agent normalizes streaming-messages-json events', async () => {
]) {
assert.ok(args.includes(expected))
}
assert.equal(args[args.indexOf('--reasoning-effort') + 1], 'high')
const promptIndex = args.indexOf('--prompt-file')
assert.equal(existsSync(args[promptIndex + 1]), false)
})
Expand Down Expand Up @@ -508,7 +531,7 @@ done
'-s',
'read-only',
'-a',
'untrusted',
'never',
'app-server',
'--stdio',
])
Expand Down
1 change: 1 addition & 0 deletions bindings/node/binding.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading