Skip to content

feat: add non-blocking auto-update to OpenCode plugin#38

Open
slipb wants to merge 3 commits into
jnMetaCode:mainfrom
slipb:feat/opencode-auto-update
Open

feat: add non-blocking auto-update to OpenCode plugin#38
slipb wants to merge 3 commits into
jnMetaCode:mainfrom
slipb:feat/opencode-auto-update

Conversation

@slipb
Copy link
Copy Markdown

@slipb slipb commented May 23, 2026

改动内容

OpenCode 插件启动时自动执行 npx -y superpowers-zh 更新 skills。

新增功能

  • 非阻塞自动更新:启动后延迟 2 秒后台异步执行更新,不阻塞 OpenCode 启动
  • 用户通知:更新成功/失败通过 TUI toast 通知
  • 错误隔离:更新执行和通知展示独立 catch,互不影响

技术细节

  • 使用 Node.js 内置 child_process.exec + util.promisify,零依赖新增
  • 2 秒延迟 + 120 秒超时,安全可靠
  • showToast 失败静默忽略,不误判为更新失败

相关 Issue

自检清单

  • 语法检查通过 (node --check)
  • 非阻塞启动(config 钩子立即返回)
  • 错误完全隔离
  • 零外部依赖

Vibe coding ✨

Ricky added 3 commits May 23, 2026 19:14
On OpenCode startup, the plugin now automatically runs `npx -y superpowers-zh`
in the background (delayed 2s, timeout 120s) to keep skills up to date.

- Non-blocking: config hook returns immediately, auto-update runs asynchronously
- Error isolation: exec and showToast failures handled independently
- User feedback: success/warning toast via client.tui.showToast
- Zero new dependencies: uses only Node.js built-in child_process + util
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