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

Closed
opened 2026-02-16 17:39:25 -05:00 by yindo · 4 comments
Owner

Originally created by @taqtiqa-mark on GitHub (Dec 2, 2025).

Originally assigned to: @thdxr on GitHub.

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

Originally created by @taqtiqa-mark on GitHub (Dec 2, 2025). Originally assigned to: @thdxr on GitHub. ## 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
yindo added the bug label 2026-02-16 17:39:25 -05:00
yindo closed this issue 2026-02-16 17:39:25 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 2, 2025):

This issue might be related to:

  • #1649: When running in serve mode, the log will contain two session IDs (related to logging issues in serve mode with multiple sessions)

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.

@github-actions[bot] commented on GitHub (Dec 2, 2025): This issue might be related to: - #1649: When running in serve mode, the log will contain two session IDs (related to logging issues in serve mode with multiple sessions) 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.
Author
Owner

@taqtiqa-mark commented on GitHub (Dec 2, 2025):

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

@taqtiqa-mark commented on GitHub (Dec 2, 2025): No #1649 is not relevant. Here the whole log file for another running OC client is deleted.
Author
Owner

@taqtiqa-mark commented on GitHub (Dec 2, 2025):

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.

@taqtiqa-mark commented on GitHub (Dec 2, 2025): 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.
Author
Owner

@taqtiqa-mark commented on GitHub (Feb 5, 2026):

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:

@taqtiqa-mark commented on GitHub (Feb 5, 2026): 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: - [Pi Coding Agent](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent) - [Overview](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/) - [Example development session](https://www.youtube.com/watch?v=ANQ1IYsFM2s)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3265