Skip to content

Improve agent lifecycle and native module compatibility#77

Merged
yohi merged 2 commits into
masterfrom
feature/bun-to-node-migration-docs
May 14, 2026
Merged

Improve agent lifecycle and native module compatibility#77
yohi merged 2 commits into
masterfrom
feature/bun-to-node-migration-docs

Conversation

@yohi
Copy link
Copy Markdown
Owner

@yohi yohi commented May 14, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ec8b2277-0714-4a32-a7ce-5ab58021b325

📥 Commits

Reviewing files that changed from the base of the PR and between 1af3a88 and 15f7b78.

📒 Files selected for processing (2)
  • AGENTS.md
  • SPEC.md
✅ Files skipped from review due to trivial changes (2)
  • AGENTS.md
  • SPEC.md

Summary by CodeRabbit

  • Documentation
    • プラグイン仕様書を更新し、エージェントプールの運用(LRU上限=10、排他取得、クローズ時の5秒タイムアウト、非対称リトライ)や異常時の破棄手順を明確化しました。
    • 利用ガイドを段階的開示形式に再構成し、運用上の範囲管理・シークレット安全性・ログ制約を整理しました。
    • sqlite3の互換性確保のための作業ディレクトリ要件と、非公開の実行オプションに伴うSDKアップグレード時の再確認注意を追加しました。
    • バージョン移行計画ドキュメントを削除しました。

Walkthrough

このプルリクエストは、OpenCode Cursor Provider プラグインのドキュメント(AGENTS.mdSPEC.md)を再構成・明確化し、AgentPool のライフサイクル(LRU 上限、Exclusive Checkout、5秒タイムアウト、非対称リトライ)、disposeAgentSafely の再設計、Agent.create 実行時の sqlite3 用 local: { cwd: process.cwd() } 明示要件を仕様に追記するとともに、Bun→Node マイグレーション計画ドキュメントを削除しています。

Changes

OpenCode Cursor Plugin ドキュメント更新

Layer / File(s) Summary
エージェント指示ガイドの再構成
AGENTS.md
AGENTS.md を段階的開示(progressive disclosure)と構造的フォーマットへ書き換え。プラグイン目的(Cursor Headless SDK のモデル公開)、provider.cursor を注入する ProviderHook(cursor_prompt の置換)、Devcontainer 実行要件、運用上の指針(スコープ管理、シークレット安全性、ログ制約、検証コマンド)を明記。
プール管理と破棄仕様の明確化
SPEC.md
AgentPool の仕様を明文化:LRU 上限 10、Exclusive Checkout、close の 5 秒タイムアウト、非対称リトライの挙動。agent-cleanup.tsdisposeAgentSafely は「例外時のみ 1 回リトライする」非対称破棄手順に書き換え。さらに Agent.create 実行時に sqlite3 の cwd 解決を堅牢化するため local: { cwd: process.cwd() } の明示指定要件を追記し、当該 local オプションが undocumented API である旨の注意を追加。

マイグレーション計画の削除

Layer / File(s) Summary
Bun→Node マイグレーション計画の削除
docs/superpowers/plans/2026-05-12-bun-to-node-migration.md, docs/superpowers/specs/2026-05-12-bun-to-node-migration-design.md
指定のマイグレーション計画ドキュメントがリポジトリから削除(旧コンテンツの除去)。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 書類の道を軽やかに跳ねて、
プラグイン指示は今や明瞭で堅実。
プールは整い、破棄は慎重に、
sqlite の道筋もはっきりと。
古い計画は静かに眠る。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided by the author. プルリクエストの説明を追加してください。変更内容、目的、およびテスト方法を記載することをお勧めします。
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: agent lifecycle improvements (asymmetric retry, timeout behavior) and native module compatibility (sqlite3 working directory resolution).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/bun-to-node-migration-docs

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Line 12: The phrasing "MUST RUN INSIDE DEVCONTAINER: All commands must be
executed within `.devcontainer/`" is ambiguous and can cause users to run
commands from the wrong directory; update the text to explicitly state that
commands must be run inside the Devcontainer environment but executed from the
repository root (e.g., "Open the project in the Devcontainer and run commands
from the repository root, not from the .devcontainer/ directory"). Replace the
current sentence that mentions `.devcontainer/` with this clarified wording and
ensure nearby documentation (the header or examples) consistently use
"Devcontainer environment" and "repository root" to avoid further confusion.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3045aeb2-025a-407e-98d7-ec790911ee25

📥 Commits

Reviewing files that changed from the base of the PR and between 2f740d6 and 1af3a88.

📒 Files selected for processing (4)
  • AGENTS.md
  • SPEC.md
  • docs/superpowers/plans/2026-05-12-bun-to-node-migration.md
  • docs/superpowers/specs/2026-05-12-bun-to-node-migration-design.md
💤 Files with no reviewable changes (2)
  • docs/superpowers/specs/2026-05-12-bun-to-node-migration-design.md
  • docs/superpowers/plans/2026-05-12-bun-to-node-migration.md

Comment thread AGENTS.md Outdated
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 14, 2026

Greptile Summary

Bun → Node.js 移行完了後のドキュメント整理 PR です。実装済みの移行計画・設計書(2 ファイル)を削除し、AGENTS.md をコンパクトな Progressive Disclosure 構造に再編、SPEC.md に移行で得られた知見(LRU 上限 10、非対称リトライ、local: { cwd } の明示)を反映しています。

  • AGENTS.md: Devcontainer 必須化・Biome 導入・--frozen-lockfile 追加などの改善を含む形式に刷新。ただし旧版にあったプロバイダー確認ガイドライン(opencode models cursor 確認)が脱落している。
  • SPEC.md: 5.6 節を新設し Agent.create への local: { cwd: process.cwd() } 追加を文書化。削除される計画書に記載されていた「undocumented API である旨」の注記が引き継がれていない。
  • docs/superpowers/: 全チェックボックス完了済みの計画書と設計書を削除。内容は SPEC.md に取り込まれており問題なし。

Confidence Score: 4/5

ドキュメントのみの変更であり、ソースコードへの影響はありません。安全にマージ可能です。

変更はすべてドキュメントに限定されており、ソースコードや設定ファイルへの影響はありません。AGENTS.md からプロバイダー確認ガイドラインが脱落しており、エージェントが config 変更後の動作検証を省略するリスクがあります。また SPEC.md 5.6 節で local オプションが undocumented API であるという注記が失われており、将来の SDK アップグレード時に見落とされる可能性があります。

AGENTS.md(プロバイダー確認ガイドラインの脱落)と SPEC.md(undocumented API 注記の欠落)を確認してください。

Important Files Changed

Filename Overview
AGENTS.md Progressive Disclosure 構造に再編。Devcontainer 必須化・Biome・--frozen-lockfile 追加などの改善が含まれるが、旧ガイドラインにあった「プロバイダー確認手順」が削除されている。
SPEC.md LRU 上限 8→10、非対称リトライ説明の更新、5.6 節(Agent 生成と native 依存)の追加。local オプションが未公開 API である旨の注記が欠落している。
docs/superpowers/plans/2026-05-12-bun-to-node-migration.md 移行完了済みの実装計画ファイル(全チェックボックスが [x])を削除。意図通りのクリーンアップ。
docs/superpowers/specs/2026-05-12-bun-to-node-migration-design.md 移行に使用した設計書を削除。重要な内容は SPEC.md に取り込まれているため問題なし。

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["AGENTS.md\n(再編)"] -->|参照先| B["SPEC.md\n(更新)"]
    A -->|参照先| C["README.md\n(変更なし)"]
    B --> D["5.6節追加\nAgent.create local: { cwd }"]
    B --> E["LRU上限 8→10\n非対称リトライ記述更新"]
    F["計画書 削除\ndocs/superpowers/plans/\n2026-05-12-bun-to-node-migration.md"] -->|内容移管| B
    G["設計書 削除\ndocs/superpowers/specs/\n2026-05-12-bun-to-node-migration-design.md"] -->|内容移管| B
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
AGENTS.md:25-26
旧 AGENTS.md にあった「プロバイダー確認手順」(`opencode models cursor``cursor/composer-2` がリストされることを確認する)がガイドラインから削除されています。config 変更後にプロバイダー登録が正しく成立しているか検証する手順が明示されなくなるため、エージェントが登録確認をスキップするリスクがあります。

```suggestion
4. **Verification:** Always verify changes by running `pnpm lint`, `pnpm typecheck`, and `pnpm test` before completion.
5. **Let Tools Work:** Delegate code style to the linter (`pnpm lint`).
6. **Provider verification:** After config changes, confirm `opencode models cursor` lists `cursor/composer-2` (or the whitelisted model set).
```

### Issue 2 of 2
SPEC.md:104-105
削除された実装計画ファイルには「`@cursor/sdk@1.0.12` 時点では undocumented option のため、SDK 更新時に再確認が必要」という重要な注記がありました。この注記が SPEC.md の 5.6 節に引き継がれていないため、将来の開発者が `local` が公式 API だと誤解し、SDK アップグレード時の動作確認を怠る可能性があります。

```suggestion
### 5.6 Agent 生成とネイティブ依存
- `Agent.create` 呼び出し時、ネイティブモジュール (`sqlite3`) のワーキングディレクトリ解決を堅牢化するため、明示的に `local: { cwd: process.cwd() }` を指定します。
- **注意:** `local` オプションは `@cursor/sdk@1.0.12` 時点で公開型定義に含まれていない undocumented API です。SDK をアップグレードする際は動作の継続性を必ず再確認してください。
```

Reviews (1): Last reviewed commit: "feat(agent): エージェントライフサイクルとネイティブモジュール互換性..." | Re-trigger Greptile

Comment thread AGENTS.md
Comment thread SPEC.md
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 14, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@yohi yohi merged commit b8aa79f into master May 14, 2026
3 checks passed
@yohi yohi deleted the feature/bun-to-node-migration-docs branch May 14, 2026 02:05
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