Skip to content

Commit 4215863

Browse files
lee101claude
andcommitted
Codex Infinity v1.3.18 - merge upstream + maintain custom features
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 parents 497144f + 7880414 commit 4215863

1,215 files changed

Lines changed: 4481 additions & 10220 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
7777
build:clippy --output_groups=+clippy_checks
7878
build:clippy --@rules_rust//rust/settings:clippy.toml=//codex-rs:clippy.toml
7979

80+
# Shared config for Bazel-backed argument-comment-lint.
81+
build:argument-comment-lint --aspects=//tools/argument-comment-lint:lint_aspect.bzl%rust_argument_comment_lint_aspect
82+
build:argument-comment-lint --output_groups=argument_comment_lint_checks
83+
build:argument-comment-lint --@rules_rust//rust/toolchain/channel=nightly
84+
8085
# Rearrange caches on Windows so they're on the same volume as the checkout.
8186
common:ci-windows --config=ci-bazel
8287
common:ci-windows --build_metadata=TAG_os=windows

.codex/skills/babysit-pr/SKILL.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ Accept any of the following:
2929
4. If `diagnose_ci_failure` is present, inspect failed run logs and classify the failure.
3030
5. If the failure is likely caused by the current branch, patch code locally, commit, and push.
3131
6. If `process_review_comment` is present, inspect surfaced review items and decide whether to address them.
32-
7. If a review item is actionable and correct, patch code locally, commit, and push.
33-
8. If the failure is likely flaky/unrelated and `retry_failed_checks` is present, rerun failed jobs with `--retry-failed-now`.
34-
9. If both actionable review feedback and `retry_failed_checks` are present, prioritize review feedback first; a new commit will retrigger CI, so avoid rerunning flaky checks on the old SHA unless you intentionally defer the review change.
35-
10. On every loop, verify mergeability / merge-conflict status (for example via `gh pr view`) in addition to CI and review state.
36-
11. After any push or rerun action, immediately return to step 1 and continue polling on the updated SHA/state.
37-
12. If you had been using `--watch` before pausing to patch/commit/push, relaunch `--watch` yourself in the same turn immediately after the push (do not wait for the user to re-invoke the skill).
38-
13. Repeat polling until the PR is green + review-clean + mergeable, `stop_pr_closed` appears, or a user-help-required blocker is reached.
39-
14. Maintain terminal/session ownership: while babysitting is active, keep consuming watcher output in the same turn; do not leave a detached `--watch` process running and then end the turn as if monitoring were complete.
32+
7. If a review item is actionable and correct, patch code locally, commit, push, and then mark the associated review thread/comment as resolved once the fix is on GitHub.
33+
8. If a review item from another author is non-actionable, already addressed, or not valid, post one reply on the comment/thread explaining that decision (for example answering the question or explaining why no change is needed). If the watcher later surfaces your own reply, treat that self-authored item as already handled and do not reply again.
34+
9. If the failure is likely flaky/unrelated and `retry_failed_checks` is present, rerun failed jobs with `--retry-failed-now`.
35+
10. If both actionable review feedback and `retry_failed_checks` are present, prioritize review feedback first; a new commit will retrigger CI, so avoid rerunning flaky checks on the old SHA unless you intentionally defer the review change.
36+
11. On every loop, verify mergeability / merge-conflict status (for example via `gh pr view`) in addition to CI and review state.
37+
12. After any push or rerun action, immediately return to step 1 and continue polling on the updated SHA/state.
38+
13. If you had been using `--watch` before pausing to patch/commit/push, relaunch `--watch` yourself in the same turn immediately after the push (do not wait for the user to re-invoke the skill).
39+
14. Repeat polling until the PR is green + review-clean + mergeable, `stop_pr_closed` appears, or a user-help-required blocker is reached.
40+
15. Maintain terminal/session ownership: while babysitting is active, keep consuming watcher output in the same turn; do not leave a detached `--watch` process running and then end the turn as if monitoring were complete.
4041

