Repository navigation
rt agent: codex provider, --yolo, and provider-scoped settings defaults #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6ab4389
agent-argv: split into provider-dispatched module, add claude --yolo
m4ttheweric 3ddb220
agent-argv: add codex provider argv/pane-command builders
m4ttheweric 6c51ddc
settings: replace flat agent.* rows with provider-scoped agent.claude…
m4ttheweric 5013af8
state: add agents.yolo column and updateAgentSessionId
m4ttheweric cbe2fcd
rt agent: add --provider and --yolo flags
m4ttheweric 37f1e59
daemon: resolve rt agent provider from payload/settings, dispatch arg…
m4ttheweric b052958
agent: capture codex's real session id (headless --json stream, herdr…
m4ttheweric 7c0f44b
agent: fix misleading codex herdr session-id warning message
m4ttheweric 24ebeb1
agent: whole-branch review fixes for the codex provider
m4ttheweric 7bdf0ab
agent tests: resolve the codex capture poll so it does not outlive th…
m4ttheweric 8162df9
agent: keep the RT-46 legacy-path guard green; use rtDir() in the new…
m4ttheweric 8c60004
agent: address CodeRabbit findings on PR #291
m4ttheweric File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
| import { buildCodexArgv, buildCodexPaneCommand } from "../agent-argv/index.ts"; | ||
|
|
||
| const UUID = "6e225e74-4cb7-4aea-8807-6aa9011d4112"; | ||
|
|
||
| describe("buildCodexArgv", () => { | ||
| const bins = { codex: "/abs/codex" }; | ||
|
|
||
| test("headless start: exec --json, no session id emitted", () => { | ||
| const argv = buildCodexArgv({ session: { kind: "start", sessionId: UUID }, headless: true, prompt: "do it" }, bins); | ||
| expect(argv).toEqual(["/abs/codex", "exec", "--json", "do it"]); | ||
| expect(argv).not.toContain(UUID); | ||
| }); | ||
|
|
||
| test("all knobs, headless start", () => { | ||
| const argv = buildCodexArgv({ | ||
| model: "gpt-6-astra", effort: "high", yolo: true, extraArgs: "--search", | ||
| session: { kind: "start", sessionId: UUID }, headless: true, prompt: "do it", | ||
| }, bins); | ||
| expect(argv).toEqual([ | ||
| "/abs/codex", "exec", "--json", | ||
| "-m", "gpt-6-astra", "-c", "model_reasoning_effort=high", | ||
| "--dangerously-bypass-approvals-and-sandbox", "--search", "do it", | ||
| ]); | ||
| }); | ||
|
|
||
| test("headless resume: exec resume --json <flags> <id> <prompt>", () => { | ||
| const argv = buildCodexArgv({ model: "gpt-6-astra", session: { kind: "resume", sessionId: UUID }, headless: true, prompt: "q" }, bins); | ||
| expect(argv).toEqual(["/abs/codex", "exec", "resume", "--json", "-m", "gpt-6-astra", UUID, "q"]); | ||
| }); | ||
|
|
||
| test("non-headless resume emits no --json", () => { | ||
| const argv = buildCodexArgv({ session: { kind: "resume", sessionId: UUID }, headless: false }, bins); | ||
| expect(argv).toEqual(["/abs/codex", "exec", "resume", UUID]); | ||
| }); | ||
|
|
||
| // Pins the --json gate, not a production shape: a herdr launch goes through | ||
| // buildCodexPaneCommand, so nothing in production calls this with | ||
| // headless: false on a start. | ||
| test("start with headless: false omits --json", () => { | ||
| const argv = buildCodexArgv({ session: { kind: "start", sessionId: UUID }, headless: false }, bins); | ||
| expect(argv).not.toContain("--json"); | ||
| expect(argv).toEqual(["/abs/codex", "exec"]); | ||
| }); | ||
|
|
||
| test("headless without a prompt throws", () => { | ||
| expect(() => buildCodexArgv({ session: { kind: "start", sessionId: UUID }, headless: true }, bins)).toThrow(/prompt/); | ||
| }); | ||
| }); | ||
|
|
||
| describe("buildCodexPaneCommand", () => { | ||
| test("start: cd + bare codex + flags + quoted prompt", () => { | ||
| const cmd = buildCodexPaneCommand("/repo dir", { | ||
| model: "gpt-6-astra", | ||
| session: { kind: "start", sessionId: UUID }, headless: false, prompt: "hi 'there'", | ||
| }); | ||
| expect(cmd).toBe(`cd '/repo dir' && codex '-m' 'gpt-6-astra' 'hi '\\''there'\\'''`); | ||
| }); | ||
|
|
||
| test("resume: codex resume <flags> <quoted id>", () => { | ||
| const cmd = buildCodexPaneCommand("/r", { session: { kind: "resume", sessionId: UUID }, headless: false }); | ||
| expect(cmd).toBe(`cd '/r' && codex resume '${UUID}'`); | ||
| }); | ||
|
|
||
| test("env assignments precede the codex head", () => { | ||
| const cmd = buildCodexPaneCommand("/w/x", { | ||
| session: { kind: "start", sessionId: UUID }, | ||
| headless: false, | ||
| env: { RT_AGENT_ID: "ag-1" }, | ||
| }); | ||
| expect(cmd).toContain("cd '/w/x' && RT_AGENT_ID='ag-1' codex"); | ||
| }); | ||
|
|
||
| test("yolo maps to --dangerously-bypass-approvals-and-sandbox", () => { | ||
| const cmd = buildCodexPaneCommand("/r", { yolo: true, session: { kind: "start", sessionId: UUID }, headless: false }); | ||
| expect(cmd).toContain("--dangerously-bypass-approvals-and-sandbox"); | ||
| }); | ||
| }); |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.