Route TUI realtime audio through shared echo cancellation

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Ahmed Ibrahim
2026-04-05 13:00:28 -07:00
parent 8207ff6ead
commit 90f10e9ab9
15 changed files with 1112 additions and 333 deletions

View File

@@ -0,0 +1,30 @@
#!/bin/sh
set -eu
real_ninja="${NINJA_REAL:?NINJA_REAL must point to the downloaded ninja binary}"
try_exec() {
candidate_dir="$1"
[ -n "${candidate_dir}" ] || return 1
[ -d "${candidate_dir}" ] || return 1
staged_dir="$(mktemp -d "${candidate_dir%/}/codex-ninja.XXXXXX" 2>/dev/null)" || return 1
staged_ninja="${staged_dir}/ninja"
if cp "${real_ninja}" "${staged_ninja}" 2>/dev/null \
&& chmod +x "${staged_ninja}" 2>/dev/null \
&& "${staged_ninja}" --version >/dev/null 2>&1; then
exec "${staged_ninja}" "$@"
fi
rm -rf "${staged_dir}"
return 1
}
for candidate_dir in "${CODEX_NINJA_TMPDIR:-}" /private/var/tmp /var/tmp "${TMPDIR:-}" /tmp "${HOME:-}"; do
try_exec "${candidate_dir}"
done
echo "codex ninja wrapper: unable to stage an executable Ninja binary" >&2
exit 1