Commit Graph
1606 Commits
Author SHA1 Message Date
Michael Bolin 76700f7f05 merge commit for archive created by Sapling 2025-05-30 23:08:18 -07:00
Michael Bolin ace269f2b6 feat: add hide_agent_reasoning config option 2025-05-30 23:06:30 -07:00
Michael Bolin 4f3d294762 feat: dim the timestamp in the exec output (#1180)
This required changing `ts_println!()` to take `$self:ident`, which is a
bit more verbose, but the usability improvement seems worth it.

Also eliminated an unnecessary `.to_string()` while here.
codex-rs-378d773f3af95384eef51addf560df30aa9fd15f-1-rust-v0.0.2505301630
2025-05-30 16:27:37 -07:00
Michael Bolin 941a84aafb merge commit for archive created by Sapling 2025-05-30 16:25:47 -07:00
Michael Bolin b3623ffc61 feat: dim the timestamp in the exec output 2025-05-30 16:25:39 -07:00
Michael Bolin cf1d070538 feat: grab-bag of improvements to exec output (#1179)
Fixes:

* Instantiate `EventProcessor` earlier in `lib.rs` so
`print_config_summary()` can be an instance method of it and leverage
its various `Style` fields to ensure it honors `with_ansi` properly.
* After printing the config summary, print out user's prompt with the
heading `User instructions:`. As noted in the comment, now that we can
read the instructions via stdin as of #1178, it is helpful to the user
to ensure they know what instructions were given to Codex.
* Use same colors/bold/italic settings for headers as the TUI, making
the output a bit easier to read.
2025-05-30 16:22:10 -07:00
Michael Bolin 44a9fc30d1 Merge 4b0578b5e4 into sapling-pr-archive-bolinfest 2025-05-30 16:05:06 -07:00
Michael Bolin 4b0578b5e4 feat: grab-bag of improvements to exec output 2025-05-30 16:04:59 -07:00
Michael Bolin ae743d56b0 feat: for codex exec, if PROMPT is not specified, read from stdin if not a TTY (#1178)
This attempts to make `codex exec` more flexible in how the prompt can
be passed:

* as before, it can be passed as a single string argument
* if `-` is passed as the value, the prompt is read from stdin
* if no argument is passed _and stdin is a tty_, prints a warning to
stderr that no prompt was specified an exits non-zero.
* if no argument is passed _and stdin is NOT a tty_, prints `Reading
prompt from stdin...` to stderr to let the user know that Codex will
wait until it reads EOF from stdin to proceed. (You can repro this case
by doing `yes | just exec` since stdin is not a TTY in that case but it
also never reaches EOF).
2025-05-30 14:41:55 -07:00
Michael Bolin 5e6cb9dae6 merge commit for archive created by Sapling 2025-05-30 14:39:27 -07:00
Michael Bolin b6d576557c feat: for codex exec, if PROMPT is not specified, read from stdin if not a TTY 2025-05-30 14:39:22 -07:00
Michael Bolin 4bc9c52413 merge commit for archive created by Sapling 2025-05-30 14:36:03 -07:00
Michael Bolin a599342bbb feat: for codex exec, if PROMPT is not specified, read from stdin if not a TTY 2025-05-30 14:35:57 -07:00
Michael Bolin c0c5ba3442 Merge 13d2fdc34c into sapling-pr-archive-bolinfest 2025-05-30 14:32:47 -07:00
Michael Bolin 13d2fdc34c feat: for codex exec, if PROMPT is not specified, read from stdin if not a TTY 2025-05-30 14:31:11 -07:00
Michael Bolin 6cadbf58c6 Merge 47c9aafd05 into sapling-pr-archive-bolinfest 2025-05-30 14:07:29 -07:00
Michael Bolin 47c9aafd05 fix: chat completions API to work with tools 2025-05-30 14:07:09 -07:00
Michael Bolin 1bf82056b3 fix: introduce create_tools_json() and share it with chat_completions.rs (#1177)
The main motivator behind this PR is that `stream_chat_completions()`
was not adding the `"tools"` entry to the payload posted to the
`/chat/completions` endpoint. This (1) refactors the existing logic to
build up the `"tools"` JSON from `client.rs` into `openai_tools.rs`, and
(2) updates the use of responses API (`client.rs`) and chat completions
API (`chat_completions.rs`) to both use it.

Note this PR alone is not sufficient to get tool calling from chat
completions working: that is done in
https://github.com/openai/codex/pull/1167.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1177).
* #1167
* __->__ #1177
2025-05-30 14:07:03 -07:00
Michael Bolin 3a12c0461d merge commit for archive created by Sapling 2025-05-30 14:03:01 -07:00
Michael Bolin 93464101cb fix: chat completions API to work with tools 2025-05-30 14:02:34 -07:00
Michael Bolin 75e33481bc fix: introduce create_tools_json() and share it with chat_completions.rs 2025-05-30 14:02:34 -07:00
Michael Bolin 55004ca002 Merge 8e3c9ab29a into sapling-pr-archive-bolinfest 2025-05-30 13:52:28 -07:00
Michael Bolin 8e3c9ab29a fix: chat completions API to work with tools 2025-05-30 13:51:41 -07:00
Michael Bolin 570172bee5 fix: introduce create_tools_json() and share it with chat_completions.rs 2025-05-30 13:50:58 -07:00
Michael Bolin 5c714eef19 Merge f6a0a3afe8 into sapling-pr-archive-bolinfest 2025-05-30 13:49:06 -07:00
Michael Bolin f6a0a3afe8 fix: chat completions API now also passes tools along 2025-05-30 13:48:46 -07:00
Michael Bolin 20e4866870 fix: introduce create_tools_json() and share it with chat_completions.rs 2025-05-30 13:48:39 -07:00
Michael Bolin 187a54944a Merge ca2c197a85 into sapling-pr-archive-bolinfest 2025-05-30 13:13:23 -07:00
Michael Bolin ca2c197a85 fix: chat completions API now also passes tools along 2025-05-30 13:13:11 -07:00
Michael Bolin e207f20f64 fix: add extra debugging to GitHub Action (#1173)
https://github.com/openai/codex/actions/runs/15352839832/job/43205041563
appeared to fail around `postComment()`, but I don't see the output from
`fail()` in the logs. Adding a bit more info.
2025-05-30 11:16:30 -07:00
Michael Bolin d586261d12 Merge 354ceaf365 into sapling-pr-archive-bolinfest 2025-05-30 11:15:37 -07:00
Michael Bolin 354ceaf365 fix: add extra debugging to GitHub Action 2025-05-30 11:15:32 -07:00
Michael Bolin f2598c9132 Merge 534d998e31 into sapling-pr-archive-bolinfest 2025-05-30 11:15:26 -07:00
Michael Bolin 534d998e31 fix: add extra debugging to GitHub Action 2025-05-30 11:15:19 -07:00
Michael Bolin 0f40ef5a10 fix: missed a step in #1171 for codex.yml (#1172)
Missed in my copy/paste.
2025-05-30 11:04:41 -07:00
Michael Bolin 865072b8b0 merge commit for archive created by Sapling 2025-05-30 11:04:14 -07:00
Michael Bolin 7c6e2fc86c fix: missed a step in #1171 for codex.yml 2025-05-30 11:04:05 -07:00
Michael Bolin 8676185389 fix: update outdated repo setup in codex.yml (#1171)
We should do some work to share the setup logic across `codex.yml`,
`ci.yml`, and `rust-ci.yml`.
2025-05-30 10:58:57 -07:00
Michael Bolin a2c8119d7e merge commit for archive created by Sapling 2025-05-30 10:58:00 -07:00
Michael Bolin faaac85967 fix: update outdated repo setup in codex.yml 2025-05-30 10:57:50 -07:00
Michael Bolin baa92f37e0 feat: initial import of experimental GitHub Action (#1170)
This is a first cut at a GitHub Action that lets you define prompt
templates in `.md` files under `.github/codex/labels` that will run
Codex with the associated prompt when the label is added to a GitHub
pull request.

For example, this PR includes these files:

```
.github/codex/labels/codex-attempt.md
.github/codex/labels/codex-code-review.md
.github/codex/labels/codex-investigate-issue.md
```

And the new `.github/workflows/codex.yml` workflow declares the
following triggers:

```yaml
on:
  issues:
    types: [opened, labeled]
  pull_request:
    branches: [main]
    types: [labeled]
```

as well as the following expression to gate the action:

```
jobs:
  codex:
    if: |
      (github.event_name == 'issues' && (
        (github.event.action == 'labeled' && (github.event.label.name == 'codex-attempt' || github.event.label.name == 'codex-investigate-issue'))
      )) ||
      (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'codex-code-review')
```

Note the "actor" who added the label must have write access to the repo
for the action to take effect.

After adding a label, the action will "ack" the request by replacing the
original label (e.g., `codex-review`) with an `-in-progress` suffix
(e.g., `codex-review-in-progress`). When it is finished, it will swap
the `-in-progress` label with a `-completed` one (e.g.,
`codex-review-completed`).

Users of the action are responsible for providing an `OPENAI_API_KEY`
and making it available as a secret to the action.
2025-05-30 10:55:28 -07:00
Michael Bolin a90acbbcaa merge commit for archive created by Sapling 2025-05-30 10:49:48 -07:00
Michael Bolin 0bac2fcbc3 feat: initial import of experimental GitHub Action 2025-05-30 10:49:41 -07:00
Michael Bolin e7eed45dbc merge commit for archive created by Sapling 2025-05-30 10:43:45 -07:00
Michael Bolin 78f116e2f9 feat: initial import of experimental GitHub Action 2025-05-30 10:43:40 -07:00
Michael Bolin df67b60f83 merge commit for archive created by Sapling 2025-05-30 10:40:48 -07:00
Michael Bolin 54869c1503 feat: initial import of experimental GitHub Action 2025-05-30 10:40:40 -07:00
Michael Bolin b0d1bfacd3 merge commit for archive created by Sapling 2025-05-30 10:40:18 -07:00
Michael Bolin 6be57c201d feat: initial import of experimental GitHub Action 2025-05-30 10:40:12 -07:00
Michael Bolin 95a2760021 Merge 7da44b1143 into sapling-pr-archive-bolinfest 2025-05-30 10:38:25 -07:00