Skip to content

fix: let a pending sandbox boundary request survive a host restart #1612

Closed

Description

@Astro-Han

What happened

When the host restarts while a sandbox boundary request is awaiting the user, the prompt disappears and the turn ends as failed. There is no way to answer it or resume the task.

The response authority is in-memory: RuntimeKernel.sandboxBoundaryRequestOwners (packages/runtime/src/runtime-kernel.ts:1911) is a Map keyed to a backend generation, and respondToSandboxBoundary throws once that generation is gone. activePermissionOverlayEvent (packages/runtime/src/runtime-read-model.ts:409-423) rebuilds only the permission actions from the ledger, not boundary ones, so the request cannot be recovered from durable state either. Recovery then settles every persisted pending request as deny with closureReason: 'host_restarted' (packages/runtime/src/session-manager.ts:915-918).

Denying is correctly fail-closed and nothing hangs. The gap is that a request the user never saw resolved is silently closed against them, and the turn is lost with it.

Expected: after a restart, either the pending request is presented again and answerable, or the user is told it was closed because the host restarted.

How to reproduce

  1. Start a session and have the agent request a sandbox boundary expansion.
  2. Leave the prompt unanswered.
  3. Quit and relaunch Desktop.
  4. Reopen the session.

Actual: no prompt, turn failed, no explanation. Expected: the request is answerable again, or its closure is explained.

Environment

  • Maka commit: 1f67e0c5d
  • OS: macOS 26.5.2
  • Surface: Desktop
  • Node.js: v26.5.0

Logs, screenshots, or additional context

Found while investigating #1607. Independent of that fix — #1609 changes only the read-model projection and does not touch pending-request authority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions