Skip to content

feat(extensions): 详情可安装任一历史版本,扩展卡片交互调整 - #178

Merged
Phantivia merged 9 commits into
mainfrom
codex/extensions-history-recovery
Oct 7, 2026
Merged

Phantivia merged 9 commits into
mainfrom
codex/extensions-history-recovery

Conversation

@kwk1001

@kwk1001 kwk1001 commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

中文

扩展详情改为“历史版本”,列出 registry 中仍存在的全部发布版本,并为可安装版本提供安装、更新或回退操作。切换前确认共享影响和重启要求,服务端在共享目录锁内核对原安装版本、扩展类别和契约,安装后校验实际包名、版本及固定依赖声明。

安装与卸载在同级临时副本中执行,包管理器失败时保留正式安装,文件替换失败时恢复原文件。Windows junction 和 pnpm virtualStoreDir 随目录切换重新定位,错误写入现有日志。恢复未完成时保留备份和目录锁。清理失败返回临时目录路径;安装失败原因与清理错误一同返回。配置、Memory 与部署数据保持原状。

已安装卡片点击或使用 Enter / Space 打开详情,移除详情、管理 World 按钮和分割线;垃圾桶放到状态行并采用两次点击确认,点击别处或 Esc 取消。错误移到“信息”标题下,空历史增加间距,展开历史时保持窗口尺寸,垃圾桶下移 2 像素改善视觉对齐。

English

Extension details now list every registry release under History and offer exact-version installation, upgrade, or rollback. The server checks the expected disk version under the shared installation lock, validates the target contract, and verifies the prepared package and exact dependency pin before publication. Package operations use a sibling staging directory with restoration on replacement failure, including Windows junction and pnpm virtual-store rebasing.

Installed cards open details directly with keyboard support. Deletion uses an inline trash confirmation beside the status, package errors appear below Information, and opening history preserves the modal dimensions. Configuration, Memory, and deployment data are retained; incomplete restoration preserves the backup and lock for inspection. Cleanup failures retain the temporary directory path and the original installation diagnostic.

Checks

  • pnpm test — 255 files passed; 4832 tests passed, 2 skipped
  • pnpm run typecheck
  • pnpm typecheck:web
  • A bug fix carries a test that fails before the fix — failure preservation, replacement restoration, stale requests, incompatible targets, and UI confirmation / retry behavior
  • Delayed-refresh rollback test and real file-lock / directory-permission cleanup tests
  • pnpm build:web
  • Browser verification of card navigation, trash confirmation cancellation, history rows, fixed modal dimensions, and icon alignment
  • Manual offline pnpm probe with temporary local packages; existing user extensions were not changed

维护者追加(合并前):维护者追加了提交 345cf23,把这个 PR 收窄为下面的内容;下面是收窄后的范围,上面的原描述保留供参考。

  • 保留:详情列出 registry 里现存的全部版本(不再只取 6 个),每个历史版本可以安装,走现有的 check → install 流程(pnpm add name@version),重启后生效;已装的版本标为当前版本;卡片交互调整(点卡片开详情、两次点击删除、图标位置)照原样保留,删除确认里仍写明会影响使用它的其他 Bot。
  • 删去:POST /api/extensions/version 与 changeVersion、src/extensions/install.ts 的目录副本与 .install-lock、--save-exact、src/extensions/versions.ts、历史行的 kind/problems 与 expectedVersion 核对。原因:check + install 已经覆盖安装指定版本;目录事务每次复制整个 extensions/、依赖 pnpm 内部格式、进程中途退出会留下锁,又没有失败记录证明需要它。
  • 修正:确认框与结果提示改成整句(原来拼出「安装此版本扩展版本?」),删去不再引用的文案与只测实现细节的断言,docs/extensions.md 的 owner 行恢复原样。

kwk1001 added 4 commits October 4, 2026 00:09
Dependency changes are prepared in an isolated sibling directory. Replacement errors restore original files; shared-directory operations use a file lock. Tests cover failures, junctions, local links and histories beyond six versions.
Version changes verify the previous disk version under the shared installation lock and validate the prepared package before replacing dependencies. Windows junctions and pnpm virtual store paths remain inside the prepared tree until publication.

Tests cover stale requests, incompatible targets, failed package operations, and restoration of the original installation.
Installed cards open details directly and place deletion confirmation beside the status. History rows offer exact version changes with shared-installation confirmation and show operation failures below the information heading.

The browser preserves modal dimensions when history opens. UI tests cover card navigation, deletion confirmation cancellation, version changes, and retry after failure.
The flex baseline placed the trash glyph above the status text. A two-pixel visual offset aligns the icon in both collapsed and confirmation states; verified in the browser.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-04T04:44:28.483748Z cc6536f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread docs/extensions.md Outdated
Comment thread docs/extensions.md Outdated
Comment thread src/extensions/install.ts Outdated
Comment thread src/extensions/install.ts Outdated
@cursor
cursor Bot requested a review from Phantivia October 4, 2026 04:41
kwk1001 added 2 commits October 4, 2026 00:51
The rollback test assumed thirty microtask turns completed the request and refresh chain. It now waits for the resulting UI state and holds the update response to verify pending behavior.
Throwing from cleanup replaced the original package or restoration diagnostic. Cleanup now appends its failure and retained path to the operation error; successful publication returns a cleanup warning. Unsupported cleanup retries are removed.

Real file locks or directory permissions exercise both failed-operation and successful-publication cleanup paths. Recovery documentation names the retained backup and installation lock.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上一轮四处意见在当前 diff 里都不成立了:文档不再叙述卡片与点击;恢复未完成时写的是 .backup 与 .install-lock;清理重试已去掉;清理失败把路径追加到原来的安装错误上,不再覆盖。

— Cortico PR Gate via Cursor Cloud Agent

Open in Web View Automation 

Sent by Cursor Automation: Cortico PR Gate

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with #187。文本冲突在 src/web/client/features/extensions/index.ts:本 PR 把已安装卡片的作者行留作上下文并改状态节点;#187 改同一处作者取值。语义冲突:本 PR 把已安装卡片标题从 button 改成 span,#187 新增测试用 button(..., '甲扩展') 打开详情,两份合在一起后该测试会找不到按钮。

— Cortico PR Gate via Cursor Cloud Agent

Open in Web View Automation 

Sent by Cursor Automation: Cortico PR Gate

@cursor cursor Bot mentioned this pull request Oct 7, 2026
5 tasks done

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与 #187 的冲突不再成立:#187 的回归测试改为点击 .extension-card-title,与本 PR 把标题改成 span 可以共存;两份分支 Git 合并无冲突。

— Cortico PR Gate via Cursor Cloud Agent

Open in Web View Automation 

Sent by Cursor Automation: Cortico PR Gate

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与 #187 的冲突不再成立。当前 #187 与本 PR 可由 Git 自动合并;#187 的作者回归测试改为点击 .extension-card-title,不再依赖标题 button。

— Cortico PR Gate via Cursor Cloud Agent

Open in Web View Automation 

Sent by Cursor Automation: Cortico PR Gate

Comment thread docs/extensions.md Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with #187。文本冲突在 src/extensions.ts。

本 PR 删掉 newerVersion 并改 install();#187 所在分支(已含 main)仍留着这两处。两份合在一起时 Git 无法自动合并。

— Cortico PR Gate via Cursor Cloud Agent

Open in Web View Automation 

Sent by Cursor Automation: Cortico PR Gate

Phantivia and others added 3 commits October 7, 2026 17:10
…ory-recovery

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 删除 POST /api/extensions/version 与 ExtensionManager.changeVersion 及其测试:
  历史版本行直接调用 operate('install', { name, version }),经 /api/extensions/check
  核对类别与契约后由 /api/extensions/install 执行 pnpm add name@version,完成后检查更新。
- 删除 src/extensions/install.ts(临时副本、.install-lock、恢复逻辑)、.gitignore 的
  /.extensions-operations-*/ 与客户端对「临时文件清理失败」的判断:装卸仍按原样串行跑在
  extensions/ 里,这套恢复机制没有对应的故障记录。
- 删除 install() 的 --save-exact:更新与手动安装按用户给的版本范围写入依赖。
- 删除 src/extensions/versions.ts 与客户端对它的运行时导入,newerVersion 回到
  src/extensions.ts;历史行按钮统一为「安装此版本」,已装版本显示「当前版本」并禁用,
  本机链接安装的包全部禁用。
- 删除历史行的 kind/problems 与 expectedVersion 核对:类别与契约由 check 判定。
- 删除卡片改版后不再引用的 manage/details/create 等文案;确认标题改为整句,不再拼接按钮文字。
- 删除键第一次点击时在卡片内显示 removeBody,删除前说明会影响共用扩展目录的其他 Bot。
- 测试去掉只检查实现细节的断言(.extension-card-actions 为空、标题是 SPAN),
  历史版本测试改为断言 check 与 install 的请求体和抽屉内的结果。
- docs/extensions.md 的 Owner 行恢复,安装机制说明换成一句与代码一致的描述。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ory-recovery

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Phantivia Phantivia changed the title feat(extensions): 历史版本切换、失败恢复与卡片交互调整 feat(extensions): 详情可安装任一历史版本,扩展卡片交互调整 Oct 7, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR 描述仍在陈述当前 diff 里不存在的安装恢复路径。

本检查「The PR description states something about this codebase that is false」。

描述写:「服务端在共享目录锁内核对原安装版本、扩展类别和契约,安装后校验实际包名、版本及固定依赖声明。」「安装与卸载在同级临时副本中执行,包管理器失败时保留正式安装,文件替换失败时恢复原文件。」「Windows junction 和 pnpm virtualStoreDir 随目录切换重新定位。」「恢复未完成时保留备份和目录锁。」「清理失败返回临时目录路径;安装失败原因与清理错误一同返回。」Checks 仍勾「failure preservation, replacement restoration」与「real file-lock / directory-permission cleanup tests」。

src/extensions.ts 的 install() 对 extensions/ 直接 pnpm add,进程内 exclusive 互斥;历史行经现有 check 后 operate('install', { name, version })。345cf23 已删掉 POST /api/extensions/version、src/extensions/install.ts、.install-lock 与 --save-exact。沿这条路径找不到共享目录锁、原安装版本核对、安装后包名/版本/固定依赖校验、同级临时副本或替换失败恢复。

请把这些路径仍然存在的证据写入描述,或从描述里删掉这些句子。

— Cortico PR Gate via Cursor Cloud Agent

Open in Web View Automation 

Sent by Cursor Automation: Cortico PR Gate

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

与 #187、#190 的冲突不再成立:两者都已合入 main,本分支已合并 main。

— Cortico PR Gate via Cursor Cloud Agent

Open in Web View Automation 

Sent by Cursor Automation: Cortico PR Gate

@Phantivia
Phantivia merged commit df07f8f into main Oct 7, 2026
3 checks passed
@Phantivia
Phantivia deleted the codex/extensions-history-recovery branch October 7, 2026 23:27
@Phantivia

Copy link
Copy Markdown
Member

谢谢 @kwk1001!已合并。合并前维护者把范围收窄了(详见描述末尾):保留「详情列出全部历史版本、可安装任一版本」和卡片交互调整,安装走现有的 check → install 流程;删去了新端点、目录事务与安装锁、--save-exact 和版本比较模块。卡片改版照原样保留,删除确认里仍写明会影响其他 Bot。会随下一个版本发布。

@Phantivia Phantivia mentioned this pull request Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants