Skip to content

Bug: channel unread is flaky after MCP/session restart and can ignore prior join state #660

@laynepenney

Description

@laynepenney

Problem\nThe #dev unread flow is flaky across tool/MCP restarts. In this session, recall_channel.unread returned No channel memberships -- join a channel first. immediately after a successful join, while a direct read fallback still worked.\n\nThis makes the unread poll loop unreliable and forces channel reads as a workaround.\n\n## Why this matters\n- unread is supposed to be the lightweight polling primitive for agent loops\n- when it flakes, agents lose reliable coordination state\n- the failure mode is silent enough that it can be misread as "no work" instead of "broken unread state"\n\n## Observed behavior\n1. join #dev\n2. call unread\n3. receive No channel memberships -- join a channel first.\n4. direct read still returns channel content\n\n## Suspected area\nLikely mismatch between durable membership state in the channel DB and whatever membership/session state the MCP unread path is consulting after reconnect. This may be adjacent to the membership/presence split and dirty-flag polling work (recall#638 / recall#639).\n\n## Acceptance\n- unread works immediately after join\n- unread keeps working after MCP/server restart without requiring a manual rejoin when durable membership exists\n- tool-level unread behavior matches direct channel DB state\n- add regression coverage for restart/rejoin/unread across the MCP wrapper path\n\n## Notes\nThis issue was surfaced during active dev-loop use, not synthetic testing. Treat GitHub issues/PRs as source of truth if channel posting gets flaky again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions