Skip to content

[BUG] Zed ACP registry mode shows stale Recent sessions (unscoped /session) #16137

Closed

Description

@AutomatorAlex

Summary

When OpenCode is used from Zed via the ACP registry entry, the Recent conversations list appears frozen/stale and does not show newly created sessions.
Switching Zed to custom command mode immediately shows current sessions.

Environment

  • Zed (ACP external agent via registry)
  • OpenCode 1.2.17
  • Registry command entry: opencode acp (from registry.json)
  • Linux (Zorin)

Repro

  1. In Zed, configure OpenCode via ACP registry (not custom command).
  2. Create several new conversations in different project directories.
  3. Open Recent conversations in Zed ACP UI.
  4. Observe list stays on older items (looks like not saving/updating).
  5. Switch to custom command mode (opencode custom type), then re-open Recent.
  6. Observe current conversations appear.

What I verified locally

  • Sessions are persisted in ~/.local/share/opencode/opencode.db (new rows are present).
  • In registry mode, the ACP process runs from a registry path and has no explicit workspace cwd.
  • GET /session (no query) returns the same stale list seen in Zed.
  • GET /session?directory=<active-project-dir> returns expected current sessions.

This looks like a scope/default-directory mismatch for session listing in registry mode, not a DB write failure.

Suspected fix

Either:

  1. Have Zed pass active worktree directory when requesting session history, or
  2. Have OpenCode ACP default /session behavior be workspace-aware / less dependent on process cwd in registry launches.

Extra signal

In one registry-launched process log I also saw:

  • setRawMode failed with errno: 5
    which may contribute to ACP process instability in some runs.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 5, 2026
  2. github-actions commented on Mar 5, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your issue is distinct (specifically about ACP registry mode vs. custom command mode behavior), please add a comment clarifying how it differs from the above.

  3. AutomatorAlex commented on Mar 5, 2026

    @AutomatorAlex
    Author

    Related issue: #8836 think this may be the same session-scope family of bugs, but with different symptoms: #8836: scope appears too broad (global sessions shown) #16137: scope appears wrong/stale in Zed ACP registry mode (unscoped /session returns old /home sessions instead of active workspace recents)

    In my local repro for #16137, sessions are persisted correctly in opencode.db; listing differs depending on whether directory is provided (/session?directory=...).

  4. assigned and unassigned on Apr 26, 2026
  5. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. added a commit that references this issue on Aug 14, 2026
    537f8d9
  7. added a commit that references this issue on Sep 25, 2026
    70e9c5f
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