anomalyco / anomalyco/opencode

server: workspace=global requests return 500 'Path is not absolute: global' causing repeated 'failed to reload global' toasts

Open
#42,532 3 comments 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 14, 2026.

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

Description

Summary

Desktop client shows repeated "无法重新加载 global / UnexpectedStatus" toasts because almost every workspace-scoped API returns HTTP 500 with Error: Path is not absolute: global (or empty string) when the workspace is global.

Environment

  • opencode version: 0.0.0-next-17430 (desktop beta, channel=next)
  • OS: macOS Darwin 25.5.0 (arm64)
  • Terminal: xterm-256color
  • Shell: /bin/zsh
  • Install/channel: next (desktop beta app "OpenCode Beta")
  • Active plugins: none

Reproduction

  1. Start the desktop beta app (0.0.0-next-17430) and open the session/global workspace view.
  2. The client periodically refreshes workspace-scoped endpoints; watch the log or the UI.
  3. Right-bottom toast appears repeatedly: 「无法重新加载 global … UnexpectedStatus」.

Expected Behavior

The session list and global workspace should load normally (HTTP 200).

Actual Behavior

Session.list passes the workspace identifier (global, or empty string) into a path normalization helper that asserts absolute paths, throwing Error: Path is not absolute: global, and the endpoint returns HTTP 500. The client surfaces this as UnexpectedStatus.

Server log evidence (role=server, service process started via serve --service):

http.method=GET http.url=/api/session http.status=500
cause="Error: Path is not absolute: global
    at RN (../core/src/database/path.ts:19:15)
    ...
    at Session.list (../server/src/handlers/session.ts:56:39)"

Within a single refresh cycle the following endpoints all returned 500 (33 occurrences total): /api/agent, /api/command, /api/location, /api/mcp, /api/mcp/resource, /api/model, /api/model/default, /api/permission/request, /api/project/current, /api/provider, /api/question/request, /api/reference, /api/session, /api/vcs, /api/workspace.

Additional Context

  • Triggered whenever the client requests with workspace=global (or empty); service restart does NOT fix it — a freshly started service process reproduces the same 500s on the next client refresh cycle.
  • Same root cause also appears with an empty path (Path is not absolute: ), suggesting a shared path-resolution path used across handlers.
  • Also observed in the same log: SQLiteError: no such column: workspace.project_id (Workspace.list) and repeated SQLiteError: disk I/O error (157 occurrences), possibly related DB schema/state inconsistencies.

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.