[codex] 修复 Codex 冷启动首条消息误判裸壳#352
Draft
anarkh wants to merge 1 commit into
Draft
Conversation
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.
Summary
deferFirstPromptTimeoutUntilReady,首条消息会等到 readyPattern 或硬超时再 flushRoot Cause
Codex 冷启动可能超过 worker 的 15s soft first-prompt timeout。超时触发 flush 后,裸壳保护会检查 pane 当前进程;此时 zsh wrapper 仍未进入 Codex composer,导致 botmux 误报“Codex 没真正跑起来”,并阻止首条消息写入。
Impact
入群自动开工或新会话冷启动时,首条 Lark 消息不会因为 Codex 启动慢被误判为裸 shell 失败。
Validation
PATH="/Users/bytedance/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Users/bytedance/.cache/codex-runtimes/codex-primary-runtime/dependencies/bin:$PATH" pnpm vitest run --project unit test/cli-adapters.test.tsPATH="/Users/bytedance/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Users/bytedance/.cache/codex-runtimes/codex-primary-runtime/dependencies/bin:$PATH" pnpm build