Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

deleteSubAgent doesn't stick while a client is still connected

オープン
#2,003 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@cjol がすでに取り組んでいます。

2026年8月5日 から。

評価

この issue はまだ評価されていません。

説明

Steps:

  1. A client opens a WebSocket to a sub-agent (a /sub/... path through the parent).
  2. The parent calls deleteSubAgent for that sub-agent. hasSubAgent now returns false.
  3. The client sends one more message, or just disconnects.
  4. hasSubAgent returns true again. The sub-agent is back, with fresh state.

Expected: the sub-agent stays deleted.

Cause: the parent routes every incoming WebSocket frame with _cf_resolveSubAgent, which creates the sub-agent when it doesn't exist. deleteSubAgent doesn't close open connections. So the old connection survives the delete, and its next message (or its close event) recreates the sub-agent it was pointing at.

Repro on main (a68736f), using the existing test agents:

const parent = await getAgentByName(env.TestSubAgentParent, parentName);
await parent.subAgentPing(childName);
const ws = await connectWS(
  `/agents/test-sub-agent-parent/${parentName}/sub/counter-sub-agent/${childName}`
);

await parent.subAgentDelete(childName);
expect(await parent.has("CounterSubAgent", childName)).toBe(false);

ws.send("straggler"); // or just ws.close()
await expect.poll(() => parent.has("CounterSubAgent", childName)).toBe(true);

Workaround: in _cf_forwardSubAgentWebSocketMessage and _cf_forwardSubAgentWebSocketClose, check hasSubAgent first and drop the frame when the sub-agent is gone.

主要言語
TypeScript
スター
5.6k
フォーク
726
平均マージ
1日 8時間
マージ済み PR(30日)
103

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cloudflare/agents のほかの issue

cloudflare/agents の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。