Skip to content

OSS mode can't start Docker sandboxes since #466: DefaultUserAuth has no user id, so POST /api/v1/sandboxes returns 401 #625

Closed

Description

@aivong-openhands

Summary

Since #466 (merged 2026-09-25), the OSS app server (make run, openhands.server.listen:app) can't start or list Docker, E2B or k8s sandboxes. Every request returns 401 User authentication required.

#466 made this change on purpose: secure_select used to treat a caller without a user id as ADMIN, and now it raises AuthError. The sandbox services also call require_user_id when they start a sandbox. That's the right call for multi-user installs. But OSS mode's DefaultUserAuth.get_user_id() always returns None, so the single-user path now fails. #466 isn't marked as a breaking change, so this looks unintended.

@jlav, was OSS mode meant to keep starting sandboxes after #466?

Impact

Reproduction

Observed on #603's branch at 672180b. The same code is on main.

  1. make local-db
  2. uv run uvicorn openhands.server.listen:app --port 3000 (RUNTIME unset, so Docker sandboxes)
  3. curl -X POST http://127.0.0.1:3000/api/v1/sandboxes returns 401 {"detail":"User authentication required"}.
  4. GET /api/v1/sandboxes/search returns the same 401.

Where (main)

Proposed fix

Give OSS single-user mode a fixed local user id, so its sandboxes get an owner and #466's scoping still applies. Before changing DefaultUserAuth, check what else depends on its user id being None, such as where the settings and secrets stores keep their files.

Don't make require_user_id accept a missing user id. That would undo #466's fix.

Workaround

Set OPENHANDS_CONFIG_CLS to a ServerConfig subclass whose user_auth_class returns a fixed user id. No app code changes.

Acceptance criteria

  • On main, make run with Docker sandboxes can start a conversation.
  • A test covers starting and listing a sandbox with the OSS default auth.
  • A caller with no user id that isn't ADMIN still gets 401 in multi-user setups.

This issue was drafted by an AI agent (OpenHands) on behalf of @aivong.

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