4142
## Commands
4243

@@ -94,10 +95,11 @@ When you agree with a comment and it is actionable:
9495
1. Patch code locally.
9596
2. Commit with `codex: address PR review feedback (#<n>)`.
9697
3. Push to the PR head branch.
97-
4. Resume watching on the new SHA immediately (do not stop after reporting the push).
98-
5. If monitoring was running in `--watch` mode, restart `--watch` immediately after the push in the same turn; do not wait for the user to ask again.
98+
4. After the push succeeds, mark the associated GitHub review thread/comment as resolved.
99+
5. Resume watching on the new SHA immediately (do not stop after reporting the push).
100+
6. If monitoring was running in `--watch` mode, restart `--watch` immediately after the push in the same turn; do not wait for the user to ask again.
99101

100-
If you disagree or the comment is non-actionable/already addressed, record it as handled by continuing the watcher loop (the script de-duplicates surfaced items via state after surfacing them).
102+
If you disagree or the comment is non-actionable/already addressed, reply once directly on the GitHub comment/thread so the reviewer gets an explicit answer, then continue the watcher loop. If the watcher later surfaces your own reply because the authenticated operator is treated as a trusted review author, treat that self-authored item as already handled and do not reply again.
101103
If a code review comment/thread is already marked as resolved in GitHub, treat it as non-actionable and safely ignore it unless new unresolved follow-up feedback appears.
102104

103105
## Git Safety Rules
@@ -124,13 +126,14 @@ Use this loop in a live Codex session:
124126
3. First check whether the PR is now merged or otherwise closed; if so, report that terminal state and stop polling immediately.
125127
4. Check CI summary, new review items, and mergeability/conflict status.
126128
5. Diagnose CI failures and classify branch-related vs flaky/unrelated.
127-
6. Process actionable review comments before flaky reruns when both are present; if a review fix requires a commit, push it and skip rerunning failed checks on the old SHA.
128-
7. Retry failed checks only when `retry_failed_checks` is present and you are not about to replace the current SHA with a review/CI fix commit.
129-
8. If you pushed a commit or triggered a rerun, report the action briefly and continue polling (do not stop).
130-
9. After a review-fix push, proactively restart continuous monitoring (`--watch`) in the same turn unless a strict stop condition has already been reached.
131-
10. If everything is passing, mergeable, not blocked on required review approval, and there are no unaddressed review items, report success and stop.
132-
11. If blocked on a user-help-required issue (infra outage, exhausted flaky retries, unclear reviewer request, permissions), report the blocker and stop.
133-
12. Otherwise sleep according to the polling cadence below and repeat.
129+
6. For each surfaced review item from another author, either reply once with an explanation if it is non-actionable or patch/commit/push and then resolve it if it is actionable. If a later snapshot surfaces your own reply, treat it as informational and continue without responding again.
130+
7. Process actionable review comments before flaky reruns when both are present; if a review fix requires a commit, push it and skip rerunning failed checks on the old SHA.
131+
8. Retry failed checks only when `retry_failed_checks` is present and you are not about to replace the current SHA with a review/CI fix commit.
132+
9. If you pushed a commit, resolved a review thread, replied to a review comment, or triggered a rerun, report the action briefly and continue polling (do not stop).
133+
10. After a review-fix push, proactively restart continuous monitoring (`--watch`) in the same turn unless a strict stop condition has already been reached.
134+
11. If everything is passing, mergeable, not blocked on required review approval, and there are no unaddressed review items, report success and stop.
135+
12. If blocked on a user-help-required issue (infra outage, exhausted flaky retries, unclear reviewer request, permissions), report the blocker and stop.
136+
13. Otherwise sleep according to the polling cadence below and repeat.
134137

