Skip to content

[FEATURE]: Define native and identity path contracts across client/server boundaries #33107

Closed as not planned

Description

@romanilyin

Feature hasn't been suggested before

  • I have verified this feature request is not a duplicate of an existing proposal.

Describe the enhancement you want to request

OpenCode passes path strings between Desktop, the SDK, the server, SQLite, and filesystem caches, but those values have different jobs:

  • a path usable by the current server process;
  • a stable comparison/storage identity;
  • a user-facing display path.

Mixing those concepts causes recurring failures:

I propose a staged approach:

  1. Validate request directory hints at the HTTP boundary before instance lookup.
  2. Keep native filesystem paths separate from lexical comparison keys and realpath/cache identity.
  3. Add versioned keys only where exact string matching or persistence needs them.
  4. Handle database/App migration and explicit Windows/WSL bridging in later PRs.

I maintain the MIT package @romanilyin/canonicalpath and can keep it behind a small OpenCode wrapper. I already have a narrow first-stage branch with no database or Desktop migration.

Would the maintainers accept this staged contract, and would they prefer the MIT package, an in-tree implementation, or a smaller server-local wrapper first?

Activity

  1. romanilyin commented on Jun 25, 2026

    @romanilyin
    Author

    I have prepared a small first-stage branch for the server-side boundary fix:

    https://github.com/romanilyin/opencode/tree/directory-boundary

    This first stage uses @romanilyin/canonicalpath behind a server-local OpenCode wrapper. It only validates request directory hints before instance lookup and keeps the existing relative-path, empty-query, and raw-header fallback behavior.

    It does not include SQLite/App/session identity migration, symlink/realpath identity changes, or automatic Windows/WSL path translation.

    If maintainers prefer, I can adapt this first PR to use an in-tree implementation instead, or move the wrapper into core later if a shared path contract is the desired direction.

    Unless there is an objection, I plan to open this as a narrow PR1 for review.

  2. github-actions commented on Aug 24, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 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

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions