Skip to content

Log File Deleted When Multiple IDE Instances Are Attached to OpenCode Server #4999

Closed

Description

@taqtiqa-mark

Description

Environment

  • OpenCode v1.0.128 installed via curl script in a containerized setup.
  • Server running locally using opencode serve.

Steps to Reproduce

  1. Start the OpenCode server with opencode serve.
  2. Attach the first IDE instance using opencode attach, which creates a log file.
  3. Attach a second IDE instance using opencode attach.
  4. Confirm server container instance ID has not changed.

Expected Behavior

Each IDE instance should maintain its own log file, or separate logs should be preserved for concurrent sessions without deletion or overwriting.

Actual Behavior

Upon attaching a new IDE instance, the previous log file is deleted, and a new log file is created with a timestamp corresponding to the most recent attachment. As a result, with multiple (e.g., two) IDE instances open, only one log file exists, reflecting the latest launch time. This leads to loss of logs from earlier instances.

Impact

This behavior hinders debugging and monitoring of multiple concurrent IDE sessions, as historical logs are not retained.

Suggested Resolution

Consider implementing server log file AND per-attach-instance log files (e.g., differentiated by session ID or timestamp) or appending to existing logs instead of overwriting.

OpenCode version

v1.0.128

Operating System

Linux (Debian testing)

Terminal

Alacritty+Zellij

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 2, 2025
  2. github-actions commented on Dec 2, 2025

    @github-actions
    Contributor

    This issue might be related to:

    While not exact duplicates, both issues deal with serve mode logging problems affecting multiple sessions. Feel free to check that issue to see if there's any shared context.

  3. taqtiqa-mark commented on Dec 2, 2025

    @taqtiqa-mark
    Author

    No #1649 is not relevant. Here the whole log file for another running OC client is deleted.

  4. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 3, 2025
  5. taqtiqa-mark commented on Dec 3, 2025

    @taqtiqa-mark
    Author

    Hmmm, I see the same behavior when i switch to just using the TUI (no opencode serve then opencode attach).
    However in the TUI scenario the logs contain much more data - in the serve-attach scenario there was generally only one line in the file.

  6. taqtiqa-mark commented on Feb 6, 2026

    @taqtiqa-mark
    Author

    In the spirit of calling out excellent engineering and design....

    I've found that the Pi Coding Agent is more robust and, for me has none of the issues that I've encountered in OC, or has an elegant way to resolve them.... I'm dropping out of OC issues:

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 working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions