Skip to content

Route native client filesystem and system operations to the selected computer #2277

Done

Description

@eric8810

Part of #2269.

User outcome

From a laptop, the operator can work in a directory that exists only on the target machine. They can still paste local content, attach a file from the laptop, and save an export where they expect it. Native TUI and one-shot CLI operations must agree on which computer owns each resource.

Scope

  • The target resolves working directories, directory visibility and permissions, Git and worktree state, workspace file completion, shell commands and model, MCP and runtime settings. Provide target-side one-level directory listing and path validation before Session creation. Enumerate immediate visible directories from the selected parent, including names excluded by workspace file completion. The existing workspace.files.search queries a file index.
  • The terminal owns keyboard input, clipboard, local file selection, display, and the requested local export destination. Remote file references resolve on the target.
  • Spell out how local browser launches and callbacks reach the target that initiated login, including the target's web workspace. Diagnostic and installation actions identify the affected computer.

Acceptance

Run two independently configured servers without a shared filesystem. Give the two computers different file contents at the same path. Browse a remote-only directory containing visible target/ and vendor/, a hidden directory and a regular file. Confirm only the visible directories appear, select one, execute there, attach a local file, select a remote workspace file, export to the laptop, and verify the content at each end. Change a setting on B and verify it through both native clients. Check login callbacks, local browser access and the destination of each relevant native management command.

Activity

  1. added
    enhancement
    on Nov 27, 2026
  2. added
    P2
    on Nov 27, 2026
  3. eric8810 commented on Nov 28, 2026

    @eric8810
    CollaboratorAuthor

    Reproduced with separate filesystems

    A was a macOS terminal running the native TUI in tmux. B was a Linux App Server in a container reached over the native sharing connection. The fixture project directories had the same absolute path, with different contents. A local model fixture on B recorded the submitted input and requested the real read tool. These are Alpha.29 runtime observations. The linked code was checked against main at c43003a1.

    Operator action on A while targeting B Observed result
    Drop a PNG into the TUI, or use exec --image The TUI shows an image marker. Submission fails with a missing-file error, and the draft is retained. The CLI writes the prepared pixels to an A-side temporary file and sends its pathname to B. Image import
    Drop an A-only text file The message succeeds, carrying a Markdown path. B's read reports file not found.
    Drop a text file with different contents at the same path on both computers The message succeeds and B's read returns B's bytes. There is no indication that the file the operator dropped was substituted.
    Type @ in B's workspace Suggestions show the A-only file and omit the B-only file. Supplying the B-only path explicitly lets the same tool read it. Composer root
    Use --target B --cwd <directory-only-on-B> The outer CLI fails while resolving the path on A. With share connect … -- --cwd <same-directory>, the session catalog on B confirms the correct working directory. Argument parsing

    Controls that worked: a 150-line paste was stored byte-for-byte on B, a shell command read B's file, a disabled MCP entry created from A appeared only on B, and both TUI and CLI session export saved B's history on A.

    Proposed repair

    A: dropped file / clipboard image / --image
       -> file contents over the paired native connection
       -> B: import into the selected Session -> return file reference -> submit
    
    A: @query -> B: search the selected workspace -> A: select a B path
              -> B: read the file or prepare the selected image
    
    1. Reuse the native byte stream. The terminal relay already carries an ordered stream in blocks of up to 48 KiB, waits for each write and propagates stream closure. The sharing flow exercises a 1 MiB logical RPC across multiple blocks. On B the normal stream opens the daemon socket, whose reader reconstructs each newline-delimited JSON document and enforces 16 MiB on that whole document. A full-size 16 MiB attachment encoded as a single base64 field would occupy more than 21 MiB. This limits the RPC representation. The byte relay already supports carrying the entire file across successive writes. Relay · Block size and stream destination · Daemon frame reader · Existing sharing case
    2. Add the missing Session attachment receiver. The proposed first implementation to validate is one dedicated stream per selected local file over the paired connection. Bind that stream on B to the intended Session, filename, image flag and expected byte count. Reuse the relay's existing framing, backpressure and closure. B drains the file into private staging, checks the received size, then calls the same attachment importer that WebEntry already uses and returns its committed path or image reference. The receiver binding and completion reply still need to be designed and verified with Web switched off. The existing daemon socket currently only accepts NDJSON. A separate application RPC for each chunk, client-managed offsets and resumable-upload state are unnecessary for this proposal. On cancellation or early EOF, remove partial staging and retain the draft. Submit the message only after its attachments are confirmed. Keep confirmed references scoped to the original device and Session, and preserve the existing handling for a lost submit acknowledgement. An older peer without the receiver reports that the action is unavailable. Upload and import · Attachment ownership and limits
    3. Resolve remote @ on B. Reuse session.files.search for an attached Session and workspace.files.search before one exists. The shared index already returns absolute path, relative path and directory status. Remote image mentions must be opened on B as well. The indexed search currently rejects ~/, absolute paths and ../, while the native picker supports those prefixes. Preserve them through target-side directory lookup that includes files and directories. The existing new-Session directory picker only lists visible directories. Discard late completions after a device or workspace switch. Search implementation · Native picker contract
    4. Resolve explicit remote --cwd on B. Parse the target and workspace together before local filesystem validation, independent of flag order. Keep A's launch directory for local input and export. Pass the target path through to the same remote workspace handling as an explicit connection.

    Suggested delivery order: align the attachment-input and Attachments documents with the remote design, then land the native upload and its callers together. Remote completion and CLI workspace resolution can be reviewed independently. The existing shell, text-paste and export paths provide regression controls. Git worktree discovery and media-task inputs also have client-side path handling to check separately. Browser login and Web access still need their own end-to-end checks.

    Acceptance: use independent filesystems with A-only, B-only and same-path/different-content fixtures. Verify the actual content seen by the model or read tool for local drops and remote mentions, including two different images at the same path. Exercise the 16 MiB boundary, cancellation, a disconnect during upload, device switching with a pending draft, an older peer, and a target-only working directory with either CLI flag order.

  4. self-assigned this
    on Nov 28, 2026
  5. eric8810 commented on Nov 28, 2026

    @eric8810
    CollaboratorAuthor

    #2289 landed on main at 32b931ae3. Local file and image input, remote workspace completion, target-only --cwd, and attachment draft recovery are complete. The earlier two-filesystem investigation also verified remote shell execution and local export of remote history. Terminal verification · Draft retry verification · Two-filesystem observations

    One implementation gap remains visible on the merged tree. The TUI's /resume repository scope runs git rev-parse and git worktree list in a client-side process. When the repository exists only on the selected computer, that process cannot enumerate its sibling worktrees. Client Git lookup

    The remaining two-computer acceptance checks include browser login and callback delivery to the initiating target, access to the target's loopback-only Web workspace, and the machine affected by diagnostic and installation commands. The merged design assigns these checks and Git worktree ownership to this issue. Remaining scope

  6. eric8810 commented on Nov 28, 2026

    @eric8810
    CollaboratorAuthor

    #2295 merged into main and completes the remaining Git worktree change. The native TUI now asks the selected App Server for the repository scope of /resume. Both terminal layouts found sessions in a sibling checkout and handled a single checkout whose path had a trailing slash. Regression tests and terminal screenshots

    #2289 delivered attachment transfer, target-side file completion and remote working-directory handling. The maintainer waived the remaining two-computer acceptance run, including login callbacks, access to the target’s loopback Web workspace and the destination of diagnostic and installation commands. Those checks remain unverified on separate machines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions