Commit Graph
1339 Commits
Author SHA1 Message Date
James Peter cfbfa6ca42 Merge branch 'feat/codeblock-bg' into main 2025-08-28 16:58:04 +10:00
James Peter 1e0ecbb030 feat(tui): codeblock background + syntax highlighting\n\n- Add code block background styling and improved syntax highlighting\n- Update , , streaming controller\n- Adjust colors/theme and diff rendering for consistency\n- Core: execution event plumbing tweaks\n- Docs: add markdown showcase 2025-08-28 16:57:54 +10:00
GitHub Action 894f047b0e chore(release): 0.2.37 [skip ci] v0.2.37 2025-08-27 02:17:20 +00:00
James Peter 5bb0800b36 ci: fix if guard to use env for NPM_TOKEN; expose secrets.NPM_TOKEN at job env 2025-08-27 12:08:39 +10:00
James Peter b8d629e813 ci: fix YAML by replacing heredoc with printf for platform package.json generation 2025-08-27 11:54:37 +10:00
James Peter c5480fd9f9 chore: sync changes before rebase 2025-08-27 11:51:13 +10:00
James Peter 35971252dc packaging: move binaries to npm optionalDependencies per target; postinstall resolves platform package before GitHub fallback 2025-08-27 11:51:13 +10:00
GitHub Action 424a55fd54 chore(release): 0.2.36 [skip ci] v0.2.36 2025-08-27 01:30:14 +00:00
James Peter 5a5116a1d4 ci: restore --frozen build; make cargo fetch --locked unconditional to warm index 2025-08-27 11:23:27 +10:00
James Peter 2257138b21 ci: drop --frozen (allow registry fetch for locked deps like Inflector via schemafy) 2025-08-27 11:21:50 +10:00
James Peter 9051bb45f4 ci(windows): remove vcpkg caching/prep; skip cargo fetch when rust-cache hits 2025-08-27 11:17:54 +10:00
James Peter 35a96e0b66 packaging: download single binary + create code-tui/code-exec wrappers; CI builds only 'code' 2025-08-27 11:06:08 +10:00
GitHub Action ec65a171b5 chore(release): 0.2.35 [skip ci] v0.2.35 2025-08-27 00:49:13 +00:00
James Peter 7db34b553b release: slimmer assets + zstd fallback (.zst/.tar.gz)\n\n- Dual-format artifacts for macOS and Linux (.zst + .tar.gz)\n- Postinstall picks one: prefers .zst when zstd available, else .tar.gz\n- Windows stays .zip\n- Trim npm package (no embedded natives)\n- release-prod strips debuginfo; warning cleanup 2025-08-27 10:33:56 +10:00
GitHub Action bbdc65b13a chore(release): 0.2.34 [skip ci] v0.2.34 2025-08-26 07:29:26 +00:00
James Peter 035c7eadb4 Merge branch 'merge/upstream-2025-08-26' into main 2025-08-26 17:12:09 +10:00
James Peter f446c21faf tui: add raw clipboard image paste support
- Reintroduce clipboard_image helpers (arboard + image + tempfile)
- Integrate with composer: if pasted text is empty, save PNG from clipboard
after reading image and insert temp file path; show footer confirmation
- Keep existing path normalization intact and prioritized
2025-08-26 17:06:37 +10:00
James Peter 4f2fa88298 merge: integrate upstream TUI; resolve conflicts and fix build
- Adopt upstream status_indicator_widget + clipboard_paste modules; adapt to app-driven frame scheduling
- Add missing modules to lib; wire imports
- Replace unstable let-chains with stable conditionals
- Fix core Responses client merge issues (auth URL, remove unused retry helpers)
- Implement paste-path handling in composer; simplify popup helpers
- Remove dead code and unused imports; eliminate all warnings
- Add arboard/tempfile deps for TUI (pruned unused clipboard image code)
2025-08-26 17:02:06 +10:00
James Peter 9b028ef802 Merge upstream/main into fork (prefer ours); resolve TUI conflicts by adopting upstream status_indicator_widget and clipboard_paste implementations to keep features and compatibility. 2025-08-26 16:52:04 +10:00
James Peter 56b6831855 Merge remote-tracking branch 'origin/main' into main 2025-08-26 16:51:15 +10:00
James Peter 4042696c1a tui: hard-clear render areas to prevent residual glyphs
- history_cell: clear entire area and per-section buffers before drawing
- transcript_app: clear content area and apply background style

Prevents artifacts when frames shrink or scroll reveals shorter lines; keeps UI clean.
2025-08-26 16:48:56 +10:00
GitHub Action bffd512384 chore(release): 0.2.33 [skip ci] v0.2.33 2025-08-26 06:10:48 +00:00
James Peter ad8cded90e chore: commit pending changes after successful build (./build-fast.sh) 2025-08-26 15:56:05 +10:00
Eric TrautandGitHub 89c82fb907 Added caps on retry config settings (#2701)
The CLI supports config settings `stream_max_retries` and
`request_max_retries` that allow users to override the default retry
counts (4 and 5, respectively). However, there's currently no cap placed
on these values. In theory, a user could configure an effectively
infinite retry count which could hammer the server. This PR adds a
reasonable cap (currently 100) to both of these values.
2025-08-25 22:51:01 -07:00
aeandGitHub fdd5422e08 [fix] emoji padding (#2702)
- We use emojis as bullet icons of sorts, and in some common terminals
like Terminal or iTerm, these can render with insufficient padding
between the emoji and following text.
- This PR makes emoji look better in Terminal and iTerm, at the expense
of Ghostty. (All default fonts.)

# Terminal

<img width="420" height="123" alt="image"
src="https://github.com/user-attachments/assets/93590703-e35a-4781-a697-881d7ec95598"
/>

# iTerm

<img width="465" height="163" alt="image"
src="https://github.com/user-attachments/assets/f11e6558-d2db-4727-bb7e-2b61eed0a3b1"
/>

# Ghostty

<img width="485" height="142" alt="image"
src="https://github.com/user-attachments/assets/7a7b021f-5238-4672-8066-16cd1da32dc6"
/>
2025-08-25 22:49:19 -07:00
aeandGitHub 2960314ad3 [feat] reduce bottom padding to 1 line (#2704) 2025-08-25 22:47:26 -07:00
Eric TrautandGitHub 4c79f85522 Improved user message for rate-limit errors (#2695)
This PR improves the error message presented to the user when logged in
with ChatGPT and a rate-limit error occurs. In particular, it provides
the user with information about when the rate limit will be reset. It
removes older code that attempted to do the same but relied on parsing
of error messages that are not generated by the ChatGPT endpoint. The
new code uses newly-added error fields.
2025-08-25 21:42:10 -07:00
050ba7b6da single control flow for both Esc and Ctrl+C (#2691)
Esc and Ctrl+C while a task is running should do the same thing. There
were some cases where pressing Esc would leave a "stuck" widget in the
history; this fixes that and cleans up the logic so there's just one
path for interrupting the task. Also clean up some subtly mishandled key
events (e.g. Ctrl+D would quit the app while an approval modal was
showing if the textarea was empty).

---------

Co-authored-by: Ahmed Ibrahim <[email protected]>
2025-08-25 20:15:38 -07:00
Eric TrautandGitHub c60bb531ec Fixed a bug that causes token refresh to not work in a seamless manner (#2699)
This PR fixes a bug in the token refresh logic. Token refresh is
performed in a retry loop so if we receive a 401 error, we refresh the
token, then we go around the loop again and reissue the fetch with a
fresh token. The bug is that we're not using the updated token on the
second and subsequent times through the loop. The result is that we'll
try to refresh the token a few more times until we hit the retry limit
(default of 4). The 401 error is then passed back up to the caller.
Subsequent calls will use the refreshed token, so the problem clears
itself up.

The fix is straightforward — make sure we use the updated auth
information each time through the retry loop.
2025-08-25 19:18:16 -07:00
Jeremy RoseandGitHub 7d26ae0833 do not show timeouts as "sandbox error"s (#2587)
🙅🫸
```
✗ Failed (exit -1)
  └ 🧪 cargo test --all-features -q
    sandbox error: command timed out
```

😌👉
```
✗ Failed (exit -1)
  └ 🧪 cargo test --all-features -q
    error: command timed out
```
2025-08-25 17:52:23 -07:00
Jeremy RoseandGitHub 70325bfe4a queued messages rendered italic (#2693)
<img width="416" height="215" alt="Screenshot 2025-08-25 at 5 29 53 PM"
src="https://github.com/user-attachments/assets/0f4178c9-6997-4e7a-bb30-0817b98d9748"
/>
2025-08-26 00:36:05 +00:00
Jeremy RoseandGitHub 8afc0b669a do not schedule frames for Tui::Draw events in backtrack (#2692)
this was causing continuous rerendering when a transcript overlay was
present
2025-08-26 00:29:24 +00:00
dedrisian-oaiandGitHub 55aa1351de Copying / Dragging image files (MacOS Terminal + iTerm) (#2567)
In this PR:

- [x] Add support for dragging / copying image files into chat.
- [x] Don't remove image placeholders when submitting.
- [x] Add tests.

Works for:

- Image Files
- Dragging MacOS Screenshots (Terminal, iTerm)

Todos:

- [ ] In some terminals (VSCode, WIndows Powershell, and remote
SSH-ing), copy-pasting a file streams the escaped filepath as individual
key events rather than a single Paste event. We'll need to have a
function (in a separate PR) for detecting these paste events.
2025-08-25 16:39:42 -07:00
Gabriel PealandGitHub 2fe28093aa Add auth to send_user_turn (#2688)
It is there for send_user_message but was omitted from send_user_turn.
Presumably this was a mistake
2025-08-25 18:57:20 -04:00
Ahmed IbrahimandGitHub 26d031af5a Fix esc (#2661)
Esc should have other functionalities when it's not used in a
backtracking situation. i.e. to cancel pop up menu when selecting
model/approvals or to interrupt an active turn.
2025-08-25 15:38:46 -07:00
DylanandGitHub 4621fbcb66 [exec] Clean up apply-patch tests (#2648)
## Summary
These tests were getting a bit unwieldy, and they're starting to become
load-bearing. Let's clean them up, and get them working solidly so we
can easily expand this harness with new tests.

## Test Plan
- [x] Tests continue to pass
2025-08-25 15:08:01 -07:00
Michael BolinandGitHub d1db06fe67 fix: use backslash as path separator on Windows (#2684)
I noticed that when running `/status` on Windows, I saw something like:

```
Path: ~/src\codex
```

so now it should be:

```
Path: ~\src\codex
```

Admittedly, `~` is understood by PowerShell but not on Windows, in
general, but it's much less verbose than `%USERPROFILE%`.
2025-08-25 14:47:17 -07:00
Jeremy RoseandGitHub 4e0411fee4 tui: queue messages (#2637)
https://github.com/user-attachments/assets/44349aa6-3b97-4029-99e1-5484e9a8775f
2025-08-25 21:38:38 +00:00
8a23dfd82b avoid error when /compact response has no token_usage (#2417) (#2640)
**Context**  
When running `/compact`, `drain_to_completed` would throw an error if
`token_usage` was `None` in `ResponseEvent::Completed`. This made the
command fail even though everything else had succeeded.

**What changed**  
- Instead of erroring, we now just check `if let Some(token_usage)`
before sending the event.
- If it’s missing, we skip it and move on.  

**Why**  
This makes `AgentTask::compact()` behave in the same way as
`AgentTask::spawn()`, which also doesn’t error out when `token_usage`
isn’t available. Keeps things consistent and avoids unnecessary
failures.

**Fixes**  
Closes #2417

---------

Co-authored-by: Ahmed Ibrahim <[email protected]>
2025-08-25 18:42:22 +00:00
Gabriel PealandGitHub 90428117f7 Index file (#2678) 2025-08-25 13:23:32 -04:00
dependabot[bot]andGitHub b7343bce3e chore(deps): bump toml_edit from 0.23.3 to 0.23.4 in /codex-rs (#2665) 2025-08-25 08:20:30 -07:00
GitHub Action b1675e9441 chore(release): 0.2.32 [skip ci] v0.2.32 2025-08-25 11:11:14 +00:00
James Peter 8eee9b8039 Merge branch 'merge/upstream-20250825' into main 2025-08-25 20:56:24 +10:00
James Peter 75bfffb90f Merge upstream/main into merge/upstream-20250825; resolve exec_command API changes, add per-session ExecSessionManager, fix ToolsConfig bools + add new_from_params; build passes with no warnings via ./build-fast.sh 2025-08-25 20:55:53 +10:00
James Peter f04605269d Merge upstream/main into merge/upstream-20250825 preferring ours (-X ours) 2025-08-25 20:50:54 +10:00
James Peter 5d40c6931d chore: fix all warnings; docs: require clean build
- Remove unused mut and dead code in TUI jump-back flow
- Update AGENTS.md to state build-fast.sh is the required check
  and all compiler warnings must be fixed
2025-08-25 20:48:56 +10:00
James Peter 5d8556e6da feat(tui): double‑Esc UX
- First Esc interrupts immediately if a task/stream is running
- Double‑Esc opens ‘Edit Previous Message’ picker (composer empty)
- Selecting a message now forks the underlying conversation using
  ConversationManager::fork_conversation, replaces ChatWidget with the
  new forked session, replays only the prefix transcript into history,
  and pre-fills the composer for editing
- Double‑Esc again (before submit) undoes the jump‑back UI
- Commit on submit finalizes the new state

Refactors and fixes:
- Add AppEvent::JumpBack; wire App to perform fork + replay
- Add ChatWidget::new_from_existing and transcript exporter
- Add generic list popup hook for selection usage
- Clean up warnings and unused code paths
2025-08-25 20:46:19 +10:00
James Peter 38f988df55 feat(resume): add per-directory session index and fast /resume picker with themed table UI; humanized times, snippet truncation, startup resume tip; filter empty sessions and system status; improve replay cleanliness and alignment; fix last-row rendering and build warnings 2025-08-25 16:59:25 +10:00
Michael BolinandGitHub ba45f5ad4b fix: Scope ExecSessionManager to Session instead of using global singleton (#2664)
The `SessionManager` in `exec_command` owns a number of
`ExecCommandSession` objects where `ExecCommandSession` has a
non-trivial implementation of `Drop`, so we want to be able to drop an
individual `SessionManager` to help ensure things get cleaned up in a
timely fashion. To that end, we should have one `SessionManager` per
session rather than one global one for the lifetime of the CLI process.
2025-08-24 22:52:49 -07:00
Michael BolinandGitHub cf2da70304 fix: build is broken on main; introduce ToolsConfigParams to help fix (#2663)
`ToolsConfig::new()` taking a large number of boolean params was hard to
manage and it finally bit us (see
https://github.com/openai/codex/pull/2660). This changes
`ToolsConfig::new()` so that it takes a struct (and also reduces the
visibility of some members, where possible).
2025-08-24 22:43:42 -07:00