anomalyco / anomalyco/opencode

TUI prints AbortError stack traces after Ctrl+C during startup

Open
#45,409 2 comments 0 reactions 1 assignee View on GitHub

@simonklee is already working on this.

Since Aug 26, 2026.

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

Description

Description

Pressing Ctrl+C while the TUI's initial location-data refresh requests are still pending exits the TUI, but then prints one or more full AbortError / DOMException stack traces.

Expected behavior: Ctrl+C exits cleanly because cancellation of these requests is part of normal shutdown.

Actual behavior:

Failed to refresh default location data DOMException {
  name: "AbortError",
  message: "The operation was aborted.",
  code: 20,
  stack: "abort@[native code]\n...\nexit@..."
}

AbortError: The operation was aborted.
    at /$bunfs/root/chunk-hyt09t2m.js:2

The issue is timing-sensitive and is easier to reproduce with plugins that make startup take longer. It does not indicate a real failure during use; it appears only after requesting a normal exit.

The startup handler in packages/tui/src/context/data.tsx logs every rejected refresh promise:

void Promise.allSettled([
  // Eight initial refresh requests.
]).then((settled) => {
  for (const failure of settled.filter((item) => item.status === "rejected"))
    console.error("Failed to refresh default location data", failure.reason)
})

TUI shutdown aborts the unfinished requests, so expected AbortError rejections reach console.error. The same unconditional logging is still present on the dev branch as of c2eacd72afc4a4984564c393e15ab30011057269.

Ignoring only AbortError in this startup result handler fixes the shutdown output locally while preserving reporting for actual refresh failures:

settled.filter((item) => item.status === "rejected" && item.reason?.name !== "AbortError")

The related open issue #40002 reaches the same startup handler, but describes a different primary failure: an undefined location response during VSCode Remote-WSL startup rather than expected cancellation during Ctrl+C shutdown.

Plugins

@slkiser/opencode-quota@4.8.2, oh-my-openagent@4.19.4

OpenCode version

1.18.13

Steps to reproduce
  1. Configure the plugins above. A minimal additional config for OMO is:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["oh-my-openagent@4.19.4"]
    }
    
  2. Start the TUI with a fixed local server port:

    OPENCODE_CONFIG=/path/to/omo.json opencode --hostname 127.0.0.1 --port 4096
    
  3. Press Ctrl+C after the TUI appears while plugins or startup data are still loading.

  4. Observe the AbortError stack traces after the TUI exits. Because this is a startup race, a cold plugin cache or several attempts may make it easier to reproduce.

Screenshot and/or share link
Image
Operating System

NixOS 26.05, Linux 7.1.4 x86_64

Terminal

Kitty 0.47.0 with tmux 3.6a (TERM=tmux-256color)

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.