Skip to content

Commit b080c91

Browse files
aibrahim-oaicodex
andcommitted
Use aec3 for TUI realtime echo cancellation
Replace the native audio-processing dependency with a smaller pure-Rust realtime echo-cancellation path. Co-authored-by: Codex <noreply@openai.com>
1 parent 3e206d1 commit b080c91

14 files changed

+345
-741
lines changed

MODULE.bazel

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -278,74 +278,6 @@ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "ht
278278
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
279279
new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
280280

281-
http_archive(
282-
name = "ninja_1.11.0_linux",
283-
urls = [
284-
"https://github.com/ninja-build/ninja/releases/download/v1.11.0/ninja-linux.zip",
285-
],
286-
sha256 = "9726e730d5b8599f82654dc80265e64a10a8a817552c34153361ed0c017f9f02",
287-
strip_prefix = "",
288-
build_file_content = """\
289-
package(default_visibility = ["//visibility:public"])
290-
291-
filegroup(
292-
name = "ninja_bin",
293-
srcs = ["ninja"],
294-
)
295-
""",
296-
)
297-
298-
http_archive(
299-
name = "ninja_1.12.1_linux_aarch64",
300-
urls = [
301-
"https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-linux-aarch64.zip",
302-
],
303-
sha256 = "5c25c6570b0155e95fce5918cb95f1ad9870df5768653afe128db822301a05a1",
304-
strip_prefix = "",
305-
build_file_content = """\
306-
package(default_visibility = ["//visibility:public"])
307-
308-
filegroup(
309-
name = "ninja_bin",
310-
srcs = ["ninja"],
311-
)
312-
""",
313-
)
314-
315-
http_archive(
316-
name = "ninja_1.11.0_mac",
317-
urls = [
318-
"https://github.com/ninja-build/ninja/releases/download/v1.11.0/ninja-mac.zip",
319-
],
320-
sha256 = "21915277db59756bfc61f6f281c1f5e3897760b63776fd3d360f77dd7364137f",
321-
strip_prefix = "",
322-
build_file_content = """\
323-
package(default_visibility = ["//visibility:public"])
324-
325-
filegroup(
326-
name = "ninja_bin",
327-
srcs = ["ninja"],
328-
)
329-
""",
330-
)
331-
332-
http_archive(
333-
name = "ninja_1.11.0_win",
334-
urls = [
335-
"https://github.com/ninja-build/ninja/releases/download/v1.11.0/ninja-win.zip",
336-
],
337-
sha256 = "d0ee3da143211aa447e750085876c9b9d7bcdd637ab5b2c5b41349c617f22f3b",
338-
strip_prefix = "",
339-
build_file_content = """\
340-
package(default_visibility = ["//visibility:public"])
341-
342-
filegroup(
343-
name = "ninja_bin",
344-
srcs = ["ninja.exe"],
345-
)
346-
""",
347-
)
348-
349281
new_local_repository(
350282
name = "v8_targets",
351283
build_file = "//third_party/v8:BUILD.bazel",
@@ -413,45 +345,6 @@ crate.annotation(
413345

414346
inject_repo(crate, "alsa_lib")
415347

416-
bazel_dep(name = "meson", version = "1.5.1.bcr.1")
417-
418-
crate.annotation(
419-
build_script_tools = [
420-
"@meson//:meson",
421-
"@llvm-project//clang:libclang_interface_output",
422-
"@llvm//:builtin_resource_dir",
423-
"@ninja_1.11.0_linux//:ninja_bin",
424-
"@ninja_1.12.1_linux_aarch64//:ninja_bin",
425-
"@ninja_1.11.0_mac//:ninja_bin",
426-
"@ninja_1.11.0_win//:ninja_bin",
427-
],
428-
build_script_env = {
429-
"BINDGEN_EXTRA_CLANG_ARGS": "-Xclang -internal-isystem -Xclang $(location @llvm//:builtin_resource_dir)/include",
430-
"LIBCLANG_PATH": "$(location @llvm-project//clang:libclang_interface_output)",
431-
"MESON": "$(execpath @meson//:meson)",
432-
},
433-
build_script_env_select = {
434-
"aarch64-apple-darwin": "{\"NINJA_REAL\":\"$(execpath @ninja_1.12.1_linux_aarch64//:ninja_bin)\"}",
435-
"x86_64-apple-darwin": "{\"NINJA_REAL\":\"$(execpath @ninja_1.12.1_linux_aarch64//:ninja_bin)\"}",
436-
"aarch64-unknown-linux-gnu": "{\"NINJA_REAL\":\"$(execpath @ninja_1.11.0_linux//:ninja_bin)\"}",
437-
"x86_64-unknown-linux-gnu": "{\"NINJA_REAL\":\"$(execpath @ninja_1.11.0_linux//:ninja_bin)\"}",
438-
"aarch64-unknown-linux-musl": "{\"NINJA_REAL\":\"$(execpath @ninja_1.11.0_linux//:ninja_bin)\"}",
439-
"x86_64-unknown-linux-musl": "{\"NINJA_REAL\":\"$(execpath @ninja_1.11.0_linux//:ninja_bin)\"}",
440-
"aarch64-pc-windows-msvc": "{\"NINJA\":\"$(execpath @ninja_1.11.0_win//:ninja_bin)\"}",
441-
"x86_64-pc-windows-msvc": "{\"NINJA\":\"$(execpath @ninja_1.11.0_win//:ninja_bin)\"}",
442-
"aarch64-pc-windows-gnullvm": "{\"NINJA\":\"$(execpath @ninja_1.11.0_win//:ninja_bin)\"}",
443-
"x86_64-pc-windows-gnullvm": "{\"NINJA\":\"$(execpath @ninja_1.11.0_win//:ninja_bin)\"}",
444-
},
445-
crate = "webrtc-audio-processing-sys",
446-
gen_build_script = "on",
447-
patch_args = ["-p1"],
448-
patches = [
449-
"//patches:webrtc-audio-processing-sys_meson_env.patch",
450-
"//patches:webrtc-audio-processing-sys_logging_macos_sdk.patch",
451-
],
452-
)
453-
454-
inject_repo(crate, "meson", "ninja_1.11.0_linux", "ninja_1.12.1_linux_aarch64", "ninja_1.11.0_mac", "ninja_1.11.0_win")
455348
bazel_dep(name = "v8", version = "14.6.202.9")
456349
archive_override(
457350
module_name = "v8",

MODULE.bazel.lock

Lines changed: 5 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/Cargo.lock

Lines changed: 52 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ ansi-to-tui = "7.0.0"
197197
anyhow = "1"
198198
arboard = { version = "3", features = ["wayland-data-control"] }
199199
arc-swap = "1.9.0"
200+
aec3 = "0.1.7"
200201
assert_cmd = "2"
201202
assert_matches = "1.5.0"
202203
async-channel = "2.3.1"
@@ -352,7 +353,6 @@ vt100 = "0.16.2"
352353
walkdir = "2.5.0"
353354
webbrowser = "1.0"
354355
webrtc = "0.17.1"
355-
webrtc-audio-processing = { version = "~2.0", features = ["bundled"] }
356356
which = "8"
357357
wildmatch = "2.6.1"
358358
zip = "2.4.2"

codex-rs/tui/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ codex-windows-sandbox = { workspace = true }
112112
tokio-util = { workspace = true, features = ["time"] }
113113

114114
[target.'cfg(not(target_os = "linux"))'.dependencies]
115+
aec3 = { workspace = true }
115116
cpal = "0.15"
116-
webrtc-audio-processing = { workspace = true }
117117

118118
[target.'cfg(unix)'.dependencies]
119119
libc = { workspace = true }

codex-rs/tui/src/app_server_session.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ impl AppServerSession {
155155
}
156156
}
157157

158+
pub(crate) fn with_remote_cwd_override(mut self, remote_cwd_override: Option<PathBuf>) -> Self {
159+
self.remote_cwd_override = remote_cwd_override;
160+
self
161+
}
162+
158163
pub(crate) fn remote_cwd_override(&self) -> Option<&std::path::Path> {
159164
self.remote_cwd_override.as_deref()
160165
}

0 commit comments

Comments
 (0)