Skip to content

OpenCode integration does not update native session identity after /session switch #2450

Description

@blake-mealey

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
  • I reproduced this bug on the version and environment reported below using the exact steps provided.

Current behavior

After selecting an existing OpenCode session with /session and continuing to chat, Herdr keeps the previously recorded agent_session ID. Restarting Herdr reopens the previous session instead of the session selected in OpenCode.

Expected behavior

The OpenCode integration should track the currently active session after /session selects an existing conversation. After a Herdr restart, that selected conversation should be restored.

Reproduction

  1. Install the OpenCode integration:

    herdr integration install opencode
  2. Start Herdr and OpenCode.

  3. Send a message in a new OpenCode session.

  4. Run /session and select an older existing session.

  5. Send another message.

  6. Run herdr agent list. The agent_session.value still points to the newer session.

  7. Run herdr server stop, then herdr.

  8. OpenCode restores the newer session instead of the selected older session.

Impact

Existing OpenCode conversations cannot reliably be selected and restored across a Herdr server restart. New OpenCode sessions restore correctly.

Environment

  • Herdr version: 0.8.0
  • Update channel: stable
  • Operating system: macOS
  • Terminal: Ghostty
  • OpenCode version: 1.17.8
  • Integration: OpenCode v9
  • Relevant config: native agent restore enabled by default

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions