Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
55 changes: 55 additions & 0 deletions .trellis/tasks/08-31-grok-first-class-iteration/HANDOFF.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 交接:Grok 一等公民(明天 Mac 继续)

写给明天的 William。密码、验证码、邮箱、账号名、token 不要写进仓库或结果表。

## 分支

- 仓库:`fy-agent/fyagent`(远端 `origin`)
- 分支:`feat/grok-first-class-iteration`
- 从 `main` / `79092221` 切出,**不要**推 `main`
- 明天若分支名或目标仓库不对,直接改;这份说明跟着分支走

对齐源:本目录 [`summary.md`](./summary.md)。亲测表:[`research/hil-matrix.md`](./research/hil-matrix.md)。

## 现在程序里有什么

三条登录已经分开,不要混:

| 路 | 人怎么走 | 对的样子 |
|---|---|---|
| 官方 Grok | 新界面 → AI软件配置 → Grok Build → 模型 →「登录」 | 终端 `grok login` / `grok logout`。只说门打开了,**不说**已登录。 |
| SuperGrok 扫码 | 同一页点「打开认证中心扫 SuperGrok」 | 弹出旧认证中心,在 **xAI (Grok OAuth)** 扫一次。这把钥匙给后面几家共用。 |
| API 钥匙 | 侧栏模型管理 → Grok Build,或 Grok 页「配置 API 钥匙」 | 只填钥匙。没有 `grok login` 说明书。 |

SuperGrok 扫完之后,分别去各家模型页写入(每家一张单,不要混):

1. Claude Code:模型页 →「绑定到 Claude Code」→ 先看 → 确认
2. Claude Desktop:同一页「绑定到 Claude Desktop」(目录没有单独一页是正常的)
3. Codex:模型页 →「创建 SuperGrok Provider」→ 先看 → 确认创建 → 再确认切换预览
4. WorkBuddy:模型页 →「用 SuperGrok 拉名单」→ 走它自己的保存,不是 Codex 那扇门

官方 `grok login` **不会**写进 Codex。只用 Grok Build 的人,终端自己跑 `grok login` 就可以。

## 今天修过的交互

- 认证状态只出现在「模型」分段。Skill / MCP / 提示词顶上不再钉认证条。
- Grok / Codex 不再显示「刷新状态」。刷新不会再把交接成功条清掉、看起来像退登。
- Grok 页主按钮改成「配置 API 钥匙」,并加了去 Codex / Claude / WorkBuddy 绑定 SuperGrok 的门。
- 「打开认证中心」会弹出旧认证中心(不把扫码搬进新界面,也不新做一套 OAuth)。

## 明天 Mac 怎么走

1. checkout `feat/grok-first-class-iteration`(或你改过的分支名)。
2. 不要装、不要升级 Grok。不要做 ChatGPT 登录。不要写 Qoder / TRAE。
3. 按 [`research/hil-matrix.md`](./research/hil-matrix.md) 走完 H1–H9。
4. 结果只写屏幕事实。Windows 结果表还在本机:`C:\Users\wq241\Downloads\FYAGENT-GROK-HIL-WINDOWS-结果.md`。Mac 可写私人交接仓 `results/mac.md`。
5. 少一家、少一台电脑,都不算完。不要关 GitHub #42 / #43。

Windows 上官方登录(H1)已经走过一轮,当时「刷新状态」会像退登、「进入模型管理」会掉进 API Key 页;这两处今天已改,Mac 请按新交互测。SuperGrok → 四家写入(H3–H8)Windows 还没走完。

## 明确不要做

- 不把官方登录显示成「已验证 / 已登录」
- 不读 `~/.grok/auth.json` 假装已登录
- 不把旧认证中心整页搬进 `src/v2`
- 不提交 `.qoder/`、截图、`MEMORY.md`、密钥
8 changes: 8 additions & 0 deletions .trellis/tasks/08-31-grok-first-class-iteration/check.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{"file": ".trellis/tasks/08-31-grok-first-class-iteration/summary.md", "reason": "Reject work that drifts from the shared plain plan"}
{"file": ".trellis/spec/backend/external-agent-p0.md", "reason": "Reject verified Grok login or auth.json inference"}
{"file": ".trellis/spec/frontend/v2-agent-models.md", "reason": "Reject login controls on Models Quick Setup"}
{"file": ".trellis/spec/frontend/reuse.md", "reason": "Reject page-local OAuth or Settings rewrite"}
{"file": ".trellis/tasks/08-31-grok-first-class-iteration/research/hil-matrix.md", "reason": "Both machines and all live cases required"}
{"file": ".trellis/tasks/08-31-grok-login-trichotomy/research/current-login-surfaces.md", "reason": "Three roads must stay on their current owners"}
{"file": ".trellis/spec/backend/workbuddy-configuration.md", "reason": "Reject treating WorkBuddy as a Provider write"}
{"file": ".trellis/tasks/08-31-grok-supergrok-to-workbuddy/research/current-workbuddy-save-path.md", "reason": "Reject refresh-token copy into models.json"}
67 changes: 67 additions & 0 deletions .trellis/tasks/08-31-grok-first-class-iteration/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Design — Grok login and SuperGrok placement

先读 [summary.md](./summary.md)。这里只写怎么接现有零件,不另起炉灶。

## Architecture

不新开登录系统,不新开第四套保存。

```text
新界面 Agent(Grok)
→ 打开终端 grok login / logout
→ 只说「门打开了」,不说「已经登进去」

旧认证中心(SuperGrok 扫码)
→ 账号存在 FyAgent 自己的保险柜(xai_oauth)
→ 这把钥匙给下面几家共用,每家各自写入

新界面模型(Grok)
→ 只填 API 钥匙
→ 不讲 grok login,不讲扫码
```

| 地方 | 这轮做什么 | 不要做什么 |
|---|---|---|
| 新界面 Agent | 官方登录的路标说清楚 | 假装已经登录;去翻 Grok 秘密文件 |
| 认证中心 | SuperGrok 扫码仍只在这里 | 搬进新界面;新做一套 OAuth |
| Claude Code | 已有账号能绑上去;新界面能看见这条路 | 和 Codex 写进同一张预览单 |
| Claude Desktop | 旧界面走通绑定;目录没有单独一页就不要硬造 | 假装它在新界面 Agent 目录里 |
| Codex | 现有 Change Plan 开窄口:已有托管账号才放行 | 第四套保存;预览单里放钥匙 |
| WorkBuddy | 走它自己的 Change Plan | 走 Codex upsert;把刷新令牌抄进 models.json |
| 新界面模型 | API 钥匙保持原样 | 把官方登录说明书贴过来 |

## Data flow

1. 官方登录:界面只说「给 Grok 登录或退出」。程序打开官方命令,立刻结束。不像 Claude 那样再查一遍「真的登进去了没有」。
2. 扫码:人在认证中心登完。钥匙放在 `xai_oauth_auth.json`,不写进 Grok 官方那个秘密文件。
3. Claude Code / Claude Desktop:旧界面已经能用 `xAI (Grok)` 的 `xai_oauth` 预设绑定。这轮复用这套绑定,每家一张独立保存。Claude 没有 Change Plan 适配器,不要为它新开第四个执行器。Desktop 亲测走旧界面。
4. Codex:旧界面已经能绑。新界面 Change Plan 今天会拒绝 SuperGrok。这轮仍用这一套预览,只允许「认证中心里已经有这个账号」。预览单里仍然不能出现钥匙。不要把旧表单搬进新界面。
5. WorkBuddy:走 `create_workbuddy_save_plan`。已扫码的,先用这份账号拉模型名单,不要再扫一次。WorkBuddy 自己的文件只认地址和钥匙:不要把 OAuth 刷新令牌抄进去。能少填一把钥匙就少填;做不到就老实说卡在文件格式,不要谎报已经写进去。

调研:

- `../08-31-grok-login-trichotomy/research/current-login-surfaces.md`
- `../08-31-grok-supergrok-to-codex/research/current-supergrok-codex-path.md`
- `../08-31-grok-supergrok-to-workbuddy/research/current-workbuddy-save-path.md`

## Compatibility

- Claude「能查到是否登录」的路不变。
- Codex「去认证中心管账号」的说法不变。
- 不关 #42 / #43 整张工单。
- 不装、不升级 Grok。
- ChatGPT 登录(`codex_oauth`)这轮不动。
- 额度查询继续可以读 Grok 秘密文件;登录成功不能靠它。
- 没改模型草稿,#141 B7 就标「这轮没碰」。

## Tradeoffs

- 新界面没有认证中心这一页。扫码用路标指回去,不整页搬迁。
- 官方登录没有「查一下登没登」的命令。双机亲测看的是门开对了、字写对了、人能在终端做完,不是软件显示「已登录」。
- Claude / Desktop 继续走已有 Provider 绑定,不新造 Claude Change Plan。
- Codex 要在现有预览上开窄门。
- WorkBuddy 和 Codex 不是同一扇门。关联的是同一把扫码钥匙,不是同一段写入代码。

## Rollback

登录路标、Claude/Desktop/Codex 写入、WorkBuddy 写入可以分开撤。不要把别人已经做完的登录合同整段撤掉。
12 changes: 12 additions & 0 deletions .trellis/tasks/08-31-grok-first-class-iteration/implement.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{"file": ".trellis/spec/backend/external-agent-p0.md", "reason": "Grok handoff-only auth contract and no vendor-token inference"}
{"file": ".trellis/spec/backend/reuse.md", "reason": "Reuse Auth Center and Change Plan; no second OAuth or executor"}
{"file": ".trellis/spec/frontend/reuse.md", "reason": "Extend AgentAuthStatusPanel and existing chrome instead of forking"}
{"file": ".trellis/spec/frontend/v2-agent-models.md", "reason": "Grok Build Models remain Quick Setup; login is not this page"}
{"file": ".trellis/spec/guides/code-reuse-thinking-guide.md", "reason": "Force reuse of current owners before any new surface"}
{"file": ".trellis/tasks/08-31-grok-login-trichotomy/research/current-login-surfaces.md", "reason": "Three-road start surfaces and copy after PR 167"}
{"file": ".trellis/tasks/08-31-grok-first-class-iteration/summary.md", "reason": "Shared plain-language plan; all windows must match this"}
{"file": ".trellis/tasks/08-31-grok-first-class-iteration/research/hil-matrix.md", "reason": "Dual-machine live acceptance cases"}
{"file": ".trellis/spec/backend/change-plan-executor.md", "reason": "Reuse closed Codex adapters; no fourth operation"}
{"file": ".trellis/tasks/08-31-grok-supergrok-to-codex/research/current-supergrok-codex-path.md", "reason": "Change Plan rejects xai_oauth today; V2 does not observe accounts"}
{"file": ".trellis/spec/backend/workbuddy-configuration.md", "reason": "WorkBuddy save is a separate closed path"}
{"file": ".trellis/tasks/08-31-grok-supergrok-to-workbuddy/research/current-workbuddy-save-path.md", "reason": "WorkBuddy must not copy refresh tokens or use Codex upsert"}
58 changes: 58 additions & 0 deletions .trellis/tasks/08-31-grok-first-class-iteration/implement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Implement — Grok first-class iteration

先读 [summary.md](./summary.md) 和 [use-cases.md](./use-cases.md)。父任务不改产品代码。

下游开工读序(每个子任务都要齐):`summary.md` → 子任务 `prd.md` → `design.md` → `implement.md` → `use-cases.md` → 该任务 `research/` → `implement.jsonl` 里的 spec。

不要从空白开始,也不要只读父任务摘要就改代码。

## Feature inventory

| 编号 | 人能做成的事 | 谁做 | 回写 |
|---|---|---|---|
| F1 | Grok 官方登录/退出找得到,并且不说已经登录 | 登录窗口 | #43 |
| F2 | SuperGrok 扫码的下一步指向认证中心 | 登录窗口 | #43 |
| F3 | 模型页继续只填 API 钥匙 | 登录窗口 | #43 |
| F4 | SuperGrok 能进 Claude Code、Claude Desktop、Codex:每家先看、再改、再检查(Desktop 可在旧界面完成) | 投放窗口 | #42 / #41 / #63 |
| F5 | SuperGrok 能进 WorkBuddy:先看、再改、再检查 | WorkBuddy 窗口 | #42 |
| F6 | 名单上有名字,不等于已经完全支持 | 各窗口改字时都遵守 | #22 / #106 |

## Change inventory

| 编号 | 要改 | 不要改 |
|---|---|---|
| C1 | Grok 认证区的字,点名去终端跑 `grok login` | Claude 那种「查一下真的登了」 |
| C2 | 扫码的下一步指到认证中心 | 新做一套登录;把旧设置页搬进新界面 |
| C3 | Claude Code / Desktop:复用已有 `xai_oauth` 绑定;每家独立保存 | Claude Change Plan 新执行器;和 Codex 写一张单 |
| C4 | 现有 Codex 预览:认证中心已有 SuperGrok 账号时放行;新界面能看见这条路 | 第四套保存;预览单里放钥匙;不打招呼就盖掉原来的 API 钥匙槽 |
| C5 | WorkBuddy 自己的保存预览能用已扫码账号拉模型 | 走 Codex upsert;把刷新令牌抄进 `models.json` |
| C6 | 用自动检查把 F1–F5 钉住 | 没必要就别动模型草稿 |

## Ordered work

1. 先立登录路标,免得投放还在叫人去跑 `grok login`。
2. 再开 Claude / Desktop / Codex:每家独立预览和保存。Codex 先改「准不准预览」,再补新界面能看见的路。
3. 再开 WorkBuddy:走它自己的 Change Plan。
4. 总控把三条线接成一次能走完。
5. William 在两台电脑上按 `research/hil-matrix.md` 亲测。
6. 回写 GitHub,不关整张 #42 / #43。

## Validation

- 各窗口自己的程序检查。
- 总控:`research/hil-matrix.md` 两台电脑都打勾。
- 密码不进仓库。

## Risky files

- `src/v2/pages/agents/AgentAuthStatusPanel.tsx`
- Grok 登录交接(先看,不要轻易改短路径)
- Codex 预览是否放行(`prove_codex_target_credential_capability` 一带)
- Claude / Desktop 的 `xai_oauth` 预设和 `ProviderForm` 绑定
- WorkBuddy `create_workbuddy_save_plan` / `models.json` 写入
- 认证中心现有扫码界面(尽量只指路,不重做)

## Rollback points

- 登录路标撤了,不影响投放写入。
- Claude / Desktop / Codex / WorkBuddy 可以单独关一扇门,不要互相连坐。
59 changes: 59 additions & 0 deletions .trellis/tasks/08-31-grok-first-class-iteration/prd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Finish Grok login and SuperGrok placement into supported tools

先读 [summary.md](./summary.md)。用例总表:[use-cases.md](./use-cases.md)。亲测勾选:[research/hil-matrix.md](./research/hil-matrix.md)。

## Goal

分清三种 Grok 登录;扫码一次 SuperGrok,能用到 Claude Code、Claude Desktop、Codex 和 WorkBuddy。William 在 Windows 和 Mac mini 上亲自走完才算完成。

## Background

- 意图:[Discussion #106](https://github.com/fy-agent/fyagent/discussions/106)。登录回写 [#43](https://github.com/fy-agent/fyagent/issues/43),投放回写 [#42](https://github.com/fy-agent/fyagent/issues/42)。
- 2026-08-31:William 决定关联投放一起做,不拆成「先只做 Codex」。
- 子任务:登录路标;Claude/Desktop/Codex 投放;WorkBuddy 投放。

## Confirmed facts

登录(`08-31-grok-login-trichotomy/research/current-login-surfaces.md`):

- 三条路散在三处。官方登录只交接,不验证。没有 Grok 登录状态命令。不能用 `~/.grok/auth.json` 证明已登录。
- ChatGPT 登录是 `codex_oauth`,和 SuperGrok 扫码不是一把钥匙。

投放(`08-31-grok-supergrok-to-codex/research/current-supergrok-codex-path.md`):

- SuperGrok 扫码是共用认证中心。旧界面已能绑 Claude Code / Claude Desktop / Codex 的 `xai_oauth` 预设。
- 新界面 Change Plan / Quick Setup 只认 API 钥匙,会拒绝托管扫码。有没有账号,页面长得一样。
- Claude Desktop 不在新界面 Agent 目录里,亲测走旧界面。

WorkBuddy:

- 目录允许自己换模型。保存走自己的 Change Plan(地址 + 钥匙 + 模型名),不是 Provider Quick Setup。
- 现在没有 `xai_oauth` 预设。Qoder 不能配第三方模型;TRAE 不能代写模型。

## Requirements

- R1. 三种登录路标分开。官方登录不说已登录。
- R2. SuperGrok 扫码仍只在认证中心。
- R3. 同一份已登录 SuperGrok,能分别写进 Claude Code、Claude Desktop、Codex。每家一张独立预览/保存。失败不连累别人。
- R4. 同一份脑子能写进 WorkBuddy。优先用已扫码账号,不要无故再要一把钥匙。走 WorkBuddy 自己的保存。
- R5. Qoder / TRAE 不写第三方模型。ChatGPT 登录这轮不做。
- R6. 双机亲测全部路径。密码不进仓库。

## Acceptance Criteria

- [ ] AC1. 人能分清官方登录、扫码、API 钥匙。
- [ ] AC2. 官方登录不出现「已验证」。Claude 原来能验证的路还在。
- [ ] AC3. SuperGrok → Claude Code、Claude Desktop、Codex 都能先看再改再检查(Desktop 可在旧界面完成)。
- [ ] AC4. SuperGrok → WorkBuddy 能保存并回读。
- [ ] AC5. 一家失败不谎报另一家成功。
- [ ] AC6. 不关 #42 / #43 整张工单。#141 B7 按有没有改草稿标记。
- [ ] AC7. Windows 和 Mac mini 都按 `research/hil-matrix.md` 走完。

## Out of scope

- 安装升级 Grok(#31、#32)
- 新界面额度看板
- ChatGPT 登录
- Qoder / TRAE 模型写入
- 总门卫
- 写 `~/.grok/auth.json` 冒充登录
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## 2026-08-31 迭代决策(回写,已扩范围)

本轮不新开「把 Grok 收完」的平行 Issue。产品意图继续挂在本讨论。

**本迭代做:**

1. 把官方 `grok login`、FyAgent 自管 xAI 设备码、API Key 三条路在界面上拆开(落地 [#43](https://github.com/fy-agent/fyagent/issues/43))。官方态没有结构化 status,就保持 handoff,不读 `~/.grok/auth.json` 冒充已登录。ChatGPT 登录是另一把钥匙,这轮不做。
2. 用同一份 SuperGrok 设备码,分别投到 Claude Code、Claude Desktop、Codex、WorkBuddy(落地 [#42](https://github.com/fy-agent/fyagent/issues/42);Codex 写入复用 [#41](https://github.com/fy-agent/fyagent/issues/41) / [#63](https://github.com/fy-agent/fyagent/issues/63);WorkBuddy 走自己的保存)。

**本迭代不做:** Grok 安装/升级([#31](https://github.com/fy-agent/fyagent/issues/31)、[#32](https://github.com/fy-agent/fyagent/issues/32))、V2 额度看板、ChatGPT 登录、Qoder / TRAE 模型写入、总门卫(#133)。

不关闭 #42 / #43 整张工单,只回写 Grok 这一刀。
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 2026-08-31 范围说明(B7)

本迭代若改到 Grok Build 模型草稿,会在最新 main 上复验 B7:空草稿未交互不得直接显示 validation error。

完成后在本 Issue 把 B7 标成 `fixed` / `still applies` / `not touched`。B9(Grok Bot 发行方)不在本迭代。
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 2026-08-31 范围说明

Grok Build 的多份安装、版本和更新(#31)以及安装后健康探测(#32)仍然有效,但 **不在本迭代**。

本迭代先收登录三分法和 SuperGrok → Codex。Grok 上的 PATH / `os error 2` / 版本冲突继续留在这两张单上。
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## 2026-08-31 迭代决策(Grok 切片,已扩范围)

#42 仍是「同一接入源投给多个 Agent」的总单,**不关闭本 Issue**。

本迭代把同一份 SuperGrok 扫码,分别投到现在能写的地方:

- Claude Code
- Claude Desktop(旧界面完成即可)
- Codex(新界面 Change Plan 开窄口)
- WorkBuddy(走它自己的模型保存,不是 Codex 那扇门)

每一家一张独立预览/保存。一家失败不谎报另一家已应用。

不做:Qoder / TRAE 模型写入、ChatGPT 登录、安装升级 Grok。

登录边界见 [#43](https://github.com/fy-agent/fyagent/issues/43)。产品意图见 [#106](https://github.com/fy-agent/fyagent/discussions/106)。
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## 2026-08-31 迭代决策(Grok 切片)

#43 仍是「官方订阅逐厂商准入」的总单,本迭代只做 Grok 这一刀,**不关闭本 Issue**。

对齐本 Issue 的验收:

- 官方态:`grok login` / `grok logout`,没有已审查的结构化 status,标为 assisted / handoff,不把打开终端写成已验证。
- 设备码:继续走 FyAgent 认证中心的 xAI OAuth,不读、不写 `~/.grok/auth.json`。
- API Key:第三条路,不和上面两条抢文案。
- 没有官方依据就不做 token relay,也不用额度接口反推登录成功。

产品意图见 [#106](https://github.com/fy-agent/fyagent/discussions/106)。同一订阅分别投到 Claude Code、Claude Desktop、Codex、WorkBuddy 见 [#42](https://github.com/fy-agent/fyagent/issues/42)。
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2026-08-31 验收补充

亲测机器定为当前 Windows 与 Mac mini **都要过**。缺一台的证据不得标完成。凭据仍不进 Git / Issue。
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 2026-08-31 验收补充

本迭代是必要功能。William 有真实 SuperGrok 账号,**必须亲身体验全部在范围内的路径后才能算完成**。合同、测试和 CI 不能替代这次 HIL。

凭据、token、账号标识不进 Git / Issue。完成后只回写不含秘密的路径结论。
Loading
Loading