Skip to content

fix(core): reconnect editor context for session directory#24984

Merged
jlongster merged 3 commits intodevfrom
editor-context-reconnect-2
Apr 29, 2026
Merged

fix(core): reconnect editor context for session directory#24984
jlongster merged 3 commits intodevfrom
editor-context-reconnect-2

Conversation

@jlongster
Copy link
Copy Markdown
Contributor

Issue for this PR

N/A

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The TUI editor context could connect using the process startup directory instead of the active session directory. That meant switching sessions could leave opencode attached to the wrong editor server or stale editor state.

This adds an explicit editor-context reconnect when a session loads, resolves editor lock files against the active session directory, and clears/reopens the socket only when the directory actually changes. The environment-configured editor port still takes precedence, and the new tests cover reconnect behavior, same-directory no-op behavior, and configured port handling.

How did you verify your code works?

  • bun test test/cli/tui/editor-context.test.tsx from packages/opencode
  • bun turbo typecheck via the push hook

Screenshots / recordings

N/A, no visual UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request Apr 29, 2026
…+20240

- anomalyco/opencode#24984 fix(core): reconnect editor context for session directory (merge-after-nits)
- openai/codex#20243 Add codex-core public API listing (merge-as-is)
- openai/codex#20240 [linux sandbox] Isolate IPC namespace in bubblewrap (merge-as-is)
@jlongster jlongster merged commit 293877c into dev Apr 29, 2026
10 checks passed
@jlongster jlongster deleted the editor-context-reconnect-2 branch April 29, 2026 19:11
oleksii-honchar pushed a commit to oleksii-honchar/better-opencode that referenced this pull request Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant