| … | … | @@ -536,6 +565,7 @@ export const make = Effect.gen(function* () { | |
| 536 | 565 | threadId, | |
| 537 | 566 | thread, | |
| 538 | 567 | project, | |
| 568 | + | pendingSubagentRequest: pendingSubagentRequestFor(subagentRequests, threadId), | |
🟠 High relay/AgentAwarenessRelay.ts:568
A parent can keep publishing waiting_for_approval after its subagent request has resolved or the child has been deleted. When publishing is disabled or relay credentials are missing, publishThreadUnsafe returns before trackSubagentRequest updates subagentRequests, and resetPublishedConnection does not clear that cache; reconnecting then passes the stale request into resolveAgentAwarenessRelayPublishSnapshot. Keep the cache current while publication is skipped, or rebuild/revalidate it on reconnection.
🤖 Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/server/src/relay/AgentAwarenessRelay.ts around line 568: |
| 2 | |
| 3 | A parent can keep publishing `waiting_for_approval` after its subagent request has resolved or the child has been deleted. When publishing is disabled or relay credentials are missing, `publishThreadUnsafe` returns before `trackSubagentRequest` updates `subagentRequests`, and `resetPublishedConnection` does not clear that cache; reconnecting then passes the stale request into `resolveAgentAwarenessRelayPublishSnapshot`. Keep the cache current while publication is skipped, or rebuild/revalidate it on reconnection. |
[Opus 5.5][Claude Code] on behalf of shivam.
Fixed in the latest commit. Clearing the cache on reset would drop a child that is still waiting, since a relink doesn't republish everything. So the parent's publish now re-reads each cached waiting child and drops entries whose request is gone, the child is archived, or it no longer exists. Added a test that clears the request while publishing is off; it fails without the change.