Skip to content

feat(gateway): handle launched-driver socket paths that exceed the Unix socket limit #5935

Backlog

Description

@elezar

User Story

I use OpenShell with launched compute drivers (Docker, Podman, VM) and run the gateway under state directories of varying depth, including CI workspaces. I directly encountered the gateway failing to start a driver because its socket path was too long. This affects whether the gateway starts at all.

Problem Statement

The gateway binds each launched driver's Unix socket under $XDG_STATE_HOME/openshell/run/launch-XXXXXX/driver.sock. A Unix socket path is limited to about 104 bytes on Linux and macOS. When the state directory is deep, the driver fails to bind with path must be shorter than SUN_LEN and the gateway does not start. The gateway does not check the length and has no way to recover.

Impact / Why This Matters

Operators with long XDG_STATE_HOME values, such as CI workspaces or per-user directories on shared hosts, get an opaque bind error. Their workaround is to choose a shorter state directory. The VM driver already rejects over-long per-sandbox socket paths with an explicit error, so behaviour is inconsistent.

Desired Workflow

The gateway checks the socket path length before it starts a driver. When the path would be too long, it either names the cause and the fix in the error, or places the launch directory under a short private location such as /tmp/openshell-<uid> (owner-only, checked as the existing socket directory is) and logs a warning. Success: a long state directory never produces a bare SUN_LEN bind error.

Acceptance Criteria

  • A state directory long enough to exceed the socket path limit does not produce a bare bind error.
  • If a fallback location is used, it is private to the gateway's user and the warning names it.
  • A unit test covers a long base directory.

Related: #5384, #5385. Deferred from the launcher PR to keep that change free of new behaviour.

Activity

  1. added
    area:drivers
    on Nov 24, 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

    area:drivers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions