mirror of
https://github.com/openai/codex.git
synced 2026-04-27 16:15:09 +00:00
chore: clean up argument-comment lint and roll out all-target CI on macOS (#16054)
## Why `argument-comment-lint` was green in CI even though the repo still had many uncommented literal arguments. The main gap was target coverage: the repo wrapper did not force Cargo to inspect test-only call sites, so examples like the `latest_session_lookup_params(true, ...)` tests in `codex-rs/tui_app_server/src/lib.rs` never entered the blocking CI path. This change cleans up the existing backlog, makes the default repo lint path cover all Cargo targets, and starts rolling that stricter CI enforcement out on the platform where it is currently validated. ## What changed - mechanically fixed existing `argument-comment-lint` violations across the `codex-rs` workspace, including tests, examples, and benches - updated `tools/argument-comment-lint/run-prebuilt-linter.sh` and `tools/argument-comment-lint/run.sh` so non-`--fix` runs default to `--all-targets` unless the caller explicitly narrows the target set - fixed both wrappers so forwarded cargo arguments after `--` are preserved with a single separator - documented the new default behavior in `tools/argument-comment-lint/README.md` - updated `rust-ci` so the macOS lint lane keeps the plain wrapper invocation and therefore enforces `--all-targets`, while Linux and Windows temporarily pass `-- --lib --bins` That temporary CI split keeps the stricter all-targets check where it is already cleaned up, while leaving room to finish the remaining Linux- and Windows-specific target-gated cleanup before enabling `--all-targets` on those runners. The Linux and Windows failures on the intermediate revision were caused by the wrapper forwarding bug, not by additional lint findings in those lanes. ## Validation - `bash -n tools/argument-comment-lint/run.sh` - `bash -n tools/argument-comment-lint/run-prebuilt-linter.sh` - shell-level wrapper forwarding check for `-- --lib --bins` - shell-level wrapper forwarding check for `-- --tests` - `just argument-comment-lint` - `cargo test` in `tools/argument-comment-lint` - `cargo test -p codex-terminal-detection` ## Follow-up - Clean up remaining Linux-only target-gated callsites, then switch the Linux lint lane back to the plain wrapper invocation. - Clean up remaining Windows-only target-gated callsites, then switch the Windows lint lane back to the plain wrapper invocation.
This commit is contained in:
@@ -353,7 +353,7 @@ async fn remote_compact_runs_automatically() -> Result<()> {
|
||||
harness.server(),
|
||||
sse(vec![
|
||||
responses::ev_shell_command_call("m1", "echo 'hi'"),
|
||||
responses::ev_completed_with_tokens("resp-1", 100000000), // over token limit
|
||||
responses::ev_completed_with_tokens("resp-1", /*total_tokens*/ 100000000), // over token limit
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
@@ -548,7 +548,10 @@ async fn auto_remote_compact_trims_function_call_history_to_fit_context_window()
|
||||
vec![
|
||||
sse(vec![
|
||||
responses::ev_shell_command_call(retained_call_id, retained_command),
|
||||
responses::ev_completed_with_tokens("retained-call-response", 100),
|
||||
responses::ev_completed_with_tokens(
|
||||
"retained-call-response",
|
||||
/*total_tokens*/ 100,
|
||||
),
|
||||
]),
|
||||
sse(vec![
|
||||
responses::ev_assistant_message("retained-assistant", "retained complete"),
|
||||
@@ -556,11 +559,14 @@ async fn auto_remote_compact_trims_function_call_history_to_fit_context_window()
|
||||
]),
|
||||
sse(vec![
|
||||
responses::ev_shell_command_call(trimmed_call_id, trimmed_command),
|
||||
responses::ev_completed_with_tokens("trimmed-call-response", 100),
|
||||
responses::ev_completed_with_tokens(
|
||||
"trimmed-call-response",
|
||||
/*total_tokens*/ 100,
|
||||
),
|
||||
]),
|
||||
sse(vec![responses::ev_completed_with_tokens(
|
||||
"trimmed-final-response",
|
||||
500_000,
|
||||
/*total_tokens*/ 500_000,
|
||||
)]),
|
||||
],
|
||||
)
|
||||
@@ -672,7 +678,7 @@ async fn auto_remote_compact_failure_stops_agent_loop() -> Result<()> {
|
||||
harness.server(),
|
||||
sse(vec![
|
||||
responses::ev_assistant_message("initial-assistant", "initial turn complete"),
|
||||
responses::ev_completed_with_tokens("initial-response", 500_000),
|
||||
responses::ev_completed_with_tokens("initial-response", /*total_tokens*/ 500_000),
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
@@ -1468,11 +1474,11 @@ async fn snapshot_request_shape_remote_pre_turn_compaction_restates_realtime_sta
|
||||
vec![
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m1", "REMOTE_FIRST_REPLY"),
|
||||
responses::ev_completed_with_tokens("r1", 500),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 500),
|
||||
]),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "REMOTE_SECOND_REPLY"),
|
||||
responses::ev_completed_with_tokens("r2", 80),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 80),
|
||||
]),
|
||||
],
|
||||
)
|
||||
@@ -1601,11 +1607,11 @@ async fn snapshot_request_shape_remote_pre_turn_compaction_restates_realtime_end
|
||||
vec![
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m1", "REMOTE_FIRST_REPLY"),
|
||||
responses::ev_completed_with_tokens("r1", 500),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 500),
|
||||
]),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "REMOTE_SECOND_REPLY"),
|
||||
responses::ev_completed_with_tokens("r2", 80),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 80),
|
||||
]),
|
||||
],
|
||||
)
|
||||
@@ -1686,11 +1692,11 @@ async fn snapshot_request_shape_remote_manual_compact_restates_realtime_start()
|
||||
vec![
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m1", "REMOTE_FIRST_REPLY"),
|
||||
responses::ev_completed_with_tokens("r1", 60),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 60),
|
||||
]),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "REMOTE_SECOND_REPLY"),
|
||||
responses::ev_completed_with_tokens("r2", 80),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 80),
|
||||
]),
|
||||
],
|
||||
)
|
||||
@@ -1776,15 +1782,15 @@ async fn snapshot_request_shape_remote_mid_turn_compaction_does_not_restate_real
|
||||
vec![
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("setup", "REMOTE_SETUP_REPLY"),
|
||||
responses::ev_completed_with_tokens("setup-response", 60),
|
||||
responses::ev_completed_with_tokens("setup-response", /*total_tokens*/ 60),
|
||||
]),
|
||||
responses::sse(vec![
|
||||
responses::ev_function_call("call-remote-mid-turn", DUMMY_FUNCTION_NAME, "{}"),
|
||||
responses::ev_completed_with_tokens("r1", 500),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 500),
|
||||
]),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "REMOTE_MID_TURN_FINAL_REPLY"),
|
||||
responses::ev_completed_with_tokens("r2", 80),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 80),
|
||||
]),
|
||||
],
|
||||
)
|
||||
@@ -1880,11 +1886,11 @@ async fn snapshot_request_shape_remote_compact_resume_restates_realtime_end() ->
|
||||
vec![
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m1", "REMOTE_FIRST_REPLY"),
|
||||
responses::ev_completed_with_tokens("r1", 60),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 60),
|
||||
]),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "REMOTE_AFTER_RESUME_REPLY"),
|
||||
responses::ev_completed_with_tokens("r2", 80),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 80),
|
||||
]),
|
||||
],
|
||||
)
|
||||
@@ -1984,15 +1990,15 @@ async fn snapshot_request_shape_remote_pre_turn_compaction_including_incoming_us
|
||||
vec![
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m1", "REMOTE_FIRST_REPLY"),
|
||||
responses::ev_completed_with_tokens("r1", 60),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 60),
|
||||
]),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "REMOTE_SECOND_REPLY"),
|
||||
responses::ev_completed_with_tokens("r2", 500),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 500),
|
||||
]),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m3", "REMOTE_FINAL_REPLY"),
|
||||
responses::ev_completed_with_tokens("r3", 80),
|
||||
responses::ev_completed_with_tokens("r3", /*total_tokens*/ 80),
|
||||
]),
|
||||
],
|
||||
)
|
||||
@@ -2088,7 +2094,7 @@ async fn snapshot_request_shape_remote_pre_turn_compaction_strips_incoming_model
|
||||
harness.server(),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m1", "BEFORE_SWITCH_REPLY"),
|
||||
responses::ev_completed_with_tokens("r1", 500),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 500),
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
@@ -2096,7 +2102,7 @@ async fn snapshot_request_shape_remote_pre_turn_compaction_strips_incoming_model
|
||||
harness.server(),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "AFTER_SWITCH_REPLY"),
|
||||
responses::ev_completed_with_tokens("r2", 80),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 80),
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
@@ -2224,7 +2230,7 @@ async fn snapshot_request_shape_remote_pre_turn_compaction_context_window_exceed
|
||||
harness.server(),
|
||||
vec![responses::sse(vec![
|
||||
responses::ev_assistant_message("m1", "REMOTE_FIRST_REPLY"),
|
||||
responses::ev_completed_with_tokens("r1", 500),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 500),
|
||||
])],
|
||||
)
|
||||
.await;
|
||||
@@ -2243,7 +2249,7 @@ async fn snapshot_request_shape_remote_pre_turn_compaction_context_window_exceed
|
||||
harness.server(),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "REMOTE_POST_COMPACT_SHOULD_NOT_RUN"),
|
||||
responses::ev_completed_with_tokens("r2", 80),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 80),
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
@@ -2325,11 +2331,11 @@ async fn snapshot_request_shape_remote_mid_turn_continuation_compaction() -> Res
|
||||
vec![
|
||||
responses::sse(vec![
|
||||
responses::ev_function_call("call-remote-mid-turn", DUMMY_FUNCTION_NAME, "{}"),
|
||||
responses::ev_completed_with_tokens("r1", 500),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 500),
|
||||
]),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "REMOTE_MID_TURN_FINAL_REPLY"),
|
||||
responses::ev_completed_with_tokens("r2", 80),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 80),
|
||||
]),
|
||||
],
|
||||
)
|
||||
@@ -2394,7 +2400,7 @@ async fn snapshot_request_shape_remote_mid_turn_compaction_summary_only_reinject
|
||||
harness.server(),
|
||||
responses::sse(vec![
|
||||
responses::ev_function_call("call-remote-summary-only", DUMMY_FUNCTION_NAME, "{}"),
|
||||
responses::ev_completed_with_tokens("r1", 500),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 500),
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
@@ -2402,7 +2408,7 @@ async fn snapshot_request_shape_remote_mid_turn_compaction_summary_only_reinject
|
||||
harness.server(),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m2", "REMOTE_SUMMARY_ONLY_FINAL_REPLY"),
|
||||
responses::ev_completed_with_tokens("r2", 80),
|
||||
responses::ev_completed_with_tokens("r2", /*total_tokens*/ 80),
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
@@ -2477,7 +2483,7 @@ async fn snapshot_request_shape_remote_mid_turn_compaction_multi_summary_reinjec
|
||||
harness.server(),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("setup", "REMOTE_SETUP_REPLY"),
|
||||
responses::ev_completed_with_tokens("setup-response", 60),
|
||||
responses::ev_completed_with_tokens("setup-response", /*total_tokens*/ 60),
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
@@ -2485,7 +2491,7 @@ async fn snapshot_request_shape_remote_mid_turn_compaction_multi_summary_reinjec
|
||||
harness.server(),
|
||||
responses::sse(vec![
|
||||
responses::ev_shell_command_call("call-remote-multi-summary", "echo multi-summary"),
|
||||
responses::ev_completed_with_tokens("r1", 1_000),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 1_000),
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
@@ -2580,7 +2586,7 @@ async fn snapshot_request_shape_remote_manual_compact_without_previous_user_mess
|
||||
harness.server(),
|
||||
responses::sse(vec![
|
||||
responses::ev_assistant_message("m1", "REMOTE_MANUAL_EMPTY_FOLLOW_UP_REPLY"),
|
||||
responses::ev_completed_with_tokens("r1", 80),
|
||||
responses::ev_completed_with_tokens("r1", /*total_tokens*/ 80),
|
||||
]),
|
||||
)
|
||||
.await;
|
||||
|
||||
Reference in New Issue
Block a user