Compare commits

..

7 Commits

Author SHA1 Message Date
Rakan El Khalil
f310b3d0ef test(tui): annotate remove-flicker test arg 2026-04-02 14:10:56 -07:00
Rakan El Khalil
3ddd8e3bc4 Update chatwidget status snapshot 2026-04-02 13:15:34 -07:00
Rakan El Khalil
1096d038ea Hide working status before final single-line answers render 2026-04-02 12:51:35 -07:00
Michael Bolin
5d64e58a38 fix: increase timeout to account for slow PowerShell startup (#16608)
Similar to https://github.com/openai/codex/pull/16604, I am seeing
failures on Windows Bazel that could be due to PowerShell startup
timeouts, so try increasing.
2026-04-02 12:40:19 -07:00
Michael Bolin
f894c3f687 fix: add more detail to test assertion (#16606)
In https://github.com/openai/codex/pull/16528, I am trying to get tests
running under Bazel on Windows, but currently I see:

```
thread 'suite::user_shell_cmd::user_shell_command_does_not_set_network_sandbox_env_var' (10220) panicked at core/tests\suite\user_shell_cmd.rs:358:5:
assertion failed: `(left == right)`

Diff < left / right > :
<1
>0
```

This PR updates the `assert_eq!()` to provide more information to help
diagnose the failure.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/16606).
* #16608
* __->__ #16606
2026-04-02 12:34:42 -07:00
Michael Bolin
2146e1b82d test: deflake external bearer auth token tests on Windows (#16604)
## Why

`external_bearer_only_auth_manager_uses_cached_provider_token` can fail
on Windows when cold `powershell.exe` startup exceeds the provider-auth
helper's 1s timeout. When that happens,
`AuthManager::resolve_external_api_key_auth()` [logs the resolver error
and returns
`None`](https://github.com/openai/codex/blob/024b08b411fe/codex-rs/login/src/auth/manager.rs#L1449-L1455),
which is exactly the assertion failure from the flake.

## What

- Invoke `powershell.exe` explicitly in the Windows provider-auth test
helpers in `login/src/auth/auth_tests.rs`.
- Increase the helper timeout to `10_000` ms and document why that slack
exists.

## Verification

- `cargo test -p codex-login`
2026-04-02 12:12:18 -07:00
Tyler French
1d8a22e9dd Fix non-determinism in rules_rs/crate_git_repository.bzl (#16590)
Running multiple builds with no changes causes some differences, we see
that
https://app.buildbuddy.io/compare/a9719629-1660-4735-a477-d66357f234fb...df85310b-eb5c-4c10-8b79-4d0449ba6cdd#file
shows the file-differences between two Bazel builds.

These differences are caused by a non-deterministic `.git` entry in the
rules_rs crates that are created with `crate_git_repository`.

As a way to make these deterministic, we can remove this entry after we
download the git source, so that the input to the compile action is
deterministic.

### CLA

I have read the CLA Document and I hereby sign the CLA
2026-04-02 11:21:11 -07:00
8 changed files with 3896 additions and 25 deletions

View File

@@ -350,13 +350,22 @@ async fn user_shell_command_does_not_set_network_sandbox_env_var() -> anyhow::Re
.submit(Op::RunUserShellCommand { command })
.await?;
let end_event = wait_for_event_match(&test.codex, |ev| match ev {
let ExecCommandEndEvent {
exit_code,
stdout,
stderr,
..
} = wait_for_event_match(&test.codex, |ev| match ev {
EventMsg::ExecCommandEnd(event) => Some(event.clone()),
_ => None,
})
.await;
assert_eq!(end_event.exit_code, 0);
assert_eq!(end_event.stdout.trim(), "not-set");
assert_eq!(
exit_code, 0,
"shell command should execute successfully. stdout=`{stdout}`, stderr=`{stderr}`",
);
assert_eq!(stdout.trim(), "not-set");
Ok(())
}

View File

@@ -395,7 +395,7 @@ $lines | Select-Object -Skip 1 | Set-Content -Path tokens.txt
"#,
)?;
(
"powershell".to_string(),
"powershell.exe".to_string(),
vec![
"-NoProfile".to_string(),
"-ExecutionPolicy".to_string(),
@@ -436,7 +436,7 @@ exit 1
#[cfg(windows)]
let (command, args) = (
"powershell".to_string(),
"powershell.exe".to_string(),
vec![
"-NoProfile".to_string(),
"-ExecutionPolicy".to_string(),
@@ -457,7 +457,9 @@ exit 1
serde_json::from_value(json!({
"command": self.command,
"args": self.args,
"timeout_ms": 1000,
// `powershell.exe` startup can be slow on loaded Windows CI workers, so leave enough
// slack to avoid turning these auth-cache assertions into a process-launch timing test.
"timeout_ms": 10_000,
"refresh_interval_ms": 60000,
"cwd": self.tempdir.path(),
}))

View File

@@ -60,17 +60,24 @@ async fn shell_command_approval_triggers_elicitation() -> anyhow::Result<()> {
.path()
.join(created_filename);
let shell_command = if cfg!(windows) {
vec![
"New-Item".to_string(),
"-ItemType".to_string(),
"File".to_string(),
"-Path".to_string(),
created_filename.to_string(),
"-Force".to_string(),
]
let (shell_command, timeout_ms) = if cfg!(windows) {
(
vec![
"New-Item".to_string(),
"-ItemType".to_string(),
"File".to_string(),
"-Path".to_string(),
created_filename.to_string(),
"-Force".to_string(),
],
// `powershell.exe` startup can be slow on loaded Windows CI workers
10_000,
)
} else {
vec!["touch".to_string(), created_filename.to_string()]
(
vec!["touch".to_string(), created_filename.to_string()],
5_000,
)
};
let expected_shell_command =
format_with_current_shell(&shlex::try_join(shell_command.iter().map(String::as_str))?);
@@ -83,7 +90,7 @@ async fn shell_command_approval_triggers_elicitation() -> anyhow::Result<()> {
create_shell_command_sse_response(
shell_command.clone(),
Some(workdir_for_shell_function_call.path()),
Some(5_000),
Some(timeout_ms),
"call1234",
)?,
create_final_assistant_message_sse_response("File created!")?,

View File

@@ -1696,6 +1696,9 @@ impl ChatWidget {
if let Some(mut controller) = self.stream_controller.take()
&& let Some(cell) = controller.finalize()
{
// Match newline-committed streaming behavior: once assistant output is committed into
// history, hide the inline status row so the new transcript content takes its place.
self.bottom_pane.hide_status_indicator();
self.add_boxed_history(cell);
}
self.adaptive_chunking.reset();

View File

@@ -0,0 +1,15 @@
---
source: tui/src/chatwidget/tests.rs
assertion_line: 1061
expression: term.backend().vt100().screen().contents()
---
count to 1
• 1
Ask Codex to do anything
gpt-5.3-codex default · 100% left · /…

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,6 @@ exports_files([
"rules_rust_repository_set_exec_constraints.patch",
"rules_rust_windows_msvc_direct_link_args.patch",
"rules_rust_windows_gnullvm_build_script.patch",
"rules_rs_delete_git_worktree_pointer.patch",
"rules_rs_windows_gnullvm_exec.patch",
"rusty_v8_prebuilt_out_dir.patch",
"v8_bazel_rules.patch",

View File

@@ -1,13 +1,7 @@
# What: delete .git worktree pointer from crate git checkouts.
# Why: the .git file contains an absolute path to the bazel output base,
# which differs across machines. This pollutes compile_data and causes
# action cache misses when builds run on different CI runners.
diff --git a/rs/private/crate_git_repository.bzl b/rs/private/crate_git_repository.bzl
index 1234567..abcdefg 100644
--- a/rs/private/crate_git_repository.bzl
+++ b/rs/private/crate_git_repository.bzl
@@ -35,6 +35,11 @@ def _crate_git_repository_implementation(rctx):
@@ -35,6 +35,14 @@
"HEAD"
])
if result.return_code != 0:
@@ -16,6 +10,9 @@ index 1234567..abcdefg 100644
+ # Remove .git worktree pointer file. It contains an absolute path to
+ # the bazel output base which is machine-specific and non-deterministic.
+ # Leaving it in pollutes compile_data globs and causes AC misses.
+ #
+ # Note that bazelbuild/rules_rust ignores .git (among other paths) during splicing:
+ # https://github.com/bazelbuild/rules_rust/blob/ca4915c0210bcd240152a5333ecb24d266bda144/crate_universe/src/splicing/splicer.rs#L42
+ rctx.delete(root.get_child(".git"))
+
if strip_prefix: