Commit Graph
166 Commits
Author SHA1 Message Date
easong-openai e112464f99 format 2025-08-04 10:23:50 -07:00
easong-openai 16e1a5b45b as is 2025-08-04 01:02:54 -07:00
easong-openai 20ebd6b2ce cleaup 2025-08-03 13:10:24 -07:00
easong-openai 586be04491 clippy 2025-08-03 01:33:46 -07:00
easong-openai 8a61d397d4 improvements, danger widget 2025-08-02 23:05:13 -07:00
easong-openai a983c1f6ad better approval flow, model switching, etc 2025-08-02 17:05:15 -07:00
easong-openai b23cddd1d9 add approvals slash command, models option 2025-08-02 13:55:53 -07:00
easong-openai aec9a8b9b4 Merge remote-tracking branch 'origin/main' into multiple-slash-commands 2025-08-02 12:05:29 -07:00
easong-openai 1448a11697 merge /models 2025-08-02 12:01:24 -07:00
easong-openai f0d9f24fc0 improvements, more dry 2025-08-01 20:01:49 -07:00
easong-openai 60e9eb683c tests 2025-08-01 17:38:30 -07:00
Jeremy Roseandeasong-openai 7e0f506da2 check for updates (#1764)
1. Ping https://api.github.com/repos/openai/codex/releases/latest (at
most once every 20 hrs)
2. Store the result in ~/.codex/version.jsonl
3. If CARGO_PKG_VERSION < latest_version, print a message at boot.

---------

Co-authored-by: easong-openai <easong@openai.com>
2025-08-02 00:31:38 +00:00
aibrahim-oai f20de21cb6 collabse stdout and stderr delta events into one (#1787) 2025-08-01 14:00:19 -07:00
aibrahim-oai bc7beddaa2 feat: stream exec stdout events (#1786)
## Summary
- stream command stdout as `ExecCommandStdout` events
- forward streamed stdout to clients and ignore in human output
processor
- adjust call sites for new streaming API
2025-08-01 13:04:34 -07:00
Jeremy Rose 8360c6a3ec fix insert_history modifier handling (#1774)
This fixes a bug in insert_history_lines where writing
`Line::From(vec!["A".bold(), "B".into()])` would write "B" as bold,
because "B" didn't explicitly subtract bold.
2025-08-01 10:37:43 -07:00
easong-openai f7f43f1b5b Merge remote-tracking branch 'origin/main' into scrollable-slash-menu 2025-08-01 10:15:54 -07:00
easong-openai 9c0f8a50b6 comments 2025-08-01 10:15:07 -07:00
aibrahim-oai b67c485d84 ci fix (#1782) 2025-08-01 09:17:13 -07:00
easong-openai 53c19b4d07 tests, scroll to bottom from top 2025-08-01 05:00:45 -07:00
easong-openai 9f45d477e5 comments 2025-08-01 04:34:40 -07:00
easong-openai 1aad659eba scrollable slash menu, esc to exit 2025-08-01 04:33:01 -07:00
aibrahim-oai e2c994e32a Add /compact (#1527)
- Add operation to summarize the context so far.
- The operation runs a compact task that summarizes the context.
- The operation clear the previous context to free the context window
- The operation didn't use `run_task` to avoid corrupting the session
- Add /compact in the tui



https://github.com/user-attachments/assets/e06c24e5-dcfb-4806-934a-564d425a919c
2025-07-31 21:34:32 -07:00
pap-openai 5d4ade38a4 Merge branch 'main' into pap/model-selection 2025-08-01 01:48:42 +01:00
easong-openai 575590e4c2 Detect kitty terminals (#1748)
We want to detect kitty terminals so we can preferentially upgrade their UX without degrading older terminals.
2025-08-01 00:30:44 +00:00
Jeremy Rose 4aca3e46c8 insert history lines with redraw (#1769)
This delays the call to insert_history_lines until a redraw is
happening. Crucially, the new lines are inserted _after the viewport is
resized_. This results in fewer stray blank lines below the viewport
when modals (e.g. user approval) are closed.
2025-07-31 17:15:26 -07:00
Jeremy Rose d787434aa8 fix: always send KeyEvent, we now check kind in the handler (#1772)
https://github.com/openai/codex/pull/1754 and #1771 fixed the same thing
in colliding ways.
2025-08-01 00:13:36 +00:00
Jeremy Rose ea69a1d72f lighter approval modal (#1768)
The yellow hazard stripes were too scary :)

This also has the added benefit of not rendering anything at the full
width of the terminal, so resizing is a little easier to handle.

<img width="860" height="390" alt="Screenshot 2025-07-31 at 4 03 29 PM"
src="https://github.com/user-attachments/assets/18476e1a-065d-4da9-92fe-e94978ab0fce"
/>

<img width="860" height="390" alt="Screenshot 2025-07-31 at 4 05 03 PM"
src="https://github.com/user-attachments/assets/337db0da-de40-48c6-ae71-0e40f24b87e7"
/>
2025-07-31 17:10:52 -07:00
Jeremy Rose 610addbc2e do not dispatch key releases (#1771)
when we enabled KKP in https://github.com/openai/codex/pull/1743, we
started receiving keyup events, but didn't expect them anywhere in our
code. for now, just don't dispatch them at all.
2025-07-31 17:00:48 -07:00
pap 8dea0e4cd2 fuzzy is now a common lib + toml alphabetical order 2025-08-01 00:04:24 +01:00
pap 145688f019 linter 2025-07-31 23:09:55 +01:00
pap 1afa537148 remove useless code 2025-07-31 22:48:51 +01:00
pap 507f79deac linter 2025-07-31 22:34:12 +01:00
pap d207169ea6 Merge branch 'main' into pap/model-selection 2025-07-31 22:29:45 +01:00
pap 4e2cf0bb7a can set non default models 2025-07-31 22:28:54 +01:00
pap 56e95f7ec7 scrollable model list 2025-07-31 21:54:42 +01:00
easong-openai 6ce0a5875b Initial planning tool (#1753)
We need to optimize the prompt, but this causes the model to use the new
planning_tool.

<img width="765" height="110" alt="image"
src="https://github.com/user-attachments/assets/45633f7f-3c85-4e60-8b80-902f1b3b508d"
/>
2025-07-31 20:45:52 +00:00
easong-openai 9aa11269a5 Fix double-scrolling in approval model (#1754)
Previously, pressing up or down arrow in the new approval modal would be
the equivalent of two up or down presses.
2025-07-31 19:41:32 +00:00
pakrym-oai 549846b29a Add codex login --api-key (#1759)
Allow setting the API key via `codex login --api-key`
2025-07-31 17:48:49 +00:00
Jeremy Rose 96654a5d52 clamp render area to terminal size (#1758)
this fixes a couple of panics that would happen when trying to render
something larger than the terminal, or insert history lines when the top
of the viewport is at y=0.
2025-07-31 09:59:36 -07:00
easong-openai 861ba86403 Show error message after panic (#1752)
Previously we were swallowing errors and silently exiting, which isn't
great for helping users help us.
2025-07-31 09:19:08 -07:00
pap fbc1ee7d62 new model popup 2025-07-31 15:00:08 +01:00
pap f8e5b02320 desired_height for model selection 2025-07-31 13:35:59 +01:00
pap 02d16813bf Merge branch 'main' into pap/model-selection 2025-07-31 13:35:42 +01:00
Jeremy Rose d86270696e streamline ui (#1733)
Simplify and improve many UI elements.
* Remove all-around borders in most places. These interact badly with
terminal resizing and look heavy. Prefer left-side-only borders.
* Make the viewport adjust to the size of its contents.
* <kbd>/</kbd> and <kbd>@</kbd> autocomplete boxes appear below the
prompt, instead of above it.
* Restyle the keyboard shortcut hints & move them to the left.
* Restyle the approval dialog.
* Use synchronized rendering to avoid flashing during rerenders.


https://github.com/user-attachments/assets/96f044af-283b-411c-b7fc-5e6b8a433c20

<img width="1117" height="858" alt="Screenshot 2025-07-30 at 5 29 20 PM"
src="https://github.com/user-attachments/assets/0cc0af77-8396-429b-b6ee-9feaaccdbee7"
/>
2025-07-31 00:43:21 -07:00
pap-openaiandeasong-openai defeafb279 add keyboard enhancements to support shift_return (#1743)
For terminal that supports [keyboard
enhancements](https://docs.rs/libcrossterm/latest/crossterm/enum.KeyboardEnhancementFlags.html),
adds the enhancements (enabling [kitty keyboard
protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol/)) to
support shift+enter listener.

Those users (users with terminals listed on
[KPP](https://sw.kovidgoyal.net/kitty/keyboard-protocol/)) should be
able to press shift+return for new line

---------

Co-authored-by: easong-openai <easong@openai.com>
2025-07-31 03:23:56 +00:00
pakrym-oai 51b6bdefbe Auto format toml (#1745)
Add recommended extension and configure it to auto format prompt.
2025-07-30 18:37:00 -07:00
Jeremy Rose f2134f6633 resizable viewport (#1732)
Proof of concept for a resizable viewport.

The general approach here is to duplicate the `Terminal` struct from
ratatui, but with our own logic. This is a "light fork" in that we are
still using all the base ratatui functions (`Buffer`, `Widget` and so
on), but we're doing our own bookkeeping at the top level to determine
where to draw everything.

This approach could use improvement—e.g, when the window is resized to a
smaller size, if the UI wraps, we don't correctly clear out the
artifacts from wrapping. This is possible with a little work (i.e.
tracking what parts of our UI would have been wrapped), but this
behavior is at least at par with the existing behavior.


https://github.com/user-attachments/assets/4eb17689-09fd-4daa-8315-c7ebc654986d


cc @joshka who might have Thoughts™
2025-07-31 00:06:55 +00:00
pap 40cf8a819c lint test 2025-07-30 22:28:02 +01:00
pap 55659e351c fixing merge 2025-07-30 22:00:13 +01:00
pap 2326f99e03 Merge branch 'main' into pap/model-selection 2025-07-30 21:49:14 +01:00