Commit Graph
755 Commits
Author SHA1 Message Date
James PeterandClaude cd94cebb0f refactor: rename task terminology to agent throughout codebase
- Renamed task_tool.rs to agent_tool.rs
- Updated all structs: Task → Agent, TaskManager → AgentManager
- Updated all types: TaskStatus → AgentStatus
- Renamed all functions: run_task → run_agent, check_task_status → check_agent_status, etc.
- Updated parameter structs: RunTaskParams → RunAgentParams, etc.
- Updated slash command prompts (/plan, /solve, /code) to use agent terminology
- Added UI status indicators showing running agents count
- Enhanced list_agents with status count summary
- Fixed tokio imports (kept as task::, not agent::)
- Maintained backward compatibility with event system

This provides clearer semantics when working with multiple external LLMs in parallel.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-08-11 07:36:19 +10:00
James PeterandClaude cf42457553 feat: add agent tool for calling external LLMs
Add a new "agent" tool that allows the LLM to call external command-line LLMs
(claude, gemini, codex) and aggregate their responses. This enables the system
to query multiple LLMs and compare or combine their outputs.

- Create agent_tool.rs module with tool definition and execution logic
- Register the agent tool in the OpenAI tools list
- Add handler for agent tool calls in codex.rs
- Support calling multiple agents with the same prompt in parallel

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-08-10 23:25:23 +10:00
James Peter cc243b1c2b fix: handle existing tags and npm version conflicts
- Check npm registry for latest published version before bumping
- Only create git tags if they don't already exist
- Handle case where local version is behind published version
- Properly bump from the latest published version to avoid conflicts
2025-08-10 17:16:42 +10:00
James Peter 1cc2867b6d fix: remove redundant Simple Release workflow
- Delete release-simple.yml (no longer needed)
- Re-enable complex release.yml as main workflow (it works now!)
- Fix GitHub Release creation by using GH_PAT token
- Complex workflow now successfully builds all 7 platforms
2025-08-10 17:04:54 +10:00
James Peter 2fb9a5cd19 fix: improve cross-compilation in release workflow
- Use dtolnay/[email protected] instead of @stable for consistency
- Use ARM runners (ubuntu-24.04-arm) for ARM targets to avoid cross-compilation
- Add pkg-config to musl installations
- Include both musl and gnu targets for Linux
- Use macos-14 (ARM) for all macOS builds
- Consolidate musl tools installation into single step
2025-08-10 16:45:09 +10:00
James Peter 8ba544912a fix: disable complex release workflow to prevent duplicate runs
- Change release.yml to workflow_dispatch (manual trigger only)
- Keep release-simple.yml as the main automated release workflow
- This prevents both workflows from running on every push
- Simple workflow is sufficient for Linux-only npm releases
2025-08-10 16:41:36 +10:00
James Peter 4991262510 fix: disable upstream workflows on fork by adding repository condition
- Add 'if: github.repository == openai/codex' to all upstream workflows
- Prevents rust-ci, ci, codespell, codex, and rust-release from running on forks
- Keeps our fork clean and only runs our custom release workflows
2025-08-10 16:39:11 +10:00
James Peter f2e5c97035 Merge main branch updates into code-release
Resolve version conflict - use v0.1.1 for next release
2025-08-10 16:33:26 +10:00
James Peter 27cbd5767c feat: update README and package.json for fork
- Add fork-specific README with installation instructions
- Update package.json to @just-every/code v0.1.1
- Prepare for next release with proper versioning
2025-08-10 16:32:54 +10:00
James Peter 82cb5d702e chore: trigger workflow to publish to npm 2025-08-10 16:20:14 +10:00
James Peter 056a16db3a fix: enable npm publishing in GitHub Actions when NPM_TOKEN is configured
- Uncomment the npm publish step
- Add conditional check for NPM_TOKEN availability
- Will automatically publish when secret is configured
2025-08-10 16:19:33 +10:00
James Peter 6a8818e298 docs: completely rewrite README for Code CLI fork
- Clean, focused documentation for the enhanced fork
- Clear installation instructions with npm package name
- Highlight key features and enhancements
- Add comprehensive usage examples
- Include troubleshooting and development sections
- Add comparison table with original Codex
- Remove outdated content and simplify structure
2025-08-10 16:18:06 +10:00
James Peter 40555df114 docs: update README with installation instructions for Code CLI fork
- Add clear branding as enhanced fork of OpenAI Codex
- Highlight new features (image support, /reasoning command)
- Provide npm installation instructions for @just-every/code
- Explain configuration directory behavior
2025-08-10 16:16:23 +10:00
James Peter 3676c6ab0e feat: add simplified release workflow for testing
Creates a basic workflow that builds native Linux binaries only
to test the npm packaging process without cross-compilation complexity
2025-08-10 16:08:49 +10:00
James Peter 0ec80e38f7 fix: improve musl cross-compilation setup in GitHub Actions 2025-08-10 16:06:22 +10:00
James Peter 40d17e42f9 fix: properly install Rust targets in GitHub Actions 2025-08-10 16:04:15 +10:00
James Peter 1914e7b51e fix: use macos-13 for x86_64 builds to avoid cross-compilation issues 2025-08-10 16:01:42 +10:00
James Peter ff8378b2af feat: set up code fork with rebranding and npm publishing
- Rename binaries from codex to code across all Cargo.toml files
- Create @just-every/code npm package with generic build scripts
- Add CODE_HOME environment variable support (falls back to CODEX_HOME)
- Create GitHub Actions workflow for automated npm releases
- Update JavaScript wrapper from codex.js to code.js
- Add FORK_SETUP.md documentation
- Configure dual-branch strategy for fork management
2025-08-10 15:57:12 +10:00
James Peter a0faa3a9ea Merge feat/reasoning-slash-command into main
Combines the /reasoning slash command feature with the image handling improvements.
2025-08-10 15:38:32 +10:00
James Peter 3ca7c4c306 fix: Replace unstable let-chains with nested conditionals for stable Rust
The codebase was using unstable let-chains syntax which prevented
compilation on stable Rust. This commit replaces all instances with
equivalent nested conditional checks.

Changes:
- client.rs: Fix auth header conditional chain
- error.rs: Fix usage limit error message conditional chain
- protocol.rs: Fix TMPDIR environment variable conditional chain

This allows the codebase to compile on stable Rust without requiring
nightly features.
2025-08-10 15:28:44 +10:00
James PeterandClaude e401b8b3c3 feat: add /reasoning slash command to change reasoning effort mid-conversation
- Add /reasoning command with parameter support (high/medium/low/none)
- Create interactive UI for reasoning level selection when no parameter given
- Show current level with arrow key navigation and descriptions
- Properly format output with bold text instead of markdown asterisks
- Prevent duplicate welcome message when updating session configuration
- Track welcome_shown state to avoid re-displaying intro

Fixes #2106

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
2025-08-10 09:13:21 +10:00
Michael BolinandGitHub e87974ae83 fix: improve npm release process (#2055)
This improves the release process by introducing
`scripts/publish_to_npm.py` to automate publishing to npm (modulo the
human 2fac step).

As part of this, it updates `.github/workflows/rust-release.yml` to
create the artifact for npm using `npm pack`.

And finally, while it is long overdue, this memorializes the release
process in `docs/release_management.md`.
2025-08-08 19:07:36 -07:00
pakrym-oaiandGitHub 329f01b728 feat: allow esc to interrupt session (#2054)
## Summary
- allow Esc to interrupt the current session when a task is running
- document Esc as an interrupt key in status indicator

## Testing
- `just fmt`
- `just fix` *(fails: E0658 `let` expressions in this position are
unstable)*
- `cargo test --all-features` *(fails: E0658 `let` expressions in this
position are unstable)*

------
https://chatgpt.com/codex/tasks/task_i_689698cf605883208f57b0317ff6a303
2025-08-08 18:59:54 -07:00
aibrahim-oaiandGitHub 4a916ba914 Show ChatGPT login URL during onboarding (#2028)
## Summary
- display authentication URL in the ChatGPT sign-in screen while
onboarding

<img width="684" height="151" alt="image"
src="https://github.com/user-attachments/assets/a8c32cb0-77f6-4a3f-ae3b-6695247c994d"
/>
2025-08-09 01:30:34 +00:00
DylanandGitHub 0091930f5a [core] Allow resume after client errors (#2053)
## Summary
Allow tui conversations to resume after the client fails out of retries.
I tested this with exec / mocked api failures as well, and it appears to
be fine. But happy to add an exec integration test as well!

## Testing
- [x] Added integration test
- [x] Tested locally
2025-08-08 18:21:19 -07:00
DylanandGitHub a2b9f46006 [exec] Fix exec sandbox arg (#2034)
## Summary
From codex-cli 😁 
`-s/--sandbox` now correctly affects sandbox mode.

What changed
- In `codex-rs/exec/src/cli.rs`:
- Added `value_enum` to the `--sandbox` flag so Clap parses enum values
into `
SandboxModeCliArg`.
- This ensures values like `-s read-only`, `-s workspace-write`, and `-s
dange
r-full-access` are recognized and propagated.

Why this fixes it
- The enum already derives `ValueEnum`, but without `#[arg(value_enum)]`
Clap ma
y not map the string into the enum, leaving the option ineffective at
runtime. W
ith `value_enum`, `sandbox_mode` is parsed and then converted to
`SandboxMode` i
n `run_main`, which feeds into `ConfigOverrides` and ultimately into the
effecti
ve `sandbox_policy`.
2025-08-08 18:19:40 -07:00
Michael BolinandGitHub 408c7ca142 chore: remove the TypeScript code from the repository (#2048)
This deletes the bulk of the `codex-cli` folder and eliminates the logic
that builds the TypeScript code and bundles it into the release.

Since this PR modifies `.github/workflows/rust-release.yml`, to test
changes to the release process, I locally commented out all of the "is
this commit on upstream `main`" checks in
`scripts/create_github_release.sh` and ran:

```
./codex-rs/scripts/create_github_release.sh 0.20.0-alpha.4
```

Which kicked off:

https://github.com/openai/codex/actions/runs/16842085113

And the release artifacts appear legit!

https://github.com/openai/codex/releases/tag/rust-v0.20.0-alpha.4
2025-08-08 16:09:39 -07:00
DylanandGitHub 75febbdefa Update README.md (#1989)
Updates the README to clarify auth vs. api key behavior.
2025-08-08 15:19:20 -07:00
Michael BolinandGitHub 39a4d4ed8e fix: try building the npm package in CI (#2043)
Historically, the release process for the npm module has been:

- I run `codex-rs/scripts/create_github_release.sh` to kick off a
release for the native artifacts.
- I wait until it is done.
- I run `codex-cli/scripts/stage_rust_release.py` to build the npm
release locally
- I run `npm publish` from my laptop

It has been a longstanding issue to move the npm build to CI. I may
still have to do the `npm publish` manually because it requires 2fac
with `npm`, though I assume we can work that out later.

Note I asked Codex to make these updates, and while they look pretty
good to me, I'm not 100% certain, but let's just merge this and I'll
kick off another alpha build and we'll see what happens?
2025-08-08 15:17:54 -07:00
pakrym-oaiandGitHub 33f266dab3 Use certifi certificate when available (#2042)
certifi has a more consistent set of Mozilla maintained root
certificates
2025-08-08 22:15:35 +00:00
Michael BolinandGitHub d0cf036799 feat: include Windows binary of the CLI in the npm release (#2040)
To date, the build scripts in `codex-cli` still supported building the
old TypeScript version of the Codex CLI to give Windows users something
they can run, but we are just going to have them use the Rust version
like everyone else, so:

- updates `codex-cli/bin/codex.js` so that we run the native binary or
throw if the target platform/arch is not supported (no more conditional
usage based on `CODEX_RUST`, `use-native` file, etc.)
- drops the `--native` flag from `codex-cli/scripts/stage_release.sh`
and updates all the code paths to behave as if `--native` were passed
(i.e., it is the only way to run it now)

Tested this by running:

```
./codex-cli/scripts/stage_rust_release.py --release-version 0.20.0-alpha.2
```
2025-08-08 14:44:35 -07:00
Michael BolinandGitHub 8a26ea0fe0 fix: stop building codex-exec and codex-linux-sandbox binaries (#2036)
Release builds are taking awhile and part of the reason that we are
building binaries that we are not really using. Adding Windows binaries
into releases (https://github.com/openai/codex/pull/2035) slows things
down, so we need to get some time back.

- `codex-exec` is basically a standalone `codex exec` that we were
offering because it's a bit smaller as it does not include all the bits
to power the TUI. We were using it in our experimental GitHub Action, so
this PR updates the Action to use `codex exec` instead.
- `codex-linux-sandbox` was a helper binary for the TypeScript version
of the CLI, but I am about to axe that, so we don't need this either.

If we decide to bring `codex-exec` back at some point, we should use a
separate instances so we can build it in parallel with `codex`. (I think
if we had beefier build machines, this wouldn't be so bad, but that's
not the case with the default runners from GitHub.)
2025-08-08 13:42:33 -07:00
Michael BolinandGitHub 18eb157000 feat: include windows binaries in GitHub releases (#2035)
We should stop shipping the old TypeScript CLI to Windows users. I did
some light testing of the Rust CLI on Windows in `cmd.exe` and it works
better than I expected!
2025-08-08 13:03:11 -07:00
aibrahim-oaiandGitHub 6cfee15612 Moving the compact prompt near where it's used (#2031)
- Moved the prompt for compact to core
- Renamed it to be more clear
2025-08-08 12:43:43 -07:00
216e9e2ed0 Fix rust build on windows (#2019)
This pull request implements a fix from #2000, as well as fixed an
additional problem with path lengths on windows that prevents the login
from displaying.

---------

Co-authored-by: Michael Bolin <[email protected]>
Co-authored-by: Michael Bolin <[email protected]>
2025-08-08 10:57:16 -07:00
Gabriel PealandGitHub c3a8ab8511 Fix multiline exec command rendering (#2023)
With Ratatui, if a single line contains newlines, it increments y but
not x so each subsequent line continued from the same x position as the
previous line ended on.

Before
<img width="2010" height="376" alt="CleanShot 2025-08-08 at 09 13 13"
src="https://github.com/user-attachments/assets/09feefbd-c5ee-4631-8967-93ab108c352a"
/>
After
<img width="1002" height="364" alt="CleanShot 2025-08-08 at 09 11 54"
src="https://github.com/user-attachments/assets/a58b47cf-777f-436a-93d9-ab277046a577"
/>
2025-08-08 13:52:24 -04:00
pakrym-oaiandGitHub 307d9957fa Fix usage limit banner grammar (#2018)
## Summary
- fix typo in usage limit banner text
- update error message tests

## Testing
- `just fmt`
- `RUSTC_BOOTSTRAP=1 just fix` *(fails: `let` expressions in this
position are unstable)*
- `RUSTC_BOOTSTRAP=1 cargo test --all-features` *(fails: `let`
expressions in this position are unstable)*

------
https://chatgpt.com/codex/tasks/task_i_689610fc1fe4832081bdd1118779b60b
2025-08-08 08:50:44 -07:00
pakrym-oaiandGitHub 431c9299d4 Remove part of the error message (#1983) 2025-08-08 02:01:53 +00:00
easong-openaiandGitHub 52e12f2b6c Revert "Streaming markdown (#1920)" (#1981)
This reverts commit 2b7139859e.
2025-08-08 01:38:39 +00:00
easong-openaiandGitHub 2b7139859e Streaming markdown (#1920)
We wait until we have an entire newline, then format it with markdown and stream in to the UI. This reduces time to first token but is the right thing to do with our current rendering model IMO. Also lets us add word wrapping!
2025-08-07 18:26:47 -07:00
pakrym-oaiandGitHub fa0051190b Adjust error messages (#1969)
<img width="1378" height="285" alt="image"
src="https://github.com/user-attachments/assets/f0283378-f839-4a1f-8331-909694a04b1f"
/>
2025-08-07 18:24:34 -07:00
Michael BolinandGitHub cd06b28d84 fix: default to credits from ChatGPT auth, when possible (#1971)
Uses this rough strategy for authentication:

```
if auth.json
	if auth.json.API_KEY is NULL # new auth
		CHAT
	else # old auth
		if plus or pro or team
			CHAT
		else 
			API_KEY
		
else OPENAI_API_KEY
```

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1970).
* __->__ #1971
* #1970
* #1966
* #1965
* #1962
2025-08-07 18:00:31 -07:00
Michael BolinandGitHub 295abf3e51 chore: change CodexAuth::from_api_key() to take &str instead of String (#1970)
Good practice and simplifies some of the call sites.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1970).
* #1971
* __->__ #1970
* #1966
* #1965
* #1962
2025-08-07 16:55:33 -07:00
Michael BolinandGitHub b991c04f86 chore: move top-level load_auth() to CodexAuth::from_codex_home() (#1966)
There are two valid ways to create an instance of `CodexAuth`:
`from_api_key()` and `from_codex_home()`. Now both are static methods of
`CodexAuth` and are listed first in the implementation.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1966).
* #1971
* #1970
* __->__ #1966
* #1965
* #1962
2025-08-07 16:49:37 -07:00
Michael BolinandGitHub 02c9c2ecad chore: make CodexAuth::api_key a private field (#1965)
Force callers to access this information via `get_token()` rather than
messing with it directly.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1965).
* #1971
* #1970
* #1966
* __->__ #1965
* #1962
2025-08-07 16:40:01 -07:00
Michael BolinandGitHub db76f32888 chore: rename CodexAuth::new() to create_dummy_codex_auth_for_testing() because it is not for general consumption (#1962)
`CodexAuth::new()` was the first method listed in `CodexAuth`, but it is
only meant to be used by tests. Rename it to
`create_dummy_chatgpt_auth_for_testing()` and move it to the end of the
implementation.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1962).
* #1971
* #1970
* #1966
* #1965
* __->__ #1962
2025-08-07 16:33:29 -07:00
DylanandGitHub 548466df09 [client] Tune retries and backoff (#1956)
## Summary
10 is a bit excessive 😅 Also updates our backoff factor to space out
requests further.
2025-08-07 15:23:31 -07:00
Michael BolinandGitHub 7d67159587 fix: public load_auth() fn always called with include_env_var=true (#1961)
Apparently `include_env_var=false` was only used for testing, so clean
up the API a little to make that clear.


---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1961).
* #1962
* __->__ #1961
2025-08-07 14:19:30 -07:00
Michael BolinandGitHub f74fe7af7b fix: fix mistaken bitwise OR in #1949 (#1957)
This is hard for me to test conclusively because I have the default of
`ctrl left/right` used to migrate between Spaces on macOS.
2025-08-07 20:11:06 +00:00
Jeremy RoseandGitHub c787603812 ctrl+arrows also move words (#1949)
this was removed at some point, but this is a common keybind for word
left/right.
2025-08-07 18:27:44 +00:00