Repository navigation
Releases
Releases · cxgit12138/codex-supervisor
v1.4.1 — Activity-Aware Stall Watchdog, Per-Turn Effort Tracking & Sidecar UX Polish
中文更新说明
新增特性
- 活跃度感知卡死检测(
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与非重试错误码枚举)。
- 用双阈值活跃度看门狗替代固定间隔盲目心跳:默认 10 分钟(
- 未
wait模式的后台 Hook / Inbox 看门狗- 当活跃回合未挂载前台
wait时,后台独立看门狗(CODEX_BRIDGE_BG_STALL_SEC=600、CODEX_BRIDGE_BG_MAX_RUN_SEC=1800)会在卡死或触及硬上限时通过既有PreInvocation/Stop钩子与codex-ctl.mjs inbox投递去重后的inboxOnlyturn_watchdog告警(保持高权限固定模板隔离不变)。 - 单回合采用单写告警槽与
fg_timeout_receipt租约确认(auto5s /manual30s),前台 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.1App-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&patchUpdatedschema-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,0disables silence detection) tocodex-ctl.mjs wait, with strict/healthcapabilities.stallWatchdog === truenegotiation and bidirectional compatibility with older v1.4.0 daemons. - Includes sanitized diagnostic metadata (
timeoutReason: "stall" | "max_wait",silentSec,lastActivityKind,lastActivityAt, allowlistedactiveItems, and sanitizedlastNonRetryableError.code) in timeout wakeups andstatussummaries.
- Replaces blind fixed-interval heartbeat polling with dual-threshold activity-aware stall detection: 10 min (
- 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 foregroundwait, delivering deduplicatedinboxOnlyturn_watchdognotifications via existingPreInvocation/Stophooks andcodex-ctl.mjs inbox(keeping the fixed security-isolated hook templates untouched). - Enforces a single-writer alert slot per turn with
fg_timeout_receiptlease confirmation (auto5s /manual30s), seamlessly handing off failed foregroundEPIPEdeliveries to the background inbox without duplicate storms.
- Runs an independent background watchdog (
- Portable 11-Group Watchdog Verification Suite (
tests/verify-watchdog.mjs):- Covers unit scheduling/sanitization, active streaming suppression, silent stall detection,
EPIPEhandoff, multi-waiter slot contention, full-queue self-eviction, turn isolation &0.169.1cancel payloads, unwaited Hook/Inbox delivery,--forcerescheduling, and mixed-version compatibility.
- Covers unit scheduling/sanitization, active streaming suppression, silent stall detection,
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
easeOutQuartbottom push-up scrolling (untouched while reading history; immediately cancellable by wheel/touch/pointer/keyboard), smooth reversiblemax-heightexpand/collapse transitions, andprefers-reduced-motionsupport. - Added exact
itemIdcorrelation (inFlightDraftItemIds/completedMessageItemIds) andactiveTurnFinalizedtracking so streaming drafts settle in-place without replaying entrance animations or flashing brief post-final_answerghost "running" bubbles.
- Replaced native OS
- Sidecar Panel Collapsible Long Bubbles (
sidecars/codex_panel/app.js,styles.css,index.html):- Caps tall non-tool chat bubbles at
260px(with a56pxhysteresis 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.
- Caps tall non-tool chat bubbles at
- Codex
0.169.1App-Server Protocol Hardening:- Strict
threadId + turnIdscoping 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.1retirement/cancel payloads ({ permissions: {}, scope: "turn" }for permissions,{ decision: "abort" }for legacy approvals,{ decision: "cancel" }for v2 approvals,-32602on malformed requests) and distinguishes non-blockingitem/tool/requestUserInput(isBlocking: false). - Upgraded
POST /waitvalidation to strict non-coercing JSON integers and two-phase disconnect cleanup across multi-thread teardown.
- Strict
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), readingreasoningEffortfromthread/start|resume|fork, clearing stale effort on cross-model switches, and preventing same-turn appends or rejectedturn/startresponses from relabeling an already-running turn. - Upgraded sidecar log parsing to a two-pass per-turn index with explicit
effortExplicit/committed/turnConfigAppliedhandling, atomic live-bubble scope resolution, and ETag inclusion ofeffort/lastModelSubso follow-up turns and legacy logs consistently display their true reasoning effort.
- Tracks thread-level
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 advertisingcapabilities.stallWatchdog: true.
v1.4.0 — Between-Turn Hook Notifications & Reliable Inbox Protocol
中文更新说明
新增特性
- 工具轮次间隙自动通知(
hooks.json+hooks/codex-hook.mjs)- 新增插件级
PreInvocation与条件启用的Stop生命周期钩子:即使 Antigravity 未挂wait、正在忙其他任务,也能在下一轮工具间隙自动收到[Codex Supervisor]提醒;准备停机而 Codex 仍在运行且未挂wait时自动兜底提醒一次。 - 高权限系统提示仅使用插件固定模板与计数(零 Codex 原文,防止 Prompt Injection 提权),实际正文由
codex-ctl.mjs inbox按普通工具输出读取。 - 采用按
instanceId隔离的标记文件快路径(无未读时 0 HTTP 开销)、PID 存活探测(规避 Windows 死端口重试延迟)、最小权限hook-daemon.json与全链路 Fail-Open。
- 新增插件级
- 可靠 Inbox 与租约确认协议(
codex-ctl.mjs inbox/inbox ack)- 新增
/inbox、/inbox/ack、/hook/poll接口及inbox [threadId] [--limit N] [--no-ack]、inbox ack <batchId>子命令。 - 非阻塞/终态关键事件无条件入独立有界队列,配备单调缺口水位与 30s 统一租约(
/inbox与/wait共用签批,CLI 完整写出 stdout 后自动确认,支持--no-ack手动确认),单页严格 ≤16 KiB 且防多线饿死。
- 新增
- 严格自动通知路由与显式接管(
resume --claim)- 按
ANTIGRAVITY_CONVERSATION_ID自动路由通知,跨线程 idle 驱逐持久化归属;wait/send/steer不隐式抢占归属,跨会话接管需对干净线程显式执行resume <threadId> --claim。
- 按
- 可移植 26 组 E2E 自动化测试(
tests/verify-hooks-e2e.mjs)- 一键运行
node tests/verify-hooks-e2e.mjs回归并发、租约、16 KiB 分页、Prompt Injection 隔离与 Windows ACL 边界。
- 一键运行
改进与加固
- Windows 状态目录权限加固升级为纯 .NET SID 校验 + 静态脚本环境变量传参 + 全深度祖先/后代
ReparsePoint校验;Windows 单实例互斥升级为基于物理目录身份的独占命名管道内核锁。 - 调整
SUPERVISOR_DEV_INSTRUCTIONS,允许在监工 prompt 明确要求时响应调用message_supervisor(日常操作仍保持静默克制)。 codex-ctl.mjs不再预建状态目录,并即时透传 daemon 早期启动报错。
升级注意
- 更新后请重启一次 Antigravity 客户端,确保宿主重新注册根目录
hooks.json与 Sidecar。 - 若升级前已有旧版
bridge-daemon.mjs在运行,待当前任务完成后执行一次codex-ctl.mjs stop即可切换至v1.4.0守护进程。
English Release Notes
Added
- Between-Turn Automatic Hook Notifications (
hooks.json,hooks/codex-hook.mjs): BundlesPreInvocationand conditionalStophooks so Antigravity receives fixed-template[Codex Supervisor]reminders between tool turns even without an activewait(zero Codex free text in high-privilege system messages, zero-HTTP fast path via per-instance flag files, isolatedhook-daemon.jsonwithhookToken, strict fail-open). - Reliable Inbox & Lease/ACK Protocol (
codex-ctl.mjs inbox,inbox ack): Unconditionally buffers target non-blocking/terminal events with monotonic overflow watermarks, unified 30s batch leases across/inboxand/wait, strict 16 KiB / 10-thread pagination, and stdout-complete auto-ACK (optional--no-ackfor manual confirmation). - Strict Auto-Notification Routing & Explicit Ownership Transfer (
resume --claim): Routes notifications byANTIGRAVITY_CONVERSATION_ID, preserves ownership across idle thread eviction, and prevents implicit hijacking onwait/send/steer. - Portable 26-Scenario E2E Suite (
tests/verify-hooks-e2e.mjs): Runnode tests/verify-hooks-e2e.mjswith zero external dependencies.
Changed
- Hardened Windows ACL verification via pure .NET
SecurityIdentifierAPIs with static PowerShell env-var data passing, full ancestor/descendantReparsePointchecks, and a physical-identity exclusive named-pipe kernel mutex. - Updated
SUPERVISOR_DEV_INSTRUCTIONSso explicit supervisor requests to callmessage_supervisorare honored while keeping routine narration quiet. - Added CHANGELOG.md and release/upgrade instructions in
README.md.
Upgrade Notes
- Restart Antigravity once after upgrading so
hooks.jsonand the Sidecar panel register cleanly. - If an older bridge daemon is running, run
codex-ctl.mjs stopafter current tasks finish to switch to the v1.4.0 daemon.