135138
When the user explicitly asks to monitor/watch/babysit a PR, prefer `--watch` so polling continues autonomously in one command. Use repeated `--once` snapshots only for debugging, local testing, or when the user explicitly asks for a one-shot check.
136139
Do not stop to ask the user whether to continue polling; continue autonomously until a strict stop condition is met or the user explicitly interrupts.

.github/actions/setup-bazel-ci/action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ runs:
5757
if: runner.os == 'Windows'
5858
shell: pwsh
5959
run: |
60-
# Use a very short path to reduce argv/path length issues, but avoid the
61-
# drive root because some Windows test launchers mis-handle MANIFEST paths there.
62-
"BAZEL_OUTPUT_USER_ROOT=D:\b" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
60+
# Use the shortest available drive to reduce argv/path length issues,
61+
# but avoid the drive root because some Windows test launchers mis-handle
62+
# MANIFEST paths there.
63+
$bazelOutputUserRoot = if (Test-Path 'D:\') { 'D:\b' } else { 'C:\b' }
64+
"BAZEL_OUTPUT_USER_ROOT=$bazelOutputUserRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
6365
6466
- name: Enable Git long paths (Windows)
6567
if: runner.os == 'Windows'

.github/workflows/bazel.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
--use-node-test-env \
8282
-- \
8383
test \
84+
--test_tag_filters=-argument-comment-lint \
8485
--test_verbose_timeout_warnings \
8586
--build_metadata=COMMIT_SHA=${GITHUB_SHA} \
8687
-- \
@@ -98,6 +99,7 @@ jobs:
9899
key: bazel-cache-${{ matrix.target }}-${{ hashFiles('MODULE.bazel', 'codex-rs/Cargo.lock', 'codex-rs/Cargo.toml') }}
99100

100101
clippy:
102+
timeout-minutes: 30
101103
strategy:
102104
fail-fast: false
103105
matrix:

.github/workflows/rust-ci-full.yml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
argument_comment_lint_prebuilt:
7474
name: Argument comment lint - ${{ matrix.name }}
7575
runs-on: ${{ matrix.runs_on || matrix.runner }}
76+
timeout-minutes: 30
7677
strategy:
7778
fail-fast: false
7879
matrix:
@@ -88,29 +89,45 @@ jobs:
8889
labels: codex-windows-x64
8990
steps:
9091
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
92+
- uses: ./.github/actions/setup-bazel-ci
93+
with:
94+
target: ${{ runner.os }}
95+
install-test-prereqs: true
9196
- name: Install Linux sandbox build dependencies
9297
if: ${{ runner.os == 'Linux' }}
9398
shell: bash
9499
run: |
95100
sudo DEBIAN_FRONTEND=noninteractive apt-get update
96101
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends pkg-config libcap-dev
97-
- uses: dtolnay/rust-toolchain@a0b273b48ed29de4470960879e8381ff45632f26 # 1.93.0
98-
with:
99-
toolchain: nightly-2025-09-18
100-
components: llvm-tools-preview, rustc-dev, rust-src
101-
- uses: facebook/install-dotslash@1e4e7b3e07eaca387acb98f1d4720e0bee8dbb6a # v2
102-
- name: Run argument comment lint on codex-rs
103-
if: ${{ runner.os == 'macOS' }}
102+
- name: Install nightly argument-comment-lint toolchain
103+
if: ${{ runner.os == 'Windows' }}
104104
shell: bash
105-
run: python3 ./tools/argument-comment-lint/run-prebuilt-linter.py
106-
- name: Run argument comment lint on codex-rs (default targets only)
107-
if: ${{ runner.os == 'Linux' }}
105+
run: |
106+
rustup toolchain install nightly-2025-09-18 \
107+
--profile minimal \
108+
--component llvm-tools-preview \
109+
--component rustc-dev \
110+
--component rust-src \
111+
--no-self-update
112+
rustup default nightly-2025-09-18
113+
- name: Run argument comment lint on codex-rs via Bazel
114+
if: ${{ runner.os != 'Windows' }}
115+
env:
116+
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
108117
shell: bash
109-
run: python3 ./tools/argument-comment-lint/run-prebuilt-linter.py -- --lib --bins
110-
- name: Run argument comment lint on codex-rs
118+
run: |
119+
./.github/scripts/run-bazel-ci.sh \
120+
-- \
121+
build \
122+
--config=argument-comment-lint \
123+
--keep_going \
124+
--build_metadata=COMMIT_SHA=${GITHUB_SHA} \
125+
-- \
126+
//codex-rs/...
127+
- name: Run argument comment lint on codex-rs via packaged wrapper
111128
if: ${{ runner.os == 'Windows' }}
112129
shell: bash
113-
run: python ./tools/argument-comment-lint/run-prebuilt-linter.py
130+
run: python3 ./tools/argument-comment-lint/run-prebuilt-linter.py
114131

115132
# --- CI to validate on different os/targets --------------------------------
116133
lint_build:

.github/workflows/rust-ci.yml

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,16 @@ jobs:
9393
steps:
9494
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
9595
- uses: dtolnay/rust-toolchain@a0b273b48ed29de4470960879e8381ff45632f26 # 1.93.0
96-
with:
97-
toolchain: nightly-2025-09-18
98-
components: llvm-tools-preview, rustc-dev, rust-src
96+
- name: Install nightly argument-comment-lint toolchain
97+
shell: bash
98+
run: |
99+
rustup toolchain install nightly-2025-09-18 \
100+
--profile minimal \
101+
--component llvm-tools-preview \
102+
--component rustc-dev \
103+
--component rust-src \
104+
--no-self-update
105+
rustup default nightly-2025-09-18
99106
- name: Cache cargo-dylint tooling
100107
id: cargo_dylint_cache
101108
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
@@ -121,6 +128,7 @@ jobs:
121128
argument_comment_lint_prebuilt:
122129
name: Argument comment lint - ${{ matrix.name }}
123130
runs-on: ${{ matrix.runs_on || matrix.runner }}
131+
timeout-minutes: ${{ matrix.timeout_minutes }}
124132
needs: changed
125133
if: ${{ needs.changed.outputs.argument_comment_lint == 'true' || needs.changed.outputs.workflows == 'true' }}
126134
strategy:
@@ -129,40 +137,57 @@ jobs:
129137
include:
130138
- name: Linux
131139
runner: ubuntu-24.04
140+
timeout_minutes: 30
132141
- name: macOS
133142
runner: macos-15-xlarge
143+
timeout_minutes: 30
134144
- name: Windows
135145
runner: windows-x64
146+
timeout_minutes: 30
136147
runs_on:
137148
group: codex-runners
138149
labels: codex-windows-x64
139150
steps:
140151
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
152+
- uses: ./.github/actions/setup-bazel-ci
153+
with:
154+
target: ${{ runner.os }}
155+
install-test-prereqs: true
141156
- name: Install Linux sandbox build dependencies
142157
if: ${{ runner.os == 'Linux' }}
143158
shell: bash
144159
run: |
145160
sudo DEBIAN_FRONTEND=noninteractive apt-get update
146161
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends pkg-config libcap-dev
147-
- uses: dtolnay/rust-toolchain@a0b273b48ed29de4470960879e8381ff45632f26 # 1.93.0
148-
with:
149-
toolchain: nightly-2025-09-18
150-
components: llvm-tools-preview, rustc-dev, rust-src
151-
- uses: facebook/install-dotslash@1e4e7b3e07eaca387acb98f1d4720e0bee8dbb6a # v2
152-
- name: Run argument comment lint on codex-rs
153-
if: ${{ runner.os == 'macOS' }}
162+
- name: Install nightly argument-comment-lint toolchain
163+
if: ${{ runner.os == 'Windows' }}
154164
shell: bash
155-
run: python3 ./tools/argument-comment-lint/run-prebuilt-linter.py
156-
# Linux still uses the default-targets-only form for now, but PRs run the
157-
# released linter on all three platforms so wrapper regressions surface pre-merge.
158-
- name: Run argument comment lint on codex-rs (default targets only)
159-
if: ${{ runner.os == 'Linux' }}
165+
run: |
166+
rustup toolchain install nightly-2025-09-18 \
167+
--profile minimal \
168+
--component llvm-tools-preview \
169+
--component rustc-dev \
170+
--component rust-src \
171+
--no-self-update
172+
rustup default nightly-2025-09-18
173+
- name: Run argument comment lint on codex-rs via Bazel
174+
if: ${{ runner.os != 'Windows' }}
175+
env:
176+
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
160177
shell: bash
161-
run: python3 ./tools/argument-comment-lint/run-prebuilt-linter.py -- --lib --bins
162-
- name: Run argument comment lint on codex-rs
178+
run: |
179+
./.github/scripts/run-bazel-ci.sh \
180+
-- \
181+
build \
182+
--config=argument-comment-lint \
183+
--keep_going \
184+
--build_metadata=COMMIT_SHA=${GITHUB_SHA} \
185+
-- \
186+
//codex-rs/...
187+
- name: Run argument comment lint on codex-rs via packaged wrapper
163188
if: ${{ runner.os == 'Windows' }}
164189
shell: bash
165-
run: python ./tools/argument-comment-lint/run-prebuilt-linter.py
190+
run: python3 ./tools/argument-comment-lint/run-prebuilt-linter.py
166191

167192
# --- Gatherer job that you mark as the ONLY required status -----------------
168193
results:

AGENTS.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ In the codex-rs folder where the rust code lives:
3535
- If a file exceeds roughly 800 LoC, add new functionality in a new module instead of extending
3636
the existing file unless there is a strong documented reason not to.
3737
- This rule applies especially to high-touch files that already attract unrelated changes, such
38-
as `codex-rs/tui_app_server/src/app.rs`, `codex-rs/tui_app_server/src/bottom_pane/chat_composer.rs`,
39-
`codex-rs/tui_app_server/src/bottom_pane/footer.rs`, `codex-rs/tui_app_server/src/chatwidget.rs`,
40-
`codex-rs/tui_app_server/src/bottom_pane/mod.rs`, and similarly central orchestration modules.
38+
as `codex-rs/tui/src/app.rs`, `codex-rs/tui/src/bottom_pane/chat_composer.rs`,
39+
`codex-rs/tui/src/bottom_pane/footer.rs`, `codex-rs/tui/src/chatwidget.rs`,
40+
`codex-rs/tui/src/bottom_pane/mod.rs`, and similarly central orchestration modules.
4141
- When extracting code from a large module, move the related tests and module/type docs toward
4242
the new implementation so the invariants stay close to the code that owns them.
4343
- When running Rust commands (e.g. `just fix` or `cargo test`) be patient with the command and never try to kill them using the PID. Rust lock can make the execution slow, this is expected.
@@ -66,12 +66,10 @@ Likewise, when reviewing code, do not hesitate to push back on PRs that would un
6666

6767
## TUI style conventions
6868

69-
See `codex-rs/tui_app_server/styles.md`.
69+
See `codex-rs/tui/styles.md`.
7070

7171
## TUI code conventions
7272

73-
- When a change lands in `codex-rs/tui` and `codex-rs/tui_app_server` has a parallel implementation of the same behavior, reflect the change in `codex-rs/tui_app_server` too unless there is a documented reason not to.
74-
7573
- Use concise styling helpers from ratatui’s Stylize trait.
7674
- Basic spans: use "text".into()
7775
- Styled spans: use "text".red(), "text".green(), "text".magenta(), "text".dim(), etc.

0 commit comments

Comments
 (0)