Commit Graph
107 Commits
Author SHA1 Message Date
Rai (Michael Pokorny) 67c9f755fa Merge branch 'agentydragon-23-interactive-container-command-affordance' into agentydragon 2025-06-25 04:52:46 -07:00
Rai (Michael Pokorny) 4e7840454b agentydragon(tasks): implement interactive shell-command hotkey + tests 2025-06-25 04:45:33 -07:00
Rai (Michael Pokorny) 253324e5c3 wip 2025-06-25 04:37:54 -07:00
Rai (Michael Pokorny) 4ed4b72e26 Merge branch 'agentydragon-38-approval-dialog-transparent-background-fix' into agentydragon 2025-06-25 04:34:45 -07:00
Rai (Michael Pokorny) d4aaa1aad4 Merge branch 'agentydragon-36-tests-interactive-prompt-execution' into agentydragon 2025-06-25 04:34:39 -07:00
Rai (Michael Pokorny) fa2a5d07bf Merge branch 'agentydragon-22-message-rendering-layout-options' into agentydragon 2025-06-25 04:34:15 -07:00
Rai (Michael Pokorny) da247e932c agentydragon(tasks): add BottomPane unit tests for interactive prompting overlay during task execution 2025-06-25 04:30:49 -07:00
Rai (Michael Pokorny) d967dbc669 agentydragon(tasks): Add message_spacing and sender_break_line flags to TUI config with default false, update renderer and tests for configurable inter-message spacing and sender-content layout 2025-06-25 04:30:14 -07:00
Rai (Michael Pokorny) a30a80d22a agentydragon(tasks): add message_spacing and sender_break_line flags to TUI config; update history_cell renderer, docs, and tests 2025-06-25 04:28:33 -07:00
Rai (Michael Pokorny) 94167c15cf agentydragon(tasks): fill approval dialog region with solid DarkGray background and add test ensuring no transparent cells 2025-06-25 04:28:17 -07:00
Rai (Michael Pokorny) 3d9e034c65 Merge branch 'agentydragon-23-interactive-container-command-affordance' into agentydragon 2025-06-25 04:27:04 -07:00
Rai (Michael Pokorny) 1bff7c4db0 Merge branch 'agentydragon-35-tui-inspect-env-integration' into agentydragon 2025-06-25 00:20:50 -07:00
Rai (Michael Pokorny) 05a49d8036 codex-rs: remove border and unused imports/style in status indicator widget 2025-06-25 00:10:49 -07:00
Rai (Michael Pokorny) da1df276a2 agentydragon(tasks): implement interactive shell-command hotkey + tests 2025-06-24 23:50:43 -07:00
Rai (Michael Pokorny) de380981de wip 2025-06-24 23:45:58 -07:00
Rai (Michael Pokorny) 27b3596809 wip 2025-06-24 23:39:33 -07:00
Rai (Michael Pokorny) 442bc9b9c3 tui(cli): add --debug-log flag and support file logging 2025-06-24 23:09:40 -07:00
Rai (Michael Pokorny) 0a9c0304f8 agentydragon(tasks): implement TUI integration for /inspect-env 2025-06-24 22:35:20 -07:00
Rai (Michael Pokorny) 9f30c4df50 Merge branch 'agentydragon-19-bash-command-rendering-improvements' into agentydragon
# Conflicts:
#	agentydragon/tasks/19-bash-command-rendering-improvements.md
2025-06-24 22:35:11 -07:00
Rai (Michael Pokorny) 8280bd1f9d Merge branch 'agentydragon-18-chat-ui-textarea-overlay-border-fix' into agentydragon
# Conflicts:
#	agentydragon/tasks/18-chat-ui-textarea-overlay-border-fix.md
2025-06-24 22:34:25 -07:00
Rai (Michael Pokorny) 928afbb87e Merge branch 'agentydragon-16-confirm-on-ctrl-d' into agentydragon 2025-06-24 22:33:52 -07:00
Rai (Michael Pokorny) 7f7582d68d Merge branch 'agentydragon-03-live-config-reload' into agentydragon
# Conflicts:
#	agentydragon/tasks/03-live-config-reload.md
2025-06-24 22:33:39 -07:00
Rai (Michael Pokorny) 2f254365e0 agentydragon(tasks): implement bash command rendering improvements in Rust TUI 2025-06-24 22:27:48 -07:00
Rai (Michael Pokorny) 40f784e5c3 agentydragon(tasks): implement double Ctrl+D confirmation on TUI exit 2025-06-24 22:26:58 -07:00
Rai (Michael Pokorny) b352146912 agentydragon(tasks): implement live config reload with diff prompt and apply/ignore support 2025-06-24 22:25:32 -07:00
Rai (Michael Pokorny) 2ce7ba7257 agentydragon(tasks): add compact markdown rendering option to TUI 2025-06-24 22:23:08 -07:00
Rai (Michael Pokorny) 734ba5ae6a agentydragon(tasks): implement chat UI border merge & status overlay reposition 2025-06-24 22:21:41 -07:00
Rai (Michael Pokorny) e901754d14 agentydragon(tasks): merge task 08 set-shell-title 2025-06-24 21:06:45 -07:00
Rai (Michael Pokorny) e7f7847a49 agentydragon(tasks): merge task 28 include command snippet in approval label 2025-06-24 21:04:43 -07:00
Rai (Michael Pokorny) fca6766935 agentydragon(tasks): implement command snippet truncation in session approval labels 2025-06-24 20:55:43 -07:00
Rai (Michael Pokorny) 624deb4158 Merge task 31-display-context-remaining-percentage into integration branch (ours) 2025-06-24 20:53:02 -07:00
Rai (Michael Pokorny) 2a015a2464 wip 2025-06-24 20:40:10 -07:00
Rai (Michael Pokorny) 1fb774909d wip 2025-06-24 20:32:13 -07:00
Rai (Michael Pokorny) b1eb965839 agentydragon(tasks): implement set-shell-title feature 2025-06-24 20:08:16 -07:00
Rai (Michael Pokorny) 723c2452e0 agentydragon(tasks): implement context-left indicator in TUI 2025-06-24 20:03:03 -07:00
Rai (Michael Pokorny) 9670cfdef8 wip 2025-06-24 19:10:40 -07:00
Rai (Michael Pokorny) f26875b5d8 Merge remote-tracking branch 'origin/agentydragon' into agentydragon 2025-06-24 18:30:49 -07:00
Rai (Michael Pokorny) d5668f158d codex-rs(tui): restore EditPrompt arm and clear merge conflict markers in chat_composer 2025-06-24 18:21:53 -07:00
Rai (Michael Pokorny) d7d15f5fd3 remove session-scoped approval option for patches; update command approve label to B variant 2025-06-24 16:57:40 -07:00
Rai (Michael Pokorny) 4851101038 codex-rs: correct approval label to reference 'patch' instead of 'command' 2025-06-24 16:51:25 -07:00
Rai (Michael Pokorny) 09e4a3b4b8 wip 2025-06-24 15:10:28 -07:00
Rai (Michael Pokorny) 669aa3ef39 merge fix 2025-06-24 15:06:06 -07:00
Rai (Michael Pokorny) 44ea1cf73f Merge Tasks 01, 07, 13 2025-06-24 14:39:54 -07:00
Rai (Michael Pokorny) 22d7b327a0 Auto-commit pending changes on agentydragon-task/13-interactive-prompt-during-execution 2025-06-24 14:31:38 -07:00
Rai (Michael Pokorny) df9e65127f Auto-commit pending changes on agentydragon-task/07-undo-feedback-decision 2025-06-24 14:31:35 -07:00
Rai (Michael Pokorny) b23d44cb5c 01 dynamic mount commands 2025-06-24 14:30:34 -07:00
Rai (Michael Pokorny) 65e5d926ab tui session load 2025-06-21 06:38:29 -07:00
Rai (Michael Pokorny) bb19ef1434 botom pane height, restore cmd 2025-06-21 03:49:22 -07:00
Reilly Wood 345a38502d codex-rs: Rename /clear to /new, make it start an entirely new chat (#1264)
I noticed that `/clear` wasn't fully clearing chat history; it would
clear the chat history widgets _in the UI_, but the LLM still had access
to information from previous messages.

This PR renames `/clear` to `/new` for clarity as per Michael's
suggestion, resetting `app_state` to a fresh `ChatWidget`.
2025-06-06 16:29:37 -07:00
Michael Bolin 515b6331bd feat: add support for login with ChatGPT (#1212)
This does not implement the full Login with ChatGPT experience, but it
should unblock people.

**What works**

* The `codex` multitool now has a `login` subcommand, so you can run
`codex login`, which should write `CODEX_HOME/auth.json` if you complete
the flow successfully. The TUI will now read the `OPENAI_API_KEY` from
`auth.json`.
* The TUI should refresh the token if it has expired and the necessary
information is in `auth.json`.
* There is a `LoginScreen` in the TUI that tells you to run `codex
login` if both (1) your model provider expects to use `OPENAI_API_KEY`
as its env var, and (2) `OPENAI_API_KEY` is not set.

**What does not work**

* The `LoginScreen` does not support the login flow from within the TUI.
Instead, it tells you to quit, run `codex login`, and then run `codex`
again.
* `codex exec` does read from `auth.json` yet, nor does it direct the
user to go through the login flow if `OPENAI_API_KEY` is not be found.
* The `maybeRedeemCredits()` function from `get-api-key.tsx` has not
been ported from TypeScript to `login_with_chatgpt.py` yet:


https://github.com/openai/codex/blob/a67a67f3258fc21e147b6786a143fe3e15e6d5ba/codex-cli/src/utils/get-api-key.tsx#L84-L89

**Implementation**

Currently, the OAuth flow requires running a local webserver on
`127.0.0.1:1455`. It seemed wasteful to incur the additional binary cost
of a webserver dependency in the Rust CLI just to support login, so
instead we implement this logic in Python, as Python has a `http.server`
module as part of its standard library. Specifically, we bundle the
contents of a single Python file as a string in the Rust CLI and then
use it to spawn a subprocess as `python3 -c
{{SOURCE_FOR_PYTHON_SERVER}}`.

As such, the most significant files in this PR are:

```
codex-rs/login/src/login_with_chatgpt.py
codex-rs/login/src/lib.rs
```

Now that the CLI may load `OPENAI_API_KEY` from the environment _or_
`CODEX_HOME/auth.json`, we need a new abstraction for reading/writing
this variable, so we introduce:

```
codex-rs/core/src/openai_api_key.rs
```

Note that `std::env::set_var()` is [rightfully] `unsafe` in Rust 2024,
so we use a LazyLock<RwLock<Option<String>>> to store `OPENAI_API_KEY`
so it is read in a thread-safe manner.

Ultimately, it should be possible to go through the entire login flow
from the TUI. This PR introduces a placeholder `LoginScreen` UI for that
right now, though the new `codex login` subcommand introduced in this PR
should be a viable workaround until the UI is ready.

**Testing**

Because the login flow is currently implemented in a standalone Python
file, you can test it without building any Rust code as follows:

```
rm -rf /tmp/codex_home && mkdir /tmp/codex_home
CODEX_HOME=/tmp/codex_home python3 codex-rs/login/src/login_with_chatgpt.py
```

For reference:

* the original TypeScript implementation was introduced in
https://github.com/openai/codex/pull/963
* support for redeeming credits was later added in
https://github.com/openai/codex/pull/974
2025-06-04 08:44:17 -07:00