GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — service: background shell silently killed when idle location is evicted; completion notification never delivered · Issue #58050 · anomalyco/opencode

service: background shell silently killed when idle location is evicted; completion notification never delivered #58050

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
service: background shell silently killed when idle location is evicted; completion notification never delivered#58050
Copy link
Labels
pending closetriaging

Description

@luoming319-cloud
luoming319-cloud
opened on Oct 22, 2026
Issue body actions

Summary

Background shells (shell tool with background=true) are tied to the location's lifecycle. When the service evicts an idle location, running background shells are killed, their output files are deleted, and the promised "you will be notified when it completes" event is never delivered — the agent waits forever with no signal.

Environment

  • opencode version: 2.0.32
  • OS: Windows_NT 10.0.19045 (win32 x64)
  • Terminal: TUI (TERM=xterm-256color)
  • Shell: PowerShell (pwsh) spawned by the service
  • Install/channel: latest (autoupdate disabled)
  • Active plugins: none configured; one MCP server (playwright, via npx)

Reproduction

  1. In a session, start a background shell that outlives the location idle window (e.g. a watcher loop polling a remote host every 3 min; observed death after ~60 min idle).
  2. Let the session go idle between turns so the service evicts the location.
  3. Service log shows message="location services evicted" and later message="location services booted" on next access.
  4. The background shell process is gone; its output file under ~/.local/share/opencode/shell/<hash>/ is deleted; no completion/termination event reaches the session. GET /api/shell/<id>/output returns 4xx.

Expected Behavior

The documented contract "you will be notified automatically when the command finishes" should not silently break. Any of: (a) don't evict a location with running background shells; (b) deliver a termination event (with reason) to the owning session on eviction; (c) own background shells at service level instead of location level.

Actual Behavior

Shell killed without notice, output file removed, session never woken. A second identical watcher that completed before the eviction delivered its notification normally, isolating the failure to eviction.

Additional Context

  • The service process itself never restarted (same PID before/after) — not a crash, purely location lifecycle.
  • Timeline: watcher started 15:21 -> location services evicted 16:22:24 (INFO) -> user's GET /api/shell/<id>/output 404 at 16:22:24 -> location services booted.
  • After the re-boot, MCP tools re-registered and the next user message showed "Instructions updated: core/codemode" — consistent with full location re-initialization.
  • Frequency: observed once, timing-consistent; presumably deterministic whenever eviction happens while a background shell runs.
  • Workaround: re-arming the watcher only postpones the same outcome.

Activity

  1. opencode-agent commented on Oct 22, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 22, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the detailed timeline and logs. I think this is a duplicate of #51828: after 60 minutes without session activity, the location is evicted. That kills its running background shells and loses their completion notification. Since a running background shell doesn't count as activity, the location looks idle.

    Possible duplicates and related issues, ordered by likelihood:

    • [Bug] Location inactivity eviction SIGTERMs live background shells after 60 minutes #51828: the same eviction killing background shells, with independent confirmations on 2.0.22 and 2.0.24
    • service: background shell silently killed when idle location is evicted; completion notification never delivered #58049: your own identical report, opened a few minutes before this one
    • Terminals are killed when their location is evicted after 60 minutes of chat inactivity #48691: the same 60-minute eviction killing terminals in the desktop app (comments there also cover shell-tool jobs)
    • [FEATURE]: make the 60m location inactivity TTL configurable (or opt-out) #55305: request to make the 60-minute location TTL configurable or opt-out
    • fix(core): exempt live-child locations from idle eviction #51827 and fix(core): keep background shell locations alive #52580: open pull requests that try to keep locations with live shells from being evicted

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. If you have anything new, such as Windows/PowerShell details, adding it on #51828 would help.

  2. opencode-agent
    added
    pending close
    triaging
    on Oct 22, 2026
  3. luoming319-cloud commented on Oct 23, 2026

    @luoming319-cloud
    luoming319-cloud
    on Oct 23, 2026
    Author
    More actions

    Closing as duplicate of #51828 (same as #58049, same incident). Verified fixed on 2.1.3 — soak data posted on #51828.

  4. luoming319-cloud
    closed this as not plannedon Oct 23, 2026
  5. opencode-agent
    closed this as duplicateon Oct 23, 2026
  6. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 23, 2026 – with OpenCode Agent
    Contributor
    More actions

    We haven't heard back since yesterday, so I'm closing this as a duplicate of #51828. That issue covers the same problem: after 60 minutes of inactivity the location is evicted, which kills running background shells and loses their completion notification. Your identical report #58049 points there too.

    Please follow #51828 for updates. The open pull requests #51827 and #52580 aim to keep locations with live shells from being evicted. If your Windows/PowerShell setup shows something different, please add the details on #51828, or reply here and we can reopen this. Thanks for the clear timeline!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending closetriaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.