Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fbe6a6c
修复高分屏交互与窗口冲突,加入更新、外观设置和 GPT-6 支持
windycn Sep 26, 2026
cbd0e37
完善本地模型目录与数据升级备份,校正布局回归验证
windycn Sep 26, 2026
cb383a6
同步缩放字体与控件,减少小屏多余滚动并完善高分屏图标
windycn Sep 26, 2026
40db83c
统一 Fluent 字体图标并修复设置页响应布局与交互延迟
windycn Sep 26, 2026
505cfcf
完善 Fluent 设置导航并移除外层多余滚动,加入发布打包脚本
windycn Sep 26, 2026
b9572ee
增加 Windows 字体实际映射和渲染诊断
windycn Sep 26, 2026
685b142
修正设置卡片按钮 Dock 覆盖并对齐真实文字渲染模式
windycn Sep 26, 2026
ccb62e2
统一托盘文字渲染并区分内置字体字重标识
windycn Sep 26, 2026
4c4e724
增加主分支验证后发布正式安装包的手动流程
windycn Sep 26, 2026
d724910
修复高缩放后的页脚列宽并增加可见操作按钮检查
windycn Sep 26, 2026
145abef
避免缩放中释放仍被布局快照引用的字体
windycn Sep 26, 2026
1dc8efb
按实际额度窗口显示账号用量,缺少五小时窗口时仅显示七天
windycn Sep 26, 2026
966042c
新增只读重置卡详情与精确重置时间,统一窗口缩放入口
windycn Sep 26, 2026
6d78f2d
补充只读详情高缩放验收和版本说明
windycn Sep 26, 2026
43c24b9
补充缩放布局诊断并并行读取只读账号资料
windycn Sep 26, 2026
1d8bbfa
缩放结束后按父子顺序重新布局,修复停留在旧尺寸的停靠控件
windycn Sep 26, 2026
9c89cbc
约束设置内容列与页脚行,防止隐式自动尺寸撑出窗口
windycn Sep 26, 2026
5be900c
改用具体重置日期并保留雷达状态提示
windycn Sep 26, 2026
223d7f4
同步具体日期和雷达状态发布说明
windycn Sep 26, 2026
a718fe3
同步账号重置日期展示文档
windycn Sep 26, 2026
864ca92
同步英文重置日期说明
windycn Sep 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Windows 构建与回归
on:
push:
branches: [main, fix/windows-0.2]
workflow_dispatch:
inputs:
publish_release:
description: 发布已验证的 0.2.0 正式包
type: boolean
default: false
permissions:
contents: read
jobs:
verify:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: 核心回归
run: dotnet run --project tests/WinCodexBar.CoreTests -c Release
- name: Windows 窗口回归
run: dotnet run --project tests/WinCodexBar.WindowsTests -c Release
- name: 发布三个架构
shell: pwsh
run: |
foreach ($rid in @('win-x64', 'win-x86', 'win-arm64')) {
dotnet publish windows/CodexBarWin/CodexBarWin.csproj -c Release -r $rid --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o "artifacts/$rid"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
- name: 打包与校验清单
shell: pwsh
run: ./tools/Package-Windows.ps1
- uses: actions/upload-artifact@v4
if: always()
with:
name: windows-validation-and-packages
path: |
artifacts/packages/
tests/WinCodexBar.WindowsTests/bin/Release/net8.0-windows/screenshots/

release:
if: github.event_name == 'workflow_dispatch' && inputs.publish_release && github.ref == 'refs/heads/main'
needs: verify
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: windows-validation-and-packages
path: release-files
- name: 发布正式版
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release create v0.2.0
release-files/artifacts/packages/*.zip
release-files/artifacts/packages/SHA256SUMS.txt
--target "$GITHUB_SHA"
--title "WinCodexBar 0.2.0 · Fluent 界面与自动更新"
--notes-file tools/Release-Notes-0.2.0.md
--latest
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 更新记录

## 0.2.0 — 2026-09-26

- 设置页统一 Fluent 图标与内置中英文字体,修复窄屏、高缩放下的卡片与页脚布局。
- 缺少 5 小时窗口的账号只显示 7 天用量;平均值与托盘图标同步处理。
- 新增只读重置卡次数、逐张到期时间,以及带时区的精确额度重置时间;不提供使用或兑换操作。


- 修复托盘外部点击检测误关删除确认框、弹窗与主窗口开关竞争、右键触发操作和滚动区域点击穿透。
- 修复小屏窗口超出工作区;新增跟随显示器 DPI、100%–300% 手动缩放、设置卡片响应式排列与滚动入口。
- 新增额度圆环、剩余百分比、经典图标三种托盘样式;释放被替换的图标和账号行控件。
- 新增自动/手动版本检查、SHA256 校验、覆盖更新与重启、文件替换失败回滚,以及首次升级的数据备份。
- 添加 GPT-6 三个型号和价格预设;只读本地模型目录补充模型与推理强度;修复标准服务档位同步。
- 优先显示 Radar 当前重置窗口,过期预测不再覆盖当前状态;网络失败标记缓存。
- 保留关闭的唤醒策略;保存模型和模式后立即同步;限制刷新间隔,防止计时器整数溢出。
- 本地 Token 扫描改为后台执行;工作台增加删除入口;单实例防止重复运行引发文件/网关冲突。
- 增加独立临时数据目录下的核心回归、Windows 窗口与更新脚本验证,以及三架构构建流程。

# 更新日志

## 0.1.1 - 2026-06-21
Expand Down
170 changes: 15 additions & 155 deletions README.en.md
Original file line number Diff line number Diff line change
@@ -1,171 +1,31 @@
# WinCodexBar

> A Windows tray workspace for Codex multi-account management, quota visibility, local token activity, and aggregate account routing.
[简体中文](./README.md) · [Download](https://github.com/windycn/WinCodexBar/releases/latest)

## About
A Windows tray workspace for Codex accounts, quotas, model settings, and local usage insights.

WinCodexBar is a Windows tray app built for Codex users who work with multiple OpenAI OAuth accounts. It combines account switching, quota tracking, token activity, session analysis, import/export, keep-awake controls, and aggregate routing in one lightweight desktop workflow.
Version **0.2.0** adds automatic display DPI adaptation, manual scaling from 100% to 300%, three tray icon styles, GPT-6 choices and local model catalog integration. It fixes popup/dialog conflicts, deletion confirmation, clipped hit targets, and disabled wake settings being re-enabled after restart.

## Why It Matters
Automatic update checks run shortly after startup and every six hours. Installation requires confirmation: the app downloads the matching architecture package, verifies SHA256, backs up account/settings files, then replaces program files and restarts. Replacement failures trigger a rollback attempt with retained backups and logs.

### Aggregate Mode Keeps Account Routing Continuous
Download the x64, x86, or arm64 ZIP, extract it to a separate writable folder, and launch `WinCodexBar.exe`. The .NET runtime is included. For the first upgrade from 0.1.x, exit the old version and replace its files manually; subsequent releases can use the new updater.

Aggregate mode starts a local account gateway and treats your OpenAI OAuth accounts as an account pool. New Codex instances can connect through this local gateway, so account selection and request routing are handled by WinCodexBar instead of repeatedly editing account configuration in each project.
Account/settings files remain in `%USERPROFILE%\.codexbar` (or beneath `CODEXBAR_HOME`). Version upgrades create backups under `.codexbar\backups`. Update staging, program backups and `result.txt` are under `%LOCALAPPDATA%\WinCodexBar\updates`. Session history is not deleted. Backups and account exports contain credentials and should remain private.

This is useful when you work across multiple projects or long-running sessions. You can inspect all account quotas in one place and continue with a healthier account when needed. Codex instances opened before aggregate mode is enabled usually need to be restarted or reopened before they use the local gateway.
Single-click the tray icon for quick actions; double-click for the dashboard. Appearance settings offer a quota ring, remaining percentage or classic app icon. Settings also provide manual update checks. Model availability depends on the account and Codex version; existing selections are preserved.

### Switching Accounts Does Not Mean Losing Project Memory
Token costs are estimates, not billing records. The public reset-window summary is attributed to [Codex Radar](https://codexradar.com/); it is not evidence that an individual account has reset. Codex Radar’s protected full API is not queried.

WinCodexBar switches OAuth identity and request routing. It does not clear your project folders, local session records, or Codex project context files. In practical terms, the account is the request identity, while the project session is local working memory; WinCodexBar changes the former and does not delete the latter.

In manual mode, already-running Codex instances usually need to be restarted or reopened before they use the newly selected account. In aggregate mode, later routing decisions are centralized through the local gateway.

### Quota And Token Activity Stay Visible

The tray icon uses a ring indicator for recent 5-hour quota. The tray panel and dashboard show 5-hour quota, 7-day quota, health state, reset time, and local token activity for today, this week, this month, and all time. You can react before an account runs out of quota.

## Screenshots

### Tray Menu

The compact tray panel shows the current account, quota, subscription type, and account pool state. It also gives quick access to account actions, the dashboard, and settings.

<p>
<img src="./assets/screenshots/tray-menu.png" alt="WinCodexBar tray menu" width="420">
</p>

### Dashboard

The dashboard includes the account list, token activity, session analysis, and cost estimates. Bar charts and heatmaps make daily, weekly, monthly, and all-time token usage easier to scan.

<p>
<img src="./assets/screenshots/dashboard-token-activity.png" alt="WinCodexBar token activity dashboard" width="860">
</p>

### Settings

Settings cover account mode, quota display, wake strategy, and model parameters. Wake strategy supports both system keep-awake and advanced anti-sleep behavior.

<p>
<img src="./assets/screenshots/settings-wake-strategy.png" alt="WinCodexBar wake strategy settings" width="820">
</p>

## Problems It Solves

When you use several OpenAI accounts with Codex, the friction usually comes from:

- Not knowing how much 5-hour or 7-day quota remains.
- Editing local account configuration by hand.
- Interrupting work when switching accounts across multiple projects.
- Moving or backing up multiple OAuth accounts.
- Windows sleeping or locking the screen during a long session.
- Token activity and local session history being hard to inspect.

WinCodexBar puts these controls into a tray menu, a dashboard, and a settings window designed for day-to-day Windows use.

## Features

### Tray Menu

- Open a compact account panel from the system tray.
- Use a ring tray icon to show recent 5-hour quota status.
- Hover over the tray icon to inspect 5-hour and 7-day usage.
- Open the dashboard from the tray menu.
- Dismiss the tray panel by clicking outside it.

### Account Management

- Add OpenAI OAuth accounts.
- Capture browser OAuth callbacks automatically when possible.
- Paste the returned browser URL manually when automatic capture is unavailable.
- Import and export multiple accounts for backup or migration.
- Delete accounts with a confirmation step.
- Switch the active account and write the change to Codex configuration.

### Manual And Aggregate Modes

- Manual mode writes the selected account to local Codex configuration. Already-running Codex instances usually need to be restarted or reopened to use the new account.
- Aggregate mode starts a local account gateway so new Codex instances can route through a local endpoint.
- Aggregate mode is designed for multi-project, multi-account, and long-session workflows where repeatedly editing account config is disruptive.
- Codex instances that were already open before aggregate mode is enabled usually need to be restarted or reopened before they use the local gateway.

### Usage And Quota

- Show each account's subscription, health state, 5-hour quota, and 7-day quota.
- Choose between used quota and remaining quota display modes.
- Choose token number units: Chinese-style units or K/M/B.
- Use green, orange, and red status colors as remaining quota crosses warning thresholds.
- Show reset countdowns together with exact reset dates and times.

### Dashboard

- View account counts, current account, quota state, and health summary.
- Refresh or switch accounts from the account list.
- Inspect token activity with daily, weekly, monthly, and all-time views.
- Use bar charts and a calendar-style heatmap for token trends.
- Review local Codex sessions, including recent sessions and highest-token sessions.
- Estimate token cost in USD and CNY using editable model price presets.

### Keep Awake

- Keep Awake prevents Windows from sleeping or turning off the display.
- Advanced Keep Awake can gently move the mouse after an idle period.
- Configure idle threshold, trigger interval, jitter duration, movement strategy, and fullscreen pause behavior.
- Enable launch at Windows startup.

### Settings

- Account settings: manual mode and aggregate mode.
- Usage settings: quota display mode, token units, auto refresh, health thresholds, and pricing presets.
- Wake strategy: keep awake, advanced anti-sleep behavior, and startup launch.
- Model parameters: default model, review model, reasoning effort, and service tier.

## Install

Choose the package that matches your Windows device:

- `WinCodexBar-0.1.1-win-x64.zip`: most 64-bit Intel / AMD Windows devices.
- `WinCodexBar-0.1.1-win-x86.zip`: older 32-bit Windows devices.
- `WinCodexBar-0.1.1-win-arm64.zip`: Windows on ARM devices.

Extract the archive and run `WinCodexBar.exe`. After launch, the app appears in the system tray.

## Build From Source

Requires the .NET 8 SDK.

```powershell
dotnet restore windows\CodexBarWin\CodexBarWin.csproj
dotnet build windows\CodexBarWin\CodexBarWin.csproj -c Release
```

Publish a self-contained single-file build:
Build using .NET 8 SDK:

```powershell
dotnet publish windows\CodexBarWin\CodexBarWin.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
dotnet build windows/CodexBarWin/CodexBarWin.csproj -c Release
dotnet run --project tests/WinCodexBar.CoreTests -c Release
dotnet run --project tests/WinCodexBar.WindowsTests -c Release
```

## Data And Privacy

- Account data is stored locally by default.
- The app does not display access tokens, refresh tokens, or ID tokens in logs, UI text, or summaries.
- Exported account files are sensitive. Keep them private and do not upload them publicly.
- Token activity and session analysis are based on local Codex session files and are used only for local display and estimation.

## Notes

- Switching accounts does not delete project files or local session records, but already-running Codex instances may still use the old account. Restart Codex or open a new instance to ensure the new account is used.
- Aggregate mode requires Codex to use the local gateway endpoint. Codex instances opened before the mode switch usually do not join automatically.
- Cost statistics are local estimates based on token counts and price presets. They are not official billing data.
- Advanced Keep Awake simulates tiny mouse movement. Enable it only when it fits your workflow.
- If Windows security software blocks the single-file executable, verify the file source before allowing it.

## Version

Current version: `0.1.1`

See [CHANGELOG.md](./CHANGELOG.md) for release notes.
Window tests require Windows and use isolated temporary data. Mixed-monitor hot-plug behavior and hardware-specific rendering still need device acceptance testing.

## License
[MIT License](./LICENSE) · [Third-party notices](./THIRD_PARTY_NOTICES.md)

WinCodexBar is licensed under the MIT License. See [LICENSE](./LICENSE).
Account quota windows are shown only when supplied by the service. Weekly-only accounts have no five-hour placeholder, and the tray indicator uses weekly usage. Reset-credit counts and individual expiration times are read-only; account details show exact reset dates, seconds, and local UTC offsets. There is no redemption action or endpoint.
Loading
Loading