Skip to content

mushan-bit/codex-auto-retry

v1.0.0MIT

A local Codex companion that watches for capacity errors and safely retries them.

Changelog

1.0.0 — 2026-10-30

First public release.

  • Open-sourced under the MIT license.
  • Bilingual documentation (English by default, with README.zh-CN.md), project logo, real screenshots of the capacity banner, badge-state artwork, and a rendered pulse animation preview.
  • Menu bar control: toggle Auto, show/hide the floating badge, current state, lifetime retry count and reset, Accessibility shortcuts, and quit; the status item title carries the lifetime count.
  • Every triggered retry posts a system notification and plays a pulse ring on the floating badge.
  • The floating badge can be hidden and the choice is remembered; the menu bar always brings it back.
  • Lifetime retry counter persisted in retry-count.json.
  • Verified retry clicks (a click counts only after the banner disappears), with a 5-attempt cap and automatic pause instead of blind clicking.

0.6.0 — 2026-10-30

  • Added a menu bar icon: toggle Auto, show/hide the floating badge, see the current state and lifetime retry count, reset the count, open Accessibility settings, and quit. The icon title shows the lifetime retry count and its symbol reflects the current state.
  • The floating badge can be hidden from either the badge menu or the menu bar and the choice is remembered across launches; the menu bar can always bring it back.
  • Every triggered retry now posts a system notification (UNUserNotificationCenter) and plays a pulse-ring animation on the floating badge.
  • Retries are counted for the lifetime of the install in retry-count.json, shown in the menu bar, the badge tooltip, the badge menu, and the menu bar menu.
  • Added --menu-probe and --badge-preview diagnostics for verifying the menu bar item and the pulse animation.

0.5.5 — 2026-10-30

  • Root cause of "retry button was clicked but nothing happened": Chromium keeps its web accessibility tree in a lazy mode where the 重试 element exposes no AXPress action and ignores synthetic clicks. The companion now announces itself as an accessibility client (AXManualAccessibility/AXEnhancedUserInterface) before scanning and re-announces while the retry element still lacks AXPress. With the full tree the button exposes AXPress and pressing it really starts the retry (verified on a live capacity banner: the banner cleared and Codex wrote a new turn and task_complete).
  • The verified-click flow therefore succeeds on the first attempt in the common case, without stealing focus.

0.5.4 — 2026-10-30

  • Retry clicking now has a last-resort stage that posts a real system-wide mouse click at the banner button's screen point after raising Codex, then restores the previously frontmost app; this is the only mechanism observed to reach the web button.
  • An ineffective click pauses the watcher only after five attempts (about a minute of backoff) instead of three, so a single hiccup no longer looks like "it enabled and paused itself".
  • Badge status is now Chinese and includes the reason, e.g. 监控中 · 已重试 2 次 · 点击无效,Codex 没有响应; when paused the menu already shows 开启 Auto.
  • Log/docs mention why right-click "开启 Auto" can look ineffective: the watcher starts, then pauses itself because the click really had no effect.

0.5.3 — 2026-10-30

  • Fixed the click itself: Codex's “重试” element exposes only AXShowMenu/AXScrollToVisible, so AXPress reported success while Chromium did nothing and every retry was a silent no-op. The companion now falls back to posting a real mouse click into the Codex process, without stealing focus.
  • A retry now counts only when the banner actually disappears; otherwise the event log says retry click had no effect, and three ineffective clicks pause the watcher instead of pretending to work.
  • Retry labels are matched exactly: labels like codex-auto-retry, Start Codex Auto Retry or Auto Retry are no longer mistaken for the retry button.
  • A retry makes the banner blink; the attempt counter now requires the banner to stay gone for 15 s before resetting, so the 5-attempt limit still applies.
  • Added --press-probe and --click-probe diagnostics that report the matched element's role/actions/frame and which click mechanism changes the UI.

0.5.2 — 2026-10-30

  • Fixed the core auto-retry: the capacity banner button is localized (“重试”), but the matcher only accepted the English title Retry, so nothing was ever clicked. Retry labels are now matched across the languages Codex ships.
  • The watcher no longer requires Codex to be frontmost, which is when auto retry matters most. It scans a running Codex window in the background (0.5 s while frontmost, 1 s otherwise).
  • AX scanning is ~3x cheaper: batched attribute reads, menu-bar subtrees skipped, only app windows scanned.
  • The capacity error matcher is shared between the retry decision and the region selector, so extra whitespace/line breaks in the banner still match.
  • Added --dump-ax <path> to inspect the live Codex Accessibility tree and see why a banner is or is not recognized.

0.5.1 — 2026-10-29

  • Fixed the badge glyphs: SF Symbols were drawn as untinted template images, so the running/paused/error icons rendered black on the dark badge. They now use a palette symbol configuration (green running, yellow paused, blue retrying, red error) and the idle dot is light gray instead of dark.
  • Added rendering tests that sample the badge icon pixels so a black/invisible glyph fails the suite.

0.5.0 — 2026-10-29

  • Fixed "accessibility permission granted but still not permitted". macOS grants Accessibility to a process's responsible process: the MCP server used to spawn the companion directly, so TCC attributed the permission to Codex and ignored the grant on Codex Auto Retry. The server now launches Codex Auto Retry.app through LaunchServices (open -n -g ... --args), so the app owns its TCC identity.
  • Added an IPC quit command so a LaunchServices-launched companion still exits with the MCP server.
  • Added responsible-process diagnostics to the menu and status payload; the badge now names the app that must be granted when it inherits one.
  • Added --diagnose <path> to dump trusted / selfAttributed / responsibleApp without opening the UI.
  • Pinned the codesign identity in .signing-identity so rebuilds stop changing the TCC code requirement and silently invalidating the Accessibility grant; also accept Developer ID Application identities and warn when the identity changes.
  • Fall back to the bare binary with a warning when no app bundle is installed.
  • Detect stale companion sockets (crashed app) and relaunch instead of failing forever with ECONNREFUSED.
  • The companion now exits within 5s of its MCP server disappearing (--server-pid watchdog), and cleanup falls back to killing only its own instance when an older app does not understand the IPC quit command.
  • Resolve the private responsibility SPI through dlsym so the app still launches if macOS removes the symbol.

0.4.3 — 2026-10-29

  • Rechecked Accessibility trust through AXIsProcessTrustedWithOptions and the system accessibility change notification instead of relying on a stale process result.
  • Preserved the installed App's development signing identity when rebuilding, so TCC permissions continue to match updates.
  • Fixed SF Symbol template rendering so the warning icon uses the requested yellow color.

0.4.2 — 2026-10-29

  • Restored the original outer ring colors while keeping the Accessibility warning symbol yellow for contrast.

0.4.1 — 2026-10-29

  • Added state colors to the floating badge icon; the Accessibility warning icon is now yellow for better contrast.

0.4.0 — 2026-10-29

  • Added an automatic Accessibility permission prompt and direct link to the macOS Accessibility settings page.
  • Added live permission polling and a clear “permission granted” status in the floating badge menu.
  • Signed the App bundle with a stable local development identity when one is available, avoiding permission identity drift after rebuilds.

0.3.0 — 2026-10-29

  • Added an AppIcon asset to the macOS app bundle.
  • Replaced the titled panel with a translucent draggable circular status badge and a right-click control menu.

0.2.1 — 2026-10-29

  • Fixed panel close behavior so closing the window also terminates the companion process and cleans up its IPC socket.

0.2.0 — 2026-10-29

  • Added a native close button to the floating companion panel.
  • Added standard macOS .app, .pkg, and .dmg build artifacts for the companion.
  • Fixed the panel close button so it explicitly closes and can be reopened by auto_retry.start.

0.1.0 — 2026-10-29

  • Added a local stdio MCP plugin with start, pause, status, and stop tools.
  • Added a macOS Accessibility supervisor with a bottom-right floating Auto panel.
  • Added capacity-error matching, exponential backoff, five-attempt limit, redacted logs, and local marketplace installation.
  • Known limitation: Codex UI accessibility labels and Retry text may change between releases.