Skip to content

Conversation

@athal7
Copy link
Owner

@athal7 athal7 commented Jan 8, 2026

Summary

  • Pass --dir flag when using --attach to specify working directory
  • Update test to verify --dir is included with --attach

Dependency

Requires anomalyco/opencode#7378 to be merged first (adds --dir flag to opencode run).

Fix

This resolves the "Known Issue" documented in README about sessions attached to global server running in wrong directory. Once the upstream PR is merged, this fix enables:

# Sessions now run in correct directory AND appear in Desktop UI
opencode run --attach http://localhost:4096 --dir /path/to/project "fix bug"

When attaching sessions to a running opencode server with --attach,
also pass --dir to specify the working directory. This requires
opencode version that includes anomalyco/opencode#7376.

This fixes the issue where sessions attached to a global server
(worktree='/') would run in the wrong directory.

Closes #104
@athal7 athal7 force-pushed the feat/use-dir-flag-with-attach branch from 3cf5ec3 to a4e916b Compare January 8, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants