Skip to content

Commit 8798555

Browse files
committed
chore: consolidate status and account workspace updates
1 parent f28c5ad commit 8798555

74 files changed

Lines changed: 2910 additions & 1122 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/gettokens-claude-code-account-list/SKILL.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: gettokens-claude-code-account-list
3-
description: GetTokens Claude Code 账号列表:Claude Channel Routing、Anthropic 格式账号筛选、请求顺序、三模式路由、项目绑定、路由探测、模型映射、官方默认模型 profile 与 local apply 边界。
3+
description: GetTokens Claude Code 账号列表:Claude Channel Routing、Anthropic 格式账号筛选、请求顺序、两模式路由、项目绑定兼容边界、路由探测、模型映射、官方默认模型 profile 与 local apply 边界。
44
---
55

66
# GetTokens Claude Code Account List
@@ -14,7 +14,8 @@ description: GetTokens Claude Code 账号列表:Claude Channel Routing、Anthr
1414
- 总账号池只管理 Account Inventory;Claude Code 账号列表拥有 Claude 渠道顺序、渠道 route mode、渠道组状态、项目绑定、dry-run/explain 和 probe。
1515
- Claude 渠道配置不得通过全局 `UpdateAccountPriority` 表达;渠道顺序必须保存到 Claude channel config。
1616
- Claude runtime routing 的唯一主路径是 `channel-routing/config.json`;旧 `routing.strategy` 只保留作 relay / compatibility 边界,不再参与 Claude 候选排序、fallback 或 balanced 计数。balanced 模式应从 live-session tracker 读取活跃会话数,而不是从展示用 snapshot 反推。
17-
- 新 GetTokens route mode 只允许 `sequential / balanced / project`
17+
- 新 GetTokens route mode 主路径只允许 `sequential / balanced`
18+
- `project` 已从可配置 route mode 下线;历史 `projectBindings` 只作为项目名到账号/账号组的范围约束或兼容数据保留,不能作为新的模式入口扩展。
1819
- `dedicated / prefer / ordered / weighted / canary` 只作为上游兼容输入,不进入 Claude 新 UI / Wails DTO / engine policy。
1920
- `exclude` 不是 route mode,只能作为请求级 deny 或 pool filter。
2021
- 旧 allow / deny / order / fallback 只作为请求级兼容 policy,不作为新页面主配置模型。
@@ -36,7 +37,7 @@ description: GetTokens Claude Code 账号列表:Claude Channel Routing、Anthr
3637
- 运行时请求候选只包含当前可请求账号
3738
- 拖拽排序写回 Claude channel config
3839
- 启停写回 `SetAccountDisabled`
39-
- 项目模式只限定目标账号或账号组;命中账号组后,组内选择继续使用 `sequential``balanced`
40+
- 项目绑定只限定目标账号或账号组;命中账号组后,组内选择继续使用 `sequential``balanced`
4041
- 浏览器 preview 必须在缺少 Wails runtime 时稳定显示 preview 数据。
4142

4243
## 3. 模型映射语义
@@ -84,5 +85,5 @@ description: GetTokens Claude Code 账号列表:Claude Channel Routing、Anthr
8485
- 同一真实模型多个 Claude alias
8586
- 官方默认 profile 不覆盖用户映射
8687
- Claude channel config 保存不影响 Codex channel config
87-
- `ChannelRouteMode` 只接受 `sequential / balanced / project`
88+
- `ChannelRouteMode` 只接受 `sequential / balanced``project` 输入必须降级或标记为旧兼容输入
8889
- 上游兼容模式不进入 Claude 新配置保存

.agents/skills/gettokens-codex-account-list/SKILL.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: gettokens-codex-account-list
3-
description: GetTokens Codex 账号列表:Codex Channel Routing、账号请求顺序、三模式路由、项目绑定、路由探测、模型映射、OAuth 透传语义、openai-compatible 映射保存与浏览器预览。
3+
description: GetTokens Codex 账号列表:Codex Channel Routing、账号请求顺序、两模式路由、项目绑定兼容边界、路由探测、模型映射、OAuth 透传语义、openai-compatible 映射保存与浏览器预览。
44
---
55

66
# GetTokens Codex Account List
@@ -12,7 +12,8 @@ description: GetTokens Codex 账号列表:Codex Channel Routing、账号请求
1212
- 总账号池只管理 Account Inventory;Codex 账号列表拥有 Codex 渠道顺序、渠道 route mode、渠道组状态、项目绑定、dry-run/explain 和 probe。
1313
- Codex 渠道配置不得通过全局 `UpdateAccountPriority` 表达;渠道顺序必须保存到 Codex channel config。
1414
- Codex runtime routing 的唯一主路径是 `channel-routing/config.json`;旧 `routing.strategy` 只保留作 relay / compatibility 边界,不再参与 Codex 候选排序、fallback 或 balanced 计数。balanced 模式应从 live-session tracker 读取活跃会话数,而不是从展示用 snapshot 反推。
15-
- 新 GetTokens route mode 只允许 `sequential / balanced / project`
15+
- 新 GetTokens route mode 主路径只允许 `sequential / balanced`
16+
- `project` 已从可配置 route mode 下线;历史 `projectBindings` 只作为项目名到账号/账号组的范围约束或兼容数据保留,不能作为新的模式入口扩展。
1617
- `dedicated / prefer / ordered / weighted / canary` 只作为上游兼容输入,不进入 Codex 新 UI / Wails DTO / engine policy。
1718
- `exclude` 不是 route mode,只能作为请求级 deny 或 pool filter。
1819
-`allowAccountIDs / denyAccountIDs / orderAccountIDs / allowFallback` 只作为请求级兼容 policy,不作为新页面主配置模型。
@@ -25,7 +26,7 @@ description: GetTokens Codex 账号列表:Codex Channel Routing、账号请求
2526
- 禁用优先级高于 session sticky、失败降级和 retry;Codex WebSocket pinned auth 命中禁用后必须释放 pin、断开旧 upstream,并在下一请求边界重新进入 route engine。
2627
- 激活账号只重新进入可路由账号池,等待下一轮 route / retry,不抢占当前 stream / sticky。
2728
- 失败冷却状态必须持久化到运行态或 guard source;401/429/5xx/model-unavailable 后续请求和 explain 都应读取同一冷却状态,自动恢复不能清 `manual-disabled`
28-
- 项目模式只限定目标账号或账号组;命中账号组后,组内选择继续使用 `sequential``balanced`
29+
- 项目绑定只限定目标账号或账号组;命中账号组后,组内选择继续使用 `sequential``balanced`
2930

3031
## 2. 前端结构
3132
- `CodexAccountListFeature.tsx` 保持为 controller:
@@ -83,7 +84,7 @@ description: GetTokens Codex 账号列表:Codex Channel Routing、账号请求
8384
- 保持 Swiss-industrial 风格:硬边框、黑白灰、紧凑高密度、monospace 辅助信息。
8485
- 账号行固定为单一 Codex 渠道顺序列表,不再额外渲染重复策略账号列表。
8586
- 账号行主体点击打开详情;嵌套按钮、switch、combobox、策略控件必须阻止冒泡。
86-
- 新主控件应围绕 `sequential / balanced / project`、渠道组范围、项目绑定和 explain;旧“默认 / 允许 / 排除”只用于请求级兼容探测入口。
87+
- 新主控件应围绕 `sequential / balanced`、渠道组范围、项目绑定和 explain;旧“默认 / 允许 / 排除”只用于请求级兼容探测入口。
8788
- 路由探测卡片独立于账号顺序卡片;测试流常驻显示,不使用卡中卡文本模块。
8889
- 请求顺序列表模式用于高密度排序,不再做卡片式信息堆叠:
8990
- 左侧 rail 固定承载顺位与拖拽柄,顺位数字和拖拽柄横向排列。
@@ -95,6 +96,10 @@ description: GetTokens Codex 账号列表:Codex Channel Routing、账号请求
9596
- `参与账号` 默认折叠,只显示数量;用户需要核对具体账号时再展开。
9697
- `更多操作` / 保存 / 过滤等控制放在标题右侧或同一 header band 内,不单独拉出一条说明栏。
9798
- 账号列表区域不再额外包一层大边框或大阴影,卡片只保留自身边界,避免再次出现卡中卡。
99+
- 请求顺序卡片必须直接复用账号池 `AccountCard`,不要再维护一个“像账号池”的分叉卡片:
100+
- Codex 页特有信息只通过 opt-in props 叠加,例如 `extraBadges``eyebrowPrefix``showDeleteAction=false``showFooterActions=false`
101+
- 非列表模式通过拖动整张卡排序;激活/禁用继续使用账号池卡片菜单,不额外暴露独立 toggle 或置顶/置底按钮。
102+
- 同一 grid 行内保持账号池式等高卡片;状态行前可显示当前请求顺序前缀,例如 `#1 可用`,但该前缀只属于 Codex 请求顺序页。
98103
- 请求模式说明入口:
99104
- `请求模式` 标题旁使用问号图标按钮打开说明,说明作为 modal 弹层出现,不替换当前工作台主内容。
100105
- 说明必须明确 sequential 只是“每次路由决策的账号排序”,不是账号独占;retry/failover、运行态 guard/cooldown、WebSocket pinned auth 释放、项目/组限定、多会话并发、路由探测与连续测试都可能命中后续账号。
@@ -135,7 +140,7 @@ description: GetTokens Codex 账号列表:Codex Channel Routing、账号请求
135140
- 涉及公共 DTO 或绑定时重新生成 `frontend/wailsjs` 并跑类型检查。
136141
- Account Routing Engine rollout 额外覆盖:
137142
- Codex channel config 保存不影响 Claude channel config。
138-
- `ChannelRouteMode` 只接受 `sequential / balanced / project`
143+
- `ChannelRouteMode` 只接受 `sequential / balanced``project` 输入必须降级或标记为旧兼容输入
139144
- 上游兼容模式不进入 Codex 新配置保存。
140145
- 视觉截图放到 `docs-linhay/spaces/20260511-codex-account-list-tab/screenshots/<YYYYMMDD>/codex/`
141146

.agents/skills/gettokens-domain-engineering/SKILL.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ This skill unifies the technical rules for building, styling, and debugging GetT
1313
- Keep `provider` and `credentialSource` separate.
1414
- Uniqueness is by asset (e.g., `auth-file:<name>`).
1515
- `codex api key` records must prefer a persisted stable local id over a derived config fingerprint. Editing `apiKey / baseUrl / prefix` must not change the record id used by frontend selection, modal state, disable state, or rotation ordering.
16-
- Duplicate detection for `codex api key` still uses the normalized config identity (`apiKey + baseUrl + prefix`), even when the persisted record id is stable.
16+
- User-created or copied `codex api key` records may share the same normalized config identity (`apiKey + baseUrl + prefix`). Treat each persisted `local-id` as a separate editable account asset; store files should be keyed by `local-id` so duplicates do not overwrite each other.
17+
- Legacy sidecar mirror data without `local-id` may still be deduplicated against a stored local record with the same normalized config identity to avoid reintroducing the historical double-card bug.
18+
- Account-card copy/import must copy a structured account payload, not just a display name. The payload should round-trip all supported asset classes: `auth-file`, `codex-api-key`, and `openai-compatible`.
19+
- Account-card clipboard writes must tolerate browser preview and Wails permission differences. Prefer a shared clipboard helper with DOM copy, Web Clipboard, Wails runtime, and app-local fallback paths instead of calling `navigator.clipboard.writeText` directly from card components.
20+
- Copied account imports create a new editable asset even when the underlying config is identical. When the imported title/provider/file name already exists, append user-facing numeric suffixes from ` #2` onward; do not use `-copy` style suffixes. For auth-file imports, preserve `.json` after the numbered title, such as `codex-auth #2.json`.
1721
- Do not fetch accounts until sidecar is `ready`.
1822
- Reload from Wails after create/delete instead of hand-merging state.
1923
- `codex api key` lives in local storage under `~/.config/gettokens-data/codex-api-keys/`, not in `auth-dir`.
@@ -120,7 +124,7 @@ This skill unifies the technical rules for building, styling, and debugging GetT
120124

121125
## 3.2 Codex Workspace & Local Config Surfaces
122126
- **Codex Binary**: For Codex CLI binary version/source management, use the dedicated `gettokens-codex-binary-management` skill. Keep it as an independent binary-management business; do not merge it into account pool, local apply, usage, session, or routing flows.
123-
- **Codex Account List / Channel Routing**: For Codex account request order, route probing, OAuth/auth-file model aliasing, openai-compatible model mappings, channel route mode, project bindings, and `#frame=codex&workspace=account-list`, use the dedicated `gettokens-codex-account-list` skill. In the Account Routing Engine rollout, Codex account list is the Codex Channel Routing workspace: channel order, route mode, channel group state, project bindings, dry-run/explain, and probe are Codex-owned channel config, not global account inventory priority.
127+
- **Codex Account List / Channel Routing**: For Codex account request order, route probing, OAuth/auth-file model aliasing, openai-compatible model mappings, channel route mode, project bindings, and `#frame=codex&workspace=account-list`, use the dedicated `gettokens-codex-account-list` skill. In the Account Routing Engine rollout, Codex account list is the Codex Channel Routing workspace: channel order, route mode, channel group state, project bindings, dry-run/explain, and probe are Codex-owned channel config, not global account inventory priority. Current channel route mode is two-mode only: `sequential / balanced`; `project` is historical compatibility/scoping data, not a configurable mode.
124128
- **Channel Routing Source of Truth**: For Codex / Claude runtime routing, `~/.config/gettokens-data/channel-routing/config.json` is the main decision source. Treat sidecar `routing.strategy` in `~/.config/gettokens/config.yaml` as legacy relay/config compatibility only; it must not drive Codex / Claude candidate ordering once channel routing is configured. The CLIProxyAPI fork should install GetTokens channel routing as a pool-scope route policy before legacy selectors, and balanced mode should read active-session counts from the live-session tracker instead of a display snapshot.
125129
- **Codex Extensions**: For Codex Skills / MCP Servers, `[[skills.config]]`, `tk://github.com` / `tk://gitlab.com` skill sources, and `#frame=codex&workspace=skills|mcp-servers`, use the dedicated `gettokens-codex-extensions-management` skill. Keep source-accurate parsing, modal/list UI semantics, and cleanup split rules in that skill instead of expanding this general domain skill.
126130
- **Claude Code Workspace Parity**: When Claude Code adds a capability that corresponds to existing Codex workspace entries, keep the workspace granularity aligned with Codex unless Claude semantics clearly require a different information architecture.
@@ -164,6 +168,7 @@ This skill unifies the technical rules for building, styling, and debugging GetT
164168
- Trend chart x positions should read as request sequence, not timestamp spacing. Keep request records sorted by `startedAt`, then render the visible slice as dense equal-step bars with `#sequence` as the x-axis label; do not stretch sparse requests across real elapsed gaps.
165169
- Trend chart data window is a fixed count cap, not a fixed time window. Keep only the latest capped request points for the chart model, so new requests push the sequence labels forward (`#50` -> `#51` -> `#52`) while the visible data volume remains bounded.
166170
- Trend chart viewport should be a fixed, non-scrollable audio waveform chart. The visible request count is width-driven: wider surfaces show more recent request bars, narrower surfaces show fewer, and the latest request stays anchored near the right edge. Do not reintroduce horizontal panning or auto-scroll follow logic.
171+
- The timing metric picker below the chart summarizes the same trend window. Show average values for `total / TTFT / first token / stream / queue / auth select / connect / gaps / rates` rather than echoing the latest single request; keep latest-request values in the timeline rows and chart footer.
167172
- Keep the live-session chart visually inside the page section, not as a nested card. Use the existing Swiss-industrial chart tokens, footer summaries below the graph, and live markers such as dashed strokes/rings for in-flight samples.
168173
- Request timing trend visuals should read like a forward-moving audio waveform, not a finance line, ECG trace, or candlestick chart. Render exactly one centered vertical amplitude bar per request for the selected timing metric; longer durations produce taller bars, and live rings distinguish in-flight samples.
169174
- Timing trend motion should not redraw the full waveform on every live refresh. Keep bars steady; use a short opacity settle only when switching metrics and a subtle breathing ring on the live sample to indicate activity.
@@ -290,6 +295,10 @@ This skill unifies the technical rules for building, styling, and debugging GetT
290295
- keep locators/debug metadata available, but visually subordinate to the main decision path
291296
- **Action Selects**: For `select + right-side actions` patterns, use the project-level `frontend/src/components/ui/ActionSelect.tsx` instead of hand-rolling label/select/button grids. Keep `+` and optional delete actions inside the select frame so field widths align across sibling rows.
292297
- **Status Local CLI Config**: In `StatusApplyLocalSection`, Codex and Claude Code tabs must share field components for equivalent concepts such as Relay API key, endpoint/base URL, provider, and model. Do not maintain parallel JSX just because one tab has fewer fields.
298+
- Provider and model controls must preserve source casing and source identity. Do not force uppercase through shared controls, labels, badges, or status hints.
299+
- The Codex provider picker displays the `model_provider` id only. Do not concatenate display name and id with `/` or maintain a separate display-name input for new local provider options unless a later requirement introduces that distinction explicitly.
300+
- Initial Codex provider/model selection should prefer explicit values from `config.toml`; UI localStorage is secondary. If Codex has no explicit root `model_provider`, the Status page may default to the GetTokens relay provider; if Codex has no explicit root `model`, fall back to `RELAY_CODEX_DEFAULT_MODEL`.
301+
- Legacy UI-only model fallbacks such as `GT` must be treated as migration inputs, not as active defaults. Filter them from stored model option lists and lock the migration with focused local-state tests.
293302
- **Codex Feature Config UI**: The local Codex `[features]` bool editor is a config list, not a data table. Each feature is one row with feature key as the title, stage as a compact tag before the subtitle, localized description as the subtitle, and the switch as the only bool value expression. Do not add duplicate `default/local/on/off` value labels when the switch already communicates the state. Do not force feature keys or descriptions to uppercase; preserve source and localization casing.
294303
- **Account Cards**: Account cards should support whole-card detail entry, but clicks originating from nested interactive controls (`button`, `input`, etc.) must not trigger the card-level detail action.
295304
- **Account Detail Surfaces**:

app.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,11 +1051,14 @@ func (a *App) GetLocalCodexModelProviderStateView() (*LocalCodexModelProviderSta
10511051
}
10521052

10531053
return &LocalCodexModelProviderStateView{
1054-
CurrentProviderID: result.CurrentProviderID,
1055-
CurrentProviderName: result.CurrentProviderName,
1056-
CurrentProviderIsBuiltin: result.CurrentProviderIsBuiltin,
1057-
CurrentProviderExists: result.CurrentProviderExists,
1058-
Providers: mapLocalCodexModelProviderViews(result.Providers),
1054+
CurrentModel: result.CurrentModel,
1055+
HasExplicitCurrentModel: result.HasExplicitCurrentModel,
1056+
CurrentProviderID: result.CurrentProviderID,
1057+
CurrentProviderName: result.CurrentProviderName,
1058+
CurrentProviderIsBuiltin: result.CurrentProviderIsBuiltin,
1059+
CurrentProviderExists: result.CurrentProviderExists,
1060+
HasExplicitCurrentProvider: result.HasExplicitCurrentProvider,
1061+
Providers: mapLocalCodexModelProviderViews(result.Providers),
10591062
}, nil
10601063
}
10611064

0 commit comments

Comments
 (0)