Todo 53.3: EventPrompt Payload Singleton
Problem
The DOM refresh path removes duplicate generated EventPrompt items, but collectSystemPrompts() in dual_agent currently serializes every prompt item. A stale or user-edited custom item containing the complete generated EventPrompt signature can therefore be sent alongside the managed EventPrompt.
Scope
- At the outbound collection boundary, discard generated-signature custom items in both invocation modes.
- In
dual_agent, retain only the managed event_agent_system item plus ordinary custom prompts.
- In
chat_agent_tools, retain ordinary custom prompts only and send no EventPrompt.
- Preserve prompt order and content for ordinary custom items.
- Do not alter restore, EventPrompt positioning, backend contracts, or UI layout.
TDD Steps
- Change the existing Node behavior test so
dual_agent expects exactly one generated prompt instead of accepting a generated-signature custom duplicate.
- Run the focused test and confirm RED against the current collector.
- Apply the minimal filter in
collectSystemPrompts().
- Verify ordinary custom prompts and managed EventPrompt order remain unchanged.
- Run focused/full WebSocket tests, Node syntax, diff checks, and independent review.
Acceptance
dual_agent serializes ordinary custom prompts and at most one managed EventPrompt.
chat_agent_tools serializes ordinary custom prompts and zero EventPrompt content.
- A generated-signature custom item cannot bypass the outbound boundary.
- EventPrompt visibility, ordering, restore deduplication, and tool-derived content remain unchanged.