Skip to content

doctor --fix crashes with 'Session file path must be within sessions directory' after applying config migrations #18553

@EpaL

Description

@EpaL

Description

openclaw doctor --fix crashes with Error: Session file path must be within sessions directory immediately after applying config migrations. More critically, the same error crashes the Discord guild message handler at runtime, preventing the bot from receiving any guild channel messages.

Environment

  • Version: 2026.2.15 (npm/pnpm install, not git checkout)
  • OS: macOS 26.2 (arm64)
  • Setup: Multi-agent (main + secondary agent "luna"), 15 active sessions
  • Install method: pnpm global

Runtime Impact

Gateway logs show:

discord channels unresolved: 823385078461497365/1465378022885429409, 823385078461497365/1466049469668790305, 823385078461497365/1467585640614068408
Error: Session file path must be within sessions directory
gateway/channels/discord handler failed: Error: Session file path must be within sessions directory

This means guild channel messages are completely broken — the Discord handler crashes on every inbound message. DMs work fine (different code path).

Steps to Reproduce

  1. Multi-agent setup (main + secondary agent)
  2. Configure Discord guild channels in allowlist
  3. Send a message in an allowlisted guild channel
  4. Handler crashes with session path error

Expected Behavior

Guild messages should be received and routed to the agent.

Actual Behavior

Handler crashes. Bot can send to channels but cannot receive messages.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    close:duplicateClosed as duplicatededupe:childDuplicate issue/PR child in dedupe cluster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions