Skip to content

v1.4.1 — Activity-Aware Stall Watchdog, Per-Turn Effort Tracking & Sidecar UX Polish

Latest

Choose a tag to compare

@cxgit12138 cxgit12138 released this 27 Nov 16:09

中文更新说明

新增特性

  • 活跃度感知卡死检测(watchdog-core.mjs、bridge-daemon.mjs、codex-ctl.mjs)
    • 用双阈值活跃度看门狗替代固定间隔盲目心跳:默认 10 分钟(600s)静默卡死阈值 + 30 分钟(1800s)硬上限保底。
    • 基于三正交单调时钟(performance.now():turnRunningSince / lastProgress / lastDeliveredContact)追踪 Codex 真实执行进展(item/started、item/completed、流式输出增量、schema 级有界 plan/updated 与 patchUpdated 摘要、阻塞审批/提问),每次确认唤醒后自动刷新计时。
    • codex-ctl.mjs wait 新增 --stall-timeout <sec>(0..1800,0 禁用静默检测),通过 /health 严格协商 capabilities.stallWatchdog === true 并保持与旧版 v1.4.0 守护进程双向兼容。
    • 超时唤醒与 /status 摘要附带脱敏诊断字段(timeoutReason: "stall" | "max_wait"、silentSec、lastActivityKind、lastActivityAt、白名单 activeItems 与非重试错误码枚举)。
  • 未 wait 模式的后台 Hook / Inbox 看门狗
    • 当活跃回合未挂载前台 wait 时,后台独立看门狗(CODEX_BRIDGE_BG_STALL_SEC=600、CODEX_BRIDGE_BG_MAX_RUN_SEC=1800)会在卡死或触及硬上限时通过既有 PreInvocation / Stop 钩子与 codex-ctl.mjs inbox 投递去重后的 inboxOnly turn_watchdog 告警(保持高权限固定模板隔离不变)。
    • 单回合采用单写告警槽与 fg_timeout_receipt 租约确认(auto 5s / manual 30s),前台 CLI 遭遇 EPIPE 时无缝降级到后台 Inbox,避免漏报或重复刷屏。
  • 可移植 11 组卡死检测自动化测试(tests/verify-watchdog.mjs)
    • 覆盖纯调度单元测试、持续流式输出防误报、静默卡死唤醒、EPIPE 降级、多 waiter 槽位竞争、满队自驱逐、回合隔离与 0.169.1 精确取消载荷、Hook 后台注入与混合版本兼容矩阵。

侧边栏体验与协议优化

  • 自定义会话下拉菜单与弹性动效(sidecars/codex_panel/*、bridge-daemon.mjs)
    • 用自定义美化无障碍下拉面板替代原生 <select>:内置实时状态圆点、动态相对时间、工作区/模型/条数双行信息、完整键盘导航与矮视口限高,轮询期不关闭菜单且保留焦点与滚动位置。
    • 改为 O(1) 增量 DOM 追加(隐藏工具写日志不影响可见列表时直接跳过 DOM 重建,消除渐隐行闪动),新增 GPU 合成方向性弹性弹入动画、吸底时同步 easeOutQuart 平滑上推(查看历史时绝不打扰,滚轮/点击/键盘即刻接管)与平滑可逆高度展开/收起过渡,并尊重 prefers-reduced-motion。
    • 通过精确 itemId 关联(inFlightDraftItemIds / completedMessageItemIds)与 activeTurnFinalized 追踪,实现流式草稿原地无缝定型(不二次弹出),并消除 final_answer 落盘到 turn/completed 短暂窗口中的幽灵「执行中」气泡。
  • 长消息气泡自动折叠
    • 对非工具类超长气泡限制 260px 显示高度(含 56px 防尴尬滞后余量),配合按气泡底色自适应的渐隐遮罩与极简 显示更多 / 收起 按钮(无气泡内滚动条、记忆展开态与键盘焦点、收起防跳屏锚定)。
  • Codex 0.169.1 App-Server 协议加固
    • 严格 threadId + turnId 隔离防过期/被取代回合复活;强制服务端请求单回复权与精确 0.169.1 取消载荷,区分非阻塞 item/tool/requestUserInput;POST /wait 采用严格非隐式转换 JSON 整数校验与两阶段多线断连清理。

问题修复

  • 多轮会话推理强度(effort)跟踪与侧边栏显示修复
    • 分离线程级 (model, effort) 与活跃回合快照(activeTurnModel / activeTurnEffort),从 thread/start|resume|fork 提取 reasoningEffort,跨模型切换清零旧 effort,防止同回合追加输入或被拒 turn/start 覆写进行中回合标签。
    • 侧边栏日志解析升级为两遍扫描按回合索引(解决乱序到达与历史日志后续轮次丢失 effort 显示问题),live 气泡按作用域原子解析并将 effort / lastModelSub 纳入 ETag。

升级注意

  • 若升级前已有旧版 bridge-daemon.mjs 在运行,待当前任务完成后执行一次 codex-ctl.mjs stop(并按需重启一次 Antigravity 加载新版 Sidecar 面板)即可切换至 v1.4.1。

English Release Notes

Added

  • Activity-Aware Stall Watchdog (watchdog-core.mjs, bridge-daemon.mjs, codex-ctl.mjs):
    • Replaces blind fixed-interval heartbeat polling with dual-threshold activity-aware stall detection: 10 min (600s) silence stall threshold + 30 min (1800s) hard ceiling by default.
    • Tracks real Codex progress (item/started, item/completed, streaming text/reasoning/command/file deltas, plan/updated & patchUpdated schema-bounded digests, and blocking approvals/questions) using three orthogonal monotonic (performance.now()) clocks (turnRunningSince, lastProgress, lastDeliveredContact) that refresh cleanly after every confirmed supervisor wakeup.
    • Added --stall-timeout <sec> (0..1800, 0 disables silence detection) to codex-ctl.mjs wait, with strict /health capabilities.stallWatchdog === true negotiation and bidirectional compatibility with older v1.4.0 daemons.
    • Includes sanitized diagnostic metadata (timeoutReason: "stall" | "max_wait", silentSec, lastActivityKind, lastActivityAt, allowlisted activeItems, and sanitized lastNonRetryableError.code) in timeout wakeups and status summaries.
  • Unwaited Hook / Inbox Background Watchdog:
    • Runs an independent background watchdog (CODEX_BRIDGE_BG_STALL_SEC=600, CODEX_BRIDGE_BG_MAX_RUN_SEC=1800) for active turns with no attached foreground wait, delivering deduplicated inboxOnly turn_watchdog notifications via existing PreInvocation / Stop hooks and codex-ctl.mjs inbox (keeping the fixed security-isolated hook templates untouched).
    • Enforces a single-writer alert slot per turn with fg_timeout_receipt lease confirmation (auto 5s / manual 30s), seamlessly handing off failed foreground EPIPE deliveries to the background inbox without duplicate storms.
  • Portable 11-Group Watchdog Verification Suite (tests/verify-watchdog.mjs):
    • Covers unit scheduling/sanitization, active streaming suppression, silent stall detection, EPIPE handoff, multi-waiter slot contention, full-queue self-eviction, turn isolation & 0.169.1 cancel payloads, unwaited Hook/Inbox delivery, --force rescheduling, and mixed-version compatibility.

Changed

  • Sidecar Panel UX Polish: Custom Session Picker, Spring Animations & Seamless Streaming (sidecars/codex_panel/*, bridge-daemon.mjs):
    • Replaced native OS <select> with a custom accessible session dropdown featuring live status dots, dynamic relative timestamps, two-line workspace/model/count metadata, full keyboard navigation, viewport height clamping, and poll-stable menu focus/scroll.
    • Added O(1) incremental DOM bubble appends (skipping redundant DOM rebuilds when hidden tool writes don't affect visible messages), GPU-composited directional spring pop-in animations, synchronized easeOutQuart bottom push-up scrolling (untouched while reading history; immediately cancellable by wheel/touch/pointer/keyboard), smooth reversible max-height expand/collapse transitions, and prefers-reduced-motion support.
    • Added exact itemId correlation (inFlightDraftItemIds / completedMessageItemIds) and activeTurnFinalized tracking so streaming drafts settle in-place without replaying entrance animations or flashing brief post-final_answer ghost "running" bubbles.
  • Sidecar Panel Collapsible Long Bubbles (sidecars/codex_panel/app.js, styles.css, index.html):
    • Caps tall non-tool chat bubbles at 260px (with a 56px hysteresis buffer so short overflows stay natural) using a theme-aware bottom fade mask and a minimalist 显示更多 / 收起 toggle with zero inner scrollbars.
    • Preserves expanded bubble state and keyboard focus across poll re-renders, anchors scroll cleanly on collapse (keeping the toggle visible in short viewports), links buttons via aria-controls, and adapts smoothly to panel width/height resizes.
  • Codex 0.169.1 App-Server Protocol Hardening:
    • Strict threadId + turnId scoping prevents late notifications or superseded turns from resurrecting completed turns or poisoning active stall timers.
    • Enforces single-reply authority on server requests with exact 0.169.1 retirement/cancel payloads ({ permissions: {}, scope: "turn" } for permissions, { decision: "abort" } for legacy approvals, { decision: "cancel" } for v2 approvals, -32602 on malformed requests) and distinguishes non-blocking item/tool/requestUserInput (isBlocking: false).
    • Upgraded POST /wait validation to strict non-coercing JSON integers and two-phase disconnect cleanup across multi-thread teardown.

Fixed

  • Per-Turn Reasoning Effort Tracking & Sidecar Display (bridge-daemon.mjs, sidecars/codex_panel/main.mjs, sidecars/codex_panel/app.js):
    • Tracks thread-level (model, effort) separately from active-turn snapshots (activeTurnModel, activeTurnEffort), reading reasoningEffort from thread/start|resume|fork, clearing stale effort on cross-model switches, and preventing same-turn appends or rejected turn/start responses from relabeling an already-running turn.
    • Upgraded sidecar log parsing to a two-pass per-turn index with explicit effortExplicit/committed/turnConfigApplied handling, atomic live-bubble scope resolution, and ETag inclusion of effort / lastModelSub so follow-up turns and legacy logs consistently display their true reasoning effort.

Upgrade Notes

  • Finish active tasks and run codex-ctl.mjs stop (and restart Antigravity once to reload the updated Sidecar panel) so the bridge restarts on the v1.4.1 daemon advertising capabilities.stallWatchdog: true.