Skip to content

Sessions not visible across platforms when syncing data directory (cross-platform session visibility) #10349

Closed

Description

@ErcinDedeoglu

Description

When using Syncthing (or similar tools) to sync the OpenCode data directory (~/.local/share/opencode) across multiple platforms (Windows, macOS, Linux), sessions created on one platform are not visible on other platforms.

Root Cause

Sessions are filtered by the directory field in packages/opencode/src/server/routes/session.ts:

if (query.directory !== undefined && session.directory !== query.directory) continue

Sessions store the absolute path where they were created:

  • Windows: C:\git\github\ercin\wow-dump
  • macOS: /Users/ercin/projects/wow-dump
  • Linux: /home/ubuntu/wow-dump

Since these paths don't match across platforms, sessions created on one platform are filtered out on others.

Steps to Reproduce

  1. Set up Syncthing to sync ~/.local/share/opencode between Windows and macOS/Linux
  2. Create a session on Windows in directory C:\git\github\project
  3. Open OpenCode on macOS/Linux in the equivalent directory /Users/username/git/github/project
  4. The Windows session is not visible in the session list

Expected Behavior

Sessions should be visible across platforms when syncing the data directory, especially for:

  • Global sessions (not tied to a specific project)
  • Sessions where the user explicitly wants cross-platform visibility

Proposed Solution

Add a configuration option like showAllSessions: true in opencode.json that bypasses the directory filtering:

const config = await Config.get()
if (!config.showAllSessions && query.directory !== undefined && session.directory !== query.directory) continue

Alternatively:

  1. Normalize paths - Store relative paths or use a project identifier instead of absolute paths
  2. Path mapping - Allow users to define path equivalences in config (e.g., C:\git ↔ /Users/x/git)
  3. Show all global sessions - At minimum, make sessions in the global/ folder visible everywhere

Environment

  • OpenCode version: 1.1.34
  • Platforms: Windows 11, macOS, Ubuntu Linux
  • Sync tool: Syncthing 2.0.13

Related Issues

Activity

  1. github-actions commented on Jan 24, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    These issues relate to the same root cause: sessions store absolute paths that are platform-specific, causing filtering and visibility issues across different contexts. Your cross-platform syncing scenario is a specific manifestation of this broader directory path handling problem.

    Feel free to ignore if none of these address your specific case.

  2. added a commit that references this issue on Jan 24, 2026
    d6d4d3c
  3. added a commit that references this issue on Jan 24, 2026
    bf2a646
  4. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions