Skip to content

Folder drag/paste rejected in desktop thin-client mode even when the server runs on the same machine #27774

Closed

Description

@repparw

What happened

Using the desktop app as a thin client (Local environment off in desktop settings) connected to a t3 serve on the same machine (127.0.0.1), dragging a folder into the composer shows the toast "Folders can only be referenced in the local desktop environment". Clipboard-pasting a folder hits the same code path. Folder references would resolve fine because the connected environment shares the desktop's filesystem.

Diagnosis

addComposerFolders (apps/web/src/components/chat/ChatComposer.tsx, ~line 2673 in v0.1.3) calls folderDropTarget (apps/web/src/components/chat/folderDrop.ts):

if (
  input.localEnvironmentDisabled ||
  input.primaryEnvironmentId === null ||
  input.environmentId !== input.primaryEnvironmentId
) {
  return "remote";
}

localEnvironmentDisabled is window.desktopBridge.getLocalEnvironmentEnabled() === false (apps/web/src/localEnvironment.ts), reading the desktop setting localEnvironmentEnabled (apps/desktop/src/settings/DesktopAppSettings.ts). In "Desktop without a local environment" mode (docs/internals/remote.md) the setting is false and primaryEnvironmentId is null, so folder drops are unconditionally rejected. The gate is a proxy for "does this environment share the desktop's filesystem", but keys on "is this the app's own bundled environment" — a false positive for same-machine saved environments.

Verified on-machine: desktop-settings.json has "localEnvironmentEnabled":false; server on 127.0.0.1:3773 reports serverVersion 0.1.3, machine: "desktop". The gate is unchanged on current main, so v0.1.4/v0.1.5 are also affected.

Steps to reproduce

  1. Turn off Local environment in desktop settings; connect to a t3 serve on the same machine (e.g. http://127.0.0.1:3773).
  2. Drag a folder into the thread composer (or copy the folder and paste it).
  3. Toast: "Folders can only be referenced in the local desktop environment"; nothing is inserted.

Version

0.1.3 (desktop app and server; also present in v0.1.5 and main)

Environment

Linux x64 (kernel 7.3.0), Node v24.22.1, desktop app 0.1.3 → server 0.1.3 at 127.0.0.1:3773

Evidence

~/.t3/userdata/desktop-settings.json: {"localEnvironmentEnabled":false,...}
GET /.well-known/t3/environment → "serverVersion":"0.1.3", "machine":"desktop"
Gate: apps/web/src/components/chat/folderDrop.ts (v0.1.3, identical on main)

Related issues

#26420 is the same thin-client mode but a different symptom ("No environment selected" in Sharing & access). Searched folder-drop/thin-client issues; none match.

Fix applied or workaround

None applied. Workaround: type the folder path with @ (resolves against the connected environment). Files still drag/paste fine (uploads).

Filed by

GLM (glm-5.3-flash) via t3 triage

Activity

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