[PR #10351] feat: add crossPlatformSessions config option for cross-platform session visibility #13412

Open
opened 2026-02-16 18:18:16 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10351

State: open
Merged: No


Summary

Adds a new config option crossPlatformSessions that allows sessions to be visible across different platforms when syncing the OpenCode data directory.

Problem

When syncing the OpenCode data directory (~/.local/share/opencode) across multiple platforms using tools like Syncthing, sessions created on one platform are not visible on others because:

  1. Sessions are filtered by the directory field in the session list endpoint
  2. Sessions store absolute paths which differ across platforms:
    • Windows: C:\git\github\project
    • macOS: /Users/username/git/github/project
    • Linux: /home/ubuntu/git/github/project

Solution

Added a new configuration option crossPlatformSessions: true in opencode.json that bypasses the directory filtering when enabled, making all sessions visible regardless of the platform where they were created.

Usage

Add to your ~/.config/opencode/opencode.json:

{
  "crossPlatformSessions": true
}

Changes

  • packages/opencode/src/config/config.ts: Added crossPlatformSessions boolean config option with description
  • packages/opencode/src/global/index.ts: Made config/state paths dynamic for test isolation
  • packages/opencode/src/server/routes/session.ts: Modified session filtering logic to check config before applying directory filter
  • packages/opencode/test/server/session-list.test.ts: Added test for crossPlatformSessions functionality

Related Issues

Fixes #10349

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10351 **State:** open **Merged:** No --- ## Summary Adds a new config option `crossPlatformSessions` that allows sessions to be visible across different platforms when syncing the OpenCode data directory. ## Problem When syncing the OpenCode data directory (`~/.local/share/opencode`) across multiple platforms using tools like Syncthing, sessions created on one platform are not visible on others because: 1. Sessions are filtered by the `directory` field in the session list endpoint 2. Sessions store absolute paths which differ across platforms: - Windows: `C:\git\github\project` - macOS: `/Users/username/git/github/project` - Linux: `/home/ubuntu/git/github/project` ## Solution Added a new configuration option `crossPlatformSessions: true` in `opencode.json` that bypasses the directory filtering when enabled, making all sessions visible regardless of the platform where they were created. ### Usage Add to your `~/.config/opencode/opencode.json`: ```json { "crossPlatformSessions": true } ``` ## Changes - `packages/opencode/src/config/config.ts`: Added `crossPlatformSessions` boolean config option with description - `packages/opencode/src/global/index.ts`: Made config/state paths dynamic for test isolation - `packages/opencode/src/server/routes/session.ts`: Modified session filtering logic to check config before applying directory filter - `packages/opencode/test/server/session-list.test.ts`: Added test for crossPlatformSessions functionality ## Related Issues Fixes #10349
yindo added the pull-request label 2026-02-16 18:18:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13412