Skip to content

Persist follow-up wake sent-state in the answer auto-wake coordinator #100

Description

@dasomji

Parent

Review findings on #96.

What to build

The agent must receive exactly one "answers available" wake per delivered answer, across server disconnects and re-registrations. Today the dedup for a follow-up that has been sent but not yet persisted by Pi lives only in an in-memory set that is discarded when the coordinator stops; the replacement coordinator's recovery re-sends the wake, so the agent gets two wakes and calls get_answer twice. Conversely, if Pi's follow-up queue is cleared, the id stays in the in-memory set forever and the wake is never retried.

Persist a sent marker (or dedupe against Pi's actual queued messages) so recovery is correct in both directions.

Acceptance criteria

  • Test: answer arrives mid-turn, coordinator stopped and re-registered before the follow-up persists → one wake only
  • Test: Pi queue cleared after send → wake is retried on next refresh
  • Existing auto-wake tests remain green

Blocked by

  • None — can start immediately

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentReady for an implementation agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions