Skip to content

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

Closed as not planned

Description

@wujiachen0727

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.

Activity

  1. github-actions commented on Aug 14, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of an existing issue. Please check:

  2. qixuancao commented on Aug 20, 2026

    @qixuancao

    Confirmed on Linux x86_64 with OpenCode 2 preview 0.0.0-beta-17639.

    The workspace.project_id error is reproducible with a fresh database, so it is not database corruption or a legacy-schema-only problem:

    1. Stop the service.
    2. Move aside the existing OpenCode database files.
    3. Run opencode2 service start.
    4. The server logs database schema bootstrap completed with 44 migrations.
    5. Inspecting the fresh DB shows workspace contains only id, provider, binding, created_at, last_used_at; there is no project_id column.
    6. The server code subsequently queries workspace.project_id and fails with SQLiteError: no such column: workspace.project_id.

    As a temporary local workaround, adding a nullable column makes the service usable:

    ALTER TABLE workspace ADD COLUMN project_id TEXT;

    After applying that workaround, restarting the service and running a minimal chat request completed successfully. This looks like a missing migration/schema definition in the beta rather than a corrupt user database.

  3. CasualDeveloper commented on Aug 20, 2026

    @CasualDeveloper
    Contributor

    Confirmed on macOS arm64 with opencode2 v0.0.0-next-17444, using the web app from opencode2 serve.

    • GET /api/session?directory=global&limit=1 returns HTTP 500 with Path is not absolute: global from database/path.ts / Session.list.
    • The equivalent request with an absolute project directory returns HTTP 200.
    • The UI shows both Failed to load sessions for global / UnexpectedStatus and Failed to reload global / UnexpectedStatus.
    • Sent messages are persisted server-side but may not appear live until the page is refreshed.

    This confirms the regression is still present in next-17444.

  4. github-actions commented on Oct 20, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions