fix: defer Hermes first prompt timeout - #340
Merged
deepcoldy merged 2 commits intoJul 2, 2026
Merged
Conversation
supportsTypeAhead 不只是让 90s 硬顶能 flush——它还让 mid-turn 消息 立即写入 PTY,前提是 Hermes 忙碌时不丢输入。把这个契约、上游依据 (TUI non-blocking input / prompt_toolkit tty type-ahead)和出问题时 先查这个 flag 的排查指引写进注释,对齐 codex/coco/traex 的既有惯例。
deepcoldy
pushed a commit
that referenced
this pull request
Jul 2, 2026
#340 的 supportsTypeAhead 引入回归:Hermes 冷启动 2-3 分钟超过 90s first-prompt 硬顶,硬顶强制释放对 type-ahead 适配器直接 flushPending(),把排队的首条消息打进还在初始化的 TUI——输入被静默吞掉,卡片卡在「运行中」(作者实测复现)。 移除 supportsTypeAhead、保留 deferFirstPromptTimeoutUntilReady:首条消息排队至真实 ❯ composer 出现(markPromptReady)才投递,90s 硬顶只解锁截屏不再打字。代价是 readyPattern 失效时首条消息会等待(回到 #340 前行为)——用「可能等待」换掉「确定吞消息」。后续如需兜底应做 Hermes 专属 ready signal/busyPattern,而非恢复 type-ahead。
deepcoldy
pushed a commit
that referenced
this pull request
Jul 3, 2026
Hermes 无 claude 式 settings/hooks 注入面、❯ 屏幕检测在启动屏有假命中前科(#340/#342),改为显式真就绪信号: - hermes 适配器设 injectsReadyHook,worker 对此类适配器注入 BOTMUX_READY_COMMAND env(= node cli.js session-ready),Hermes 在 prompt_toolkit composer 真渲染后 shell 执行它 - tmux 后端 env 白名单透传该 key(会话定位靠已白名单的 BOTMUX_SESSION_ID / BOTMUX_LARK_APP_ID) - session_ready 释放 ready-gate 后经 PTY settle 走 markPromptReady(权威就绪);45s 超时 fallback 保持保守语义(只开闸不强标就绪) - review 修复(Claude):ReadyGate.receive() 一次性语义会让 45s fallback 吞掉冷启动 2-3 分钟 Hermes 的迟到真信号,机制在目标场景失效——session_ready 现在检测 late-after-fallback,首轮(awaitingFirstPrompt)直接兑现 markPromptReady;clear/compact 中途信号保持 no-op 降级安全:不支持该 env 的旧 Hermes 退回 ❯ 检测路径,无回归。跨仓库契约(Hermes shell 执行该 env)由作者侧 Hermes 实现保证。 Codex 独立二审通过(lateAfterFallback 取值时机、awaitingFirstPrompt 守卫、settle 并发窗口幂等均核验;294/294 + 22/22 + tsc 绿)。
deepcoldy
added a commit
that referenced
this pull request
Jul 29, 2026
去掉 hermes 适配器的 injectsReadyHook,回到 ❯ readyPattern 检测,消除 45s ready-gate 死等。 根因:#353 假设 Hermes 会 shell 执行 BOTMUX_READY_COMMAND(跨仓库契约),但线上 v0.18.2 从未兑现,信号永不发→worker 空等满 45s fallback 才放行(真 ❯ 输入框 ~3.6s 就出现)。保留 deferFirstPromptTimeoutUntilReady(首条排队到真 ❯,90s 硬顶),不开 type-ahead(#342 静默吞消息风险仍被挡)。 影响面:只动 hermes 单适配器 + 陈旧注释,worker.ts diff 纯注释;claude-code/grok 有真 hookInstall 不受影响。 Review:Claude 首审 + Codex 复审收敛,default skin 冷启动 45s→~8s 严格净改善;非 ❯ skin 的 90s 交付是 #340 起既有局限(非本 PR 回归),skin-independent 就绪检测列 follow-up。合当前 master 无冲突、build 绿、411 单测过(codex 追加全量 11093 passed)。 Co-Authored-By: 申晗 <xu4wang@gmail.com> Co-Authored-By: Riff <noreply@riff.dev>
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.
No description provided.