HKUDS/nanobot · error · SessionMessageError

expect_reply=true requires reply_timeout_seconds between

Error message

expect_reply=true requires reply_timeout_seconds between {MIN_REPLY_TIMEOUT_SECONDS} and {MAX_REPLY_TIMEOUT_SECONDS}

What it means

Raised by _validate_reply_timeout when expect_reply is true but reply_timeout_seconds is None or outside [MIN_REPLY_TIMEOUT_SECONDS, MAX_REPLY_TIMEOUT_SECONDS]. The reply-wait machinery cannot honor an unbounded or invalid timeout, so the send is rejected before enqueue.

Solutions

  1. Set reply_timeout_seconds to a value within the documented bounds (e.g. 60)
  2. Omit expect_reply (fire-and-forget) if no reply wait is needed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nanobot/agent/tools/session_messages.py:287 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/7df07e70d4ab8b7a. Report an issue: GitHub.

Appendix: source

Thrown at nanobot/agent/tools/session_messages.py:287

                    envelope,
                )

        return f"@{target.name}"

    @staticmethod
    def _validate_reply_timeout(
        expect_reply: bool,
        reply_timeout_seconds: int | None,
    ) -> int | None:
        if not expect_reply:
            return None
        if (
            reply_timeout_seconds is None
            or not MIN_REPLY_TIMEOUT_SECONDS
            <= reply_timeout_seconds
            <= MAX_REPLY_TIMEOUT_SECONDS
        ):
            raise SessionMessageError(
                "expect_reply=true requires reply_timeout_seconds between "
                f"{MIN_REPLY_TIMEOUT_SECONDS} and {MAX_REPLY_TIMEOUT_SECONDS}",
            )
        return reply_timeout_seconds

    def _cancel_pending_reply(self, key: tuple[str, str]) -> None:
        pending = self._pending_replies.pop(key, None)
        if pending is not None and pending.timer is not None:
            pending.timer.cancel()

    def _schedule_pending_reply(
        self,
        key: tuple[str, str],
        timeout_seconds: int,
        target_handle: str,
        request: SessionMessageEnvelope,
    ) -> None:
        pending = _PendingReply(

View on GitHub (pinned to 42f37dc4c0)