Skip to content

[regression] opencode 1.2.21 freezes on session start if the current working directory is a symlink #16522

Closed

Description

@smola

Description

The following code fixed it for me:

--- a/packages/opencode/src/cli/cmd/tui/thread.ts
+++ b/packages/opencode/src/cli/cmd/tui/thread.ts
@@ -120,11 +120,14 @@ export const TuiThreadCommand = cmd({
         return
       }

-      // Resolve relative paths against PWD to preserve behavior when using --cwd flag
+      // Use PWD as the base for resolving relative --project paths so that
+      // symlink-aware shells see the right directory. For the no-project case,
+      // use the real OS cwd so that Instance.directory always matches the
+      // canonical path that git and other tools report.
       const root = Filesystem.resolve(process.env.PWD ?? process.cwd())
       const cwd = args.project
         ? Filesystem.resolve(path.isAbsolute(args.project) ? args.project : path.join(root, args.project))
-        : root
+        : Filesystem.resolve(process.cwd())
       const file = await target()
       try {
         process.chdir(cwd)

Plugins

No response

OpenCode version

1.2.21

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Linux, Ubuntu 24.04

Terminal

Ghostty

Activity

  1. added
    bugSomething isn't working
    on Mar 7, 2026
  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 7, 2026
  3. changed the title [-][regressio] opencode 1.2.21 freezes on session start if the current working directory is a symlink[/-] [+][regression] opencode 1.2.21 freezes on session start if the current working directory is a symlink[/+] on Mar 7, 2026
  4. assigned and unassigned on Mar 8, 2026
  5. bnkamalesh commented on Mar 8, 2026

    @bnkamalesh

    same problem for me, pc info:

    Description                  : Debian GNU/Linux 13 (trixie)
    Version                         : 13.3
    Desktop Environment: GNOME Shell 48.7
    Display server              : wayland
    Shell                               : Fish, 4.0.2
    TTY                                 : Gnome terminal
    
  6. Hona commented on Mar 8, 2026

    @Hona
    Member

    oh it - fix shortly

  7. AndrewP-GH commented on Mar 8, 2026

    @AndrewP-GH

    Also faced with this problem!

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions