anomalyco / anomalyco/opencode

[FEATURE]:Auto-resume interrupted sessions on startup

Open
#44,819 1 comment 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 25, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Feature Request: Auto-resume interrupted sessions on startup

Problem

When OpenCode Desktop is restarted (crash, reboot, close), sessions with interrupted assistant responses lose their partial reasoning. The assistant was mid-thinking but the response was never saved to the database.

Currently there's no way to:

  1. Detect which sessions were interrupted
  2. Auto-prompt the model to continue in those sessions
  3. Distinguish "open tabs" from "closed sessions" in the database

Proposed Solution

Option A: --continue-all flag
opencode --continue-all

On startup, automatically send a "continue" prompt to all sessions where:

  • time_archived IS NULL (active session)
  • Last message.role == 'assistant' (assistant was responding)
Option B: Save partial responses on interrupt

When the app is closing or crashing, save the current in-progress response (including reasoning) to the database. This would allow true "resume from where you left off" behavior.

Option C: Tab-aware session detection

Expose which sessions are currently open as tabs in the Desktop UI, so scripts can target only those sessions.

Current Workaround

I use a PowerShell script that:

  1. Queries session table for active sessions
  2. Checks if last message is from assistant
  3. Sends opencode run -s <id> "Продолжи" to each

But this doesn't know which tabs are actually open in the UI.

Environment

  • OpenCode Desktop v1.18.22 (Windows)
  • 5 tabs: Windows, Other, Games, Network, MiMo 2.5

Why This Matters

Users work on multiple tasks simultaneously in different tabs. When the app restarts, they want all interrupted work to resume automatically without manually clicking into each tab.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.