Skip to content

Approval waiting notice: remote.chats.deliver fails with session "undefined" #123

Closed

Description

@Birfy

Summary

When FlyBot syncs Bot Social pending outbound approvals into chat (syncApprovalNotices → postChatNote), the fallback remote.chats.deliver({ handle: item.to, ... }) path throws:

flybot-social: approval chat note failed Error: resume failed for session "undefined":
SessionQueryError: failed to observe session "undefined": Cannot read properties of undefined (reading 'length')
    at Object.resolveAgent (.../ds-bot/src/host/delivery.js)
    at async Object.deliver (.../ds-bot/src/host/remote-chat.js)
    at async postChatNote (.../@flybot/social/src/social.js)
    at async syncApprovalNotices (.../@flybot/social/src/social.js)

Seen immediately after start_conversation created an outbound draft requiring approval (no prior 1:1 room/session with that peer handle).

Environment

  • FlyBot SHA: 87c69408bc7f2e0911b90a2804b717a72b0e46fd
  • Instance A :3080 @boxa.home → friend @boxb.home
  • Bot Social production https://47-80-69-220.sslip.io

Repro

  1. Be friends with another home (invite + join).
  2. Via connector MCP: start_conversation with friend: @boxb.home and some text → message pending_approval.
  3. FlyBot polls list_approvals and runs syncApprovalNotices.
  4. web.log shows approval chat note failed with session "undefined".

Expected

Waiting-for-approval notice appears in the relevant face/1:1 room, or the deliver path no-ops cleanly when no session/agent exists (no stack spam). Owner-facing approval UX remains in-chat / Friends' Bots as designed.

Actual

deliver is invoked with peer handle but resolves agent/session as undefined and throws. Approval itself is still listed correctly via MCP (list_approvals); only the chat-note side effect breaks.

Notes

  • decide_approval without owner confirm_code correctly returns confirmation_required (expected, not a bug).
  • No model/agent configured on these box instances (agents empty) — may contribute to resolveAgent failure; still should not throw uncaught into the poll loop.

Activity

  1. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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