Skip to content

feat(webui): 更新了但仍在运行的 World 留在原位,等进程重启 - #379

Open
kwk1001 wants to merge 1 commit into
mainfrom
feat/world-update-pending
Open

kwk1001 wants to merge 1 commit into
mainfrom
feat/world-update-pending

Conversation

@kwk1001

@kwk1001 kwk1001 commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #378

中文

在已加载的 World 上装了新版本后,/api/extensions 把它报成 pending-restart,WebUI 就把它放进「待生效」,标「已安装,待重启」。可进程在重启前跑的一直是启动时加载的旧版本,所以状态灯、开关和左栏入口都还在,和「待生效」自相矛盾。只重启这一个 World 也换不到新版本:/api/worlds/restart 重新挂载的是内存里已有的实例。

这个 PR 只改「我的 World」页:

  • 新版本装在已加载版本之上(state === 'pending-restart' && loaded)的 World 留在原位,状态、状态灯、开关和左栏入口照旧。
  • 名字后面原来放「有更新」箭头的位置,换成同样式、同颜色的旋转图标:悬停显示「重启进程后生效 vX → vY」,点击弹出现有的重启进程确认,确定后重启。
  • 「待生效」只放进程启动后新装、还没加载的包(以及已卸载的,和原来一样)。

实现:worlds/library.ts 加 updatePending(item),needsRestart 不再包括它;ExtensionController 加 restart(),复用现有的重启流程;新文案 11 种语言都有。

重启前,WebUI 发出的面板产物可能已经是磁盘上的新版本,这是 #378 的问题,这个 PR 不改。

测试:更新后的 World 留在原位,图标写明版本并提供重启;只有新装的包进「待生效」。pnpm test、pnpm run typecheck、pnpm typecheck:web 通过。本机上有 Cortico 进程在跑,所以没有运行 pnpm build:web。

Coopanion 设置页的同一改动:Pal-AI-Lab/Coopanion#629。

🤖 Generated with Claude Code

在已加载的 World 上装了新版本,原先它会进「待生效」,可它其实仍在跑旧版本:状态灯、开关和左栏入口都还在。
现在它留在「我的 World」原位,名字后面在更新箭头的位置换成同色的旋转图标:悬停显示
「重启进程后生效 vX → vY」,点击弹出现有的重启进程确认。「待生效」只放进程启动后新装、还没加载的包。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 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-11-04T23:51:43.290406Z 086fb9c 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.

// package's page, where the update is.
if (pack && market && updatePending(item)) {
const owner = market;
heading.append(iconButton('refresh', S.updatePendingRestart(pack.version ?? '?', pack.installedVersion ?? '?'), 'world-name-update world-name-pending', () => void owner.restart()));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

docs/webui.md 把 src/web/client/features/worlds/index.ts 列为 owner,并且写着「名称旁保留可用更新入口」。这个 hunk 在同一位置改成了进程重启图标,页面没有跟着改。

AGENTS.md §8:「The commit that changes the owner changes the page.」

请把 docs/webui.md 改到与现行为一致,或把偏离这条规则的理由写进 PR 描述。

— Cortico PR Gate via Cursor Cloud Agent

@cursor
cursor Bot requested a review from Phantivia November 4, 2026 23:53

This branch has not been deployed

No deployments
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.

1 participant