Skip to content

Commit 5f8944f

Browse files
committed
Add native macOS quota widget
1 parent 1991909 commit 5f8944f

25 files changed

Lines changed: 1331 additions & 230 deletions

CodexHelper.xcodeproj/project.pbxproj

Lines changed: 492 additions & 0 deletions
Large diffs are not rendered by default.

CodexHelper.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1430"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
runPostActionsOnFailure = "NO">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "6D0C8BB10656508755A8F7E5"
19+
BuildableName = "CodexHelper.app"
20+
BlueprintName = "CodexHelper"
21+
ReferencedContainer = "container:CodexHelper.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
<BuildActionEntry
25+
buildForTesting = "YES"
26+
buildForRunning = "YES"
27+
buildForProfiling = "YES"
28+
buildForArchiving = "YES"
29+
buildForAnalyzing = "YES">
30+
<BuildableReference
31+
BuildableIdentifier = "primary"
32+
BlueprintIdentifier = "F6F197AAF7B62CC6FB92971A"
33+
BuildableName = "CodexHelperWidget.appex"
34+
BlueprintName = "CodexHelperWidget"
35+
ReferencedContainer = "container:CodexHelper.xcodeproj">
36+
</BuildableReference>
37+
</BuildActionEntry>
38+
</BuildActionEntries>
39+
</BuildAction>
40+
<TestAction
41+
buildConfiguration = "Debug"
42+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
43+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
44+
shouldUseLaunchSchemeArgsEnv = "YES"
45+
onlyGenerateCoverageForSpecifiedTargets = "NO">
46+
<MacroExpansion>
47+
<BuildableReference
48+
BuildableIdentifier = "primary"
49+
BlueprintIdentifier = "6D0C8BB10656508755A8F7E5"
50+
BuildableName = "CodexHelper.app"
51+
BlueprintName = "CodexHelper"
52+
ReferencedContainer = "container:CodexHelper.xcodeproj">
53+
</BuildableReference>
54+
</MacroExpansion>
55+
<Testables>
56+
</Testables>
57+
</TestAction>
58+
<LaunchAction
59+
buildConfiguration = "Debug"
60+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
61+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
62+
launchStyle = "0"
63+
useCustomWorkingDirectory = "NO"
64+
ignoresPersistentStateOnLaunch = "NO"
65+
debugDocumentVersioning = "YES"
66+
debugServiceExtension = "internal"
67+
allowLocationSimulation = "YES">
68+
<BuildableProductRunnable
69+
runnableDebuggingMode = "0">
70+
<BuildableReference
71+
BuildableIdentifier = "primary"
72+
BlueprintIdentifier = "6D0C8BB10656508755A8F7E5"
73+
BuildableName = "CodexHelper.app"
74+
BlueprintName = "CodexHelper"
75+
ReferencedContainer = "container:CodexHelper.xcodeproj">
76+
</BuildableReference>
77+
</BuildableProductRunnable>
78+
<CommandLineArguments>
79+
</CommandLineArguments>
80+
</LaunchAction>
81+
<ProfileAction
82+
buildConfiguration = "Release"
83+
shouldUseLaunchSchemeArgsEnv = "YES"
84+
savedToolIdentifier = ""
85+
useCustomWorkingDirectory = "NO"
86+
debugDocumentVersioning = "YES">
87+
<BuildableProductRunnable
88+
runnableDebuggingMode = "0">
89+
<BuildableReference
90+
BuildableIdentifier = "primary"
91+
BlueprintIdentifier = "6D0C8BB10656508755A8F7E5"
92+
BuildableName = "CodexHelper.app"
93+
BlueprintName = "CodexHelper"
94+
ReferencedContainer = "container:CodexHelper.xcodeproj">
95+
</BuildableReference>
96+
</BuildableProductRunnable>
97+
</ProfileAction>
98+
<AnalyzeAction
99+
buildConfiguration = "Debug">
100+
</AnalyzeAction>
101+
<ArchiveAction
102+
buildConfiguration = "Release"
103+
revealArchiveInOrganizer = "YES">
104+
</ArchiveAction>
105+
</Scheme>

MARKETING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## One-line description
44

5-
**EN:** An open-source macOS menu bar companion for Codex. Safely continue capacity-interrupted tasks, see account limits, and keep up with official updates and docs.
5+
**EN:** An open-source macOS companion for Codex. See quota in a native widget or floating rail, and safely continue capacity-interrupted tasks.
66

7-
**中文:** 一个开源的 Codex macOS 菜单栏辅助工具:模型暂时满载时安全续跑原任务,随手查看额度、官方动态与文档
7+
**中文:** 一个开源的 Codex macOS 辅助工具:用原生小组件或悬浮轨道查看额度,并在模型满载时安全续跑原任务
88

99
## GitHub description
1010

@@ -25,7 +25,7 @@ So I built **Codex Helper**. Auto Retry watches for that exact failure, waits wi
2525
- No project-file access
2626
- English + 中文
2727
- Built-in end-to-end test
28-
- Always-visible Codex quota + full dashboard
28+
- Native macOS widget + optional floating rail
2929
- Official Codex updates + docs
3030
- Signed in-app updates
3131
- MIT licensed
@@ -43,7 +43,7 @@ Codex 又因为“所选模型已满载”停住了,于是我做了 **Codex He
4343
- 不读取项目文件
4444
- 中英文支持
4545
- 内置端到端验证
46-
- 菜单栏常驻额度 + 完整主页面
46+
- 原生 macOS 小组件 + 可选悬浮轨道
4747
- Codex 官方动态与文档入口
4848
- 签名校验的应用内更新
4949
- MIT 开源
@@ -58,7 +58,7 @@ Temporary model capacity should be a pause, not the end of an agent task.
5858

5959
**Codex Helper** is a native macOS menu bar companion. Auto Retry handles one frustrating edge case: `Selected model is at capacity. Please try a different model.` It tails the local Codex log, identifies the affected visible task, and schedules up to six retries with progressive backoff. Before every retry it checks the task session for newer user or turn activity, so it backs off if you already handled the problem yourself.
6060

61-
When safe, it opens the original Codex task, submits a localized continuation message, and restores the app you were using. There is no cloud backend, telemetry, project-file access, or Codex binary modification.
61+
When safe, it opens the original Codex task, submits a localized continuation message, and restores the app you were using. A native macOS widget, menu bar item, and optional floating rail keep remaining quota visible. There is no cloud backend, telemetry, project-file access, or Codex binary modification.
6262

6363
The project is deliberately small, auditable, bilingual, and MIT licensed.
6464

@@ -68,6 +68,6 @@ The project is deliberately small, auditable, bilingual, and MIT licensed.
6868

6969
**Codex Helper** 会处理这个烦人的边界情况:`Selected model is at capacity. Please try a different model.`。它会监听本地 Codex 日志,定位受影响的可见主任务,并按渐进退避最多安排 6 次重试。每次真正重试之前,它都会检查任务是否已经出现新的用户消息或新回合;如果你已经手动处理,它会自动让路。
7070

71-
确认安全后,它会打开原 Codex 任务,提交本地化续跑消息,再恢复你此前使用的 App。菜单栏还能显示 Codex 额度窗口与重置时间、聚合官方动态和文档,并通过签名校验的应用内更新保持最新版。整个过程没有云端后端、没有遥测、不读取项目文件,也不修改 Codex 二进制。
71+
确认安全后,它会打开原 Codex 任务,提交本地化续跑消息,再恢复你此前使用的 App。原生 macOS 小组件、菜单栏和可选悬浮轨道都能显示剩余额度与重置时间。整个过程没有云端后端、没有遥测、不读取项目文件,也不修改 Codex 二进制。
7272

7373
项目刻意保持小巧、可审计、中英双语,并采用 MIT 协议开源。

README.en.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Codex Helper
2+
3+
[简体中文](README.md) · [How it works](docs/how-it-works.md) · [MIT License](LICENSE)
4+
5+
<p align="center">
6+
<img src="assets/app-icon-source.png" width="150" alt="Codex Helper icon">
7+
</p>
8+
9+
An open-source macOS companion for Codex. See remaining quota at a glance and safely continue the original task after a model-capacity interruption.
10+
11+
> Not an official OpenAI project.
12+
13+
## Features
14+
15+
- Native macOS widget, menu bar quota, and an optional floating Status Rail
16+
- Remaining quota, reset countdowns, and color-coded quota levels
17+
- Guarded Auto Retry for the affected Codex task
18+
- English and Chinese UI, signed updates, official Codex news and docs
19+
20+
<p align="center">
21+
<img src="assets/status-rail-v0.6.0.webp" width="520" alt="Codex Helper floating Status Rail">
22+
</p>
23+
24+
## Install
25+
26+
Download the signed and Apple-notarized DMG from [GitHub Releases](https://github.com/makerjackie/codex-helper/releases), then drag it to Applications. Requires macOS 13+ and the Codex desktop app.
27+
28+
Native widget: Control-click the desktop → **Edit Widgets** → search for **Codex Helper**.
29+
30+
Quota and widgets do not need Accessibility permission. Permission is needed only when Auto Retry submits a continuation in Codex. Codex Helper never prompts for it automatically at launch or during its own tests.
31+
32+
## Development
33+
34+
```bash
35+
git clone https://github.com/makerjackie/codex-helper.git
36+
cd codex-helper
37+
./test.sh
38+
./install.sh
39+
```
40+
41+
See [How it works](docs/how-it-works.md) for retry safeguards and privacy boundaries.
42+
43+
## License
44+
45+
[MIT](LICENSE)

README.md

Lines changed: 17 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,44 @@
11
# Codex Helper
22

3-
[简体中文](README.zh-CN.md) · [How it works](docs/how-it-works.md) · [Releasing](docs/releasing.md) · [MIT License](LICENSE)
3+
[English](README.en.md) · [工作原理](docs/how-it-works.zh-CN.md) · [MIT License](LICENSE)
44

55
<p align="center">
6-
<img src="assets/app-icon-source.png" width="180" alt="Codex Helper icon">
6+
<img src="assets/app-icon-source.png" width="150" alt="Codex Helper 图标">
77
</p>
88

9-
An unofficial, open-source macOS companion for Codex: a quiet horizontal Status Rail for remaining quota, guarded Auto Retry, official updates and documentation, and signed in-app updates.
9+
一个开源的 macOS Codex 辅助工具。直接查看剩余额度,并在模型满载时安全续跑原任务。
1010

11-
> Not affiliated with or endorsed by OpenAI.
11+
> OpenAI 官方项目。
1212
13-
## Download
13+
## 功能
1414

15-
Download the signed and Apple-notarized DMG from [GitHub Releases](https://github.com/makerjackie/codex-helper/releases), drag **Codex Helper** into Applications, and open it once.
16-
17-
Requirements: macOS 13+ and the Codex desktop app.
18-
19-
On first launch, allow **Codex Helper** in **System Settings → Privacy & Security → Accessibility**. Codex Helper needs its own permission because it is a separate app that focuses the Codex composer and submits the continuation message. If you used the earlier Codex Auto Retry prototype, this rename changes the app name, executable, bundle ID, and signing identity, so macOS treats Codex Helper as a new app and asks once more. Developer ID-signed updates with the same identity should not normally require permission again.
20-
21-
## Menu bar and dashboard
22-
23-
Click the Codex Helper menu bar icon to:
24-
25-
- turn Auto Retry on or off;
26-
- see the primary Codex remaining quota percentage directly beside the menu bar icon;
27-
- show or hide an always-on-top Codex Status Rail with reset countdowns;
28-
- see every quota window, reset time, and reset-credit count in the first-level menu;
29-
- choose Automatic, English, or Simplified Chinese;
30-
- enable or disable Launch at Login;
31-
- automatically check and download signed Codex Helper updates;
32-
- run a safe end-to-end Auto Retry test against a task you choose;
33-
- read the latest official Codex changelog and Codex-related OpenAI news;
34-
- open Codex documentation, troubleshooting, commands, and Tibo's X profile;
35-
- open the dashboard, Accessibility Settings, or logs;
36-
- quit Codex Helper completely.
37-
38-
You can also search for **Codex Helper** in Spotlight. Opening it again brings up the redesigned dashboard, led by one spacious quota overview and a flat two-column control area instead of a stack of settings cards. Auto Retry, updates, news, documentation, and preferences remain available on one page.
39-
40-
<p align="center">
41-
<img src="assets/status-rail-v0.6.0.webp" width="520" alt="Codex Helper horizontal Status Rail">
42-
</p>
15+
- 原生 macOS 小组件、菜单栏额度和可选悬浮状态轨道
16+
- 显示剩余额度、重置倒计时与额度颜色提醒
17+
- 模型满载后自动定位并重试原 Codex 任务
18+
- 中英文、自动更新、Codex 官方动态与文档入口
4319

4420
<p align="center">
45-
<img src="assets/dashboard-v0.6.0.webp" width="760" alt="Codex Helper dashboard">
21+
<img src="assets/status-rail-v0.6.0.webp" width="520" alt="Codex Helper 悬浮状态轨道">
4622
</p>
4723

48-
## Auto Retry
49-
50-
When Codex reports:
51-
52-
```text
53-
Selected model is at capacity. Please try a different model.
54-
```
55-
56-
Codex Helper:
57-
58-
1. Watches `~/.codex/log/codex-tui.log` and extracts the affected task ID.
59-
2. Handles only visible root tasks and ignores hidden subagents.
60-
3. Retries after `8 / 20 / 45 / 90 / 180 / 300` seconds, up to six times.
61-
4. Cancels if you already sent a message or a new turn started.
62-
5. Opens the original Codex task, submits a localized continuation prompt inside Codex, and restores the app you were using.
24+
## 安装
6325

64-
It does not modify Codex, proxy network traffic, read project files, or store conversation content. It retries the same task; it does not automatically switch models.
26+
[GitHub Releases](https://github.com/makerjackie/codex-helper/releases) 下载已经签名和 Apple 公证的 DMG,拖入“应用程序”即可。要求 macOS 13+ 和 Codex 桌面版。
6527

66-
## Usage
28+
原生小组件:在桌面空白处右键 → **编辑小组件** → 搜索 **Codex Helper**
6729

68-
The menu bar percentage, dashboard, and Status Rail read `account/rateLimits/read` from the official local Codex App Server. The API reports `usedPercent`; Codex Helper displays the remaining quota as `100 - usedPercent`, matching the direction used by Codex itself. The interface stays neutral while the circular gauge and small status accents change from teal at 50–100%, to amber at 10–50%, to pink-red below 10%. The Status Rail also shows reset countdowns, reset credits, refresh, dashboard, and hide controls. Codex Helper uses the authentication already managed by Codex and never reads tokens directly from `~/.codex/auth.json`.
30+
额度和小组件不需要辅助功能权限。只有开启“自动重试”并让 App 代为提交续跑消息时才需要授权;Codex Helper 不会在启动或测试时自动弹出授权请求。
6931

70-
## Automatic updates
71-
72-
Automatic updates are enabled by default. Codex Helper checks the latest GitHub Release at most once per day and downloads a newer DMG in the background. Installation remains a visible **Install and Restart** action so an update never interrupts work unexpectedly.
73-
74-
Before replacement, Codex Helper verifies the published SHA-256 checksum, Developer ID bundle identifier and Team ID, and Gatekeeper acceptance. If the app location is not writable, it leaves the current version untouched and reports that automatic installation is unavailable.
75-
76-
## Verify Auto Retry without waiting for an outage
77-
78-
Choose **Test Auto Retry…** from the menu bar, select an idle recent Codex task with no draft in its composer, and confirm. Codex Helper creates a synthetic capacity event containing that task ID, runs it through the production matcher and visible-task check, waits three seconds, checks for newer activity, then opens the task and submits one clearly marked test message. A reply containing **Codex Helper test passed** verifies the complete routing and GUI-control chain on your installed Codex version.
79-
80-
During a real failure, the Codex log line contains `thread_id=<UUID>` beside the exact capacity error. Codex Helper verifies that UUID against `~/.codex/session_index.jsonl`, waits with backoff, re-checks the task for newer activity, then opens `codex://threads/<UUID>`. It submits only when Accessibility reports that Codex is frontmost and the focused composer is an empty text area; it also checks the target session afterward for the submitted prompt.
81-
82-
## What’s New and Learn Codex
83-
84-
The menu reads the public [Codex changelog RSS](https://learn.chatgpt.com/docs/changelog/rss.xml) and [OpenAI News RSS](https://openai.com/news/rss.xml), keeping only Codex-related OpenAI News items. Results are cached locally; successful feeds refresh every six hours, while failures back off for at least 15 minutes. The Tibo entry is a normal browser link; Codex Helper does not scrape X.
85-
86-
## Build from source
32+
## 开发
8733

8834
```bash
8935
git clone https://github.com/makerjackie/codex-helper.git
9036
cd codex-helper
37+
./test.sh
9138
./install.sh
9239
```
9340

94-
Source builds use local ad-hoc signing and can require Accessibility permission again after rebuilding. For normal use, prefer the Developer ID-signed Release build.
95-
96-
## Test
97-
98-
```bash
99-
./test.sh
100-
```
41+
更详细的识别、重试和隐私边界见[工作原理](docs/how-it-works.zh-CN.md)
10142

10243
## License
10344

0 commit comments

Comments
 (0)