Skip to content

open_file: support local:// URIs for remote-host sessions #395

Closed

Description

@andrebrait

open_file accepts local:// URIs since #393, but only for sessions on the local host. A session on a remote host gets 501 remote_host_unsupported, because the session's local/ directory lives on that host and the server resolves the URI against its own filesystem.

Expected

open_file with a local:// URI opens the file for a remote-host session as well, with the same authorization rules (session ownership, credential deny list, realpath containment) as for local sessions.

Notes

  • The resolution in lib/session-local-files.ts would need to run against the remote host's session directory, through the existing host transport.
  • Until then, the 501 is the documented limit.

Activity

  1. kahme247 commented on Nov 23, 2026

    @kahme247
    Collaborator

    Verified fixed on current main (head c93b5b13): remote-host sessions can now resolve local:// URIs.

    Evidence on main:

    • remote_host_unsupported no longer occurs anywhere in lib/, server/, app/ or components/ — the 501 documented in this issue is gone.
    • GET /api/sessions/[id]/local-file (app/api/sessions/[id]/local-file/route.ts) resolves the owning host via resolveWorkspaceHost and calls resolved.host.workspaceOps.resolveLocalFile(owner, uri, resolved.sessionFile) — the owning host's daemon resolves and confines the URI on its own machine, with the same 404 file_not_found behaviour.
    • lib/hosts/workspace-ops.ts:198 implements resolveLocalFile on the host transport, with result validation in lib/hosts/workspace-results.ts.
    • lib/hosts/session-local-files.integration.test.mjs covers the remote path, including refusing a daemon that does not advertise resolveLocalFile rather than answering from main's lookalike.

    Closing as fixed on main.

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