fix(aiden): aiden x codex 不再重复透传 --dangerously-bypass-hook-trust(启动即挂) - #717
Merged
Conversation
aiden 网关自身已给底层 codex 注入 --dangerously-bypass-hook-trust,而 botmux 的 codex 适配器(受全局开关 bypassCodexHookTrust 控制,默认开)也会注入同一个 flag,转发时 stripWrapperUnsafeArgs 只剥了 --settings 和 botmux 注入的 -c,没剥 这个 flag → codex 收到两份 → clap 报 "the argument '--dangerously-bypass-hook-trust' cannot be used multiple times",进程直接退出。 在同一个 choke point(stripWrapperUnsafeArgs)对 aiden 网关额外剥掉 botmux 注入 的这份副本(aiden 自己那份保留,语义不变),保持 codex 适配器 wrapper-无关;一处 改动覆盖 spawn / reproduce-command / 本地终端三个 buildWrappedLaunch 调用点。 影响面:只作用于 aiden 网关。aiden x claude 底层从不注入此 flag(no-op);直连 codex / cjadk codex / ttadk / traex 都不走这条路径,仍是单份 flag,无回归。关掉 「自动信任 Codex Hook」或受限 bot:codex 侧本就不注入,剥除是空操作。 验证:pnpm build 绿;test/cli-selection.test.ts 73 项全过(新增 2 项回归,已 stash 验证去掉修复必挂)。 Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
aiden x codex会话启动即挂,报:根因
aiden x codex是 wrapperCli,底层cliId=codex。codex 适配器buildArgs会注入--dangerously-bypass-hook-trust(受全局开关「自动信任 Codex Hook」bypassCodexHookTrust控制,默认开)。stripWrapperUnsafeArgs,它只剥了 aiden 拒收的--settings(claude 侧)和 botmux 注入的 codex-coverride,没剥这个 flag → codex 收到两份 → clap 报错、进程直接退出。botmux 全仓只在
codex.ts:190注入这一份(traex.ts那份走的是 traex,不经 aiden),第二份确定来自 aiden launcher。修法
在同一个 choke point
stripWrapperUnsafeArgs(就是当初剥 aiden 拒收-c的地方)对 aiden 网关额外剥掉 botmux 注入的这份--dangerously-bypass-hook-trust(aiden 自己那份保留,语义不变)。保持 codex 适配器 wrapper-无关;一处改动同时覆盖buildWrappedLaunch的三个调用点:spawn、reproduce-command、本地终端。影响面
buildWrappedLaunch里 cjadk 走 rewrite、ttadk 走自己分支、plain 原样透传,都不进此函数)。aiden x claude:底层 claude-code 从不注入此 flag → 剥除是 no-op。disableCliBypass):codex 侧本就不注入,剥除是空操作。验证
pnpm build绿test/cli-selection.test.ts73 项全过(新增 2 项回归:stripWrapperUnsafeArgs单元 +buildWrappedLaunch端到端)git stash验证:去掉本修复,新增 2 项回归必挂 → 确实守住了这个 bug🤖 Generated with Claude Code