Skip to content

fix(mcp): retain RagMcpAgent stub class to satisfy migration history #111

Description

@liplus-lin-lay

目的

#109 の merge 後に wrangler deploy を走らせたところ下記エラーで失敗。旧 RagMcpAgent class を stub として残して解消する。

[ERROR] New version of script does not export class 'RagMcpAgent' which is
depended on by existing Durable Objects. Did you forget to include it?
If you renamed it, try a rename-class migration. [code: 10064]

前提 (検証済み)

  • fix(mcp): force reset RagMcpAgent DO to clear stale init() schema cache #109 で class RagMcpAgent → RagMcpAgentV2 に rename、migration v2 で new_sqlite_classes=[RagMcpAgentV2] 追加
  • Cloudflare は v1 の new_sqlite_classes=[RagMcpAgent] で declare したクラスを script が export し続けることを要求する
  • rename-class migration を後付けで追加する選択肢もあるが、renamed_classes は state を保持するため in-memory init() cache も引き継がれる可能性が残る。別 namespace を作って fresh init() を強制したい本件の目的に反する

制約

  • V2 は別 DO namespace として新 init() を走らせたい (本 PR 目的)
  • 旧 RagMcpAgent storage はこの PR では触らず orphan のまま残す (別 PR で deleted_classes 経由で掃除)
  • stub class は traffic を受けないため、最小の DurableObject 実装で OK

対象ファイル

  • src/mcp.ts — RagMcpAgent を DurableObject 継承の空 stub として残す
  • src/index.ts — stub の export を追加

関連

Activity

  1. added this to the milestone on Apr 23, 2026
  2. added
    bug動いていない、壊れている
    in-progress着手中、実装または検証が進行中
    ready本文が実装開始できる形まで収束している状態。ただし更新は継続可能
    on Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug動いていない、壊れているin-progress着手中、実装または検証が進行中ready本文が実装開始できる形まで収束している状態。ただし更新は継続可能

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions