Skip to content

fix(server): surface session creation errors - #48734

Open
Dante-dan wants to merge 1 commit into
anomalyco:devfrom
Dante-dan:schema-drift-error
Open

Dante-dan wants to merge 1 commit into
anomalyco:devfrom
Dante-dan:schema-drift-error

Conversation

@Dante-dan

Copy link
Copy Markdown

Issue for this PR

Closes #39775

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

A database write failure during V2 session creation became an empty 500, while the TUI replaced the client error with generic copy.

This declares the safe UnknownError response, logs the full server cause with a short reference, regenerates the Promise client, and shows the decoded message in the creation toast. The implementation follows the diagnosis in the closed #39877 by @xinyuan0801, adapted to the current server and client architecture.

How did you verify your code works?

  • Simulated schema drift by dropping session.title from a real SQLite test database; POST /api/session returns a structured 500 with an err_... reference
  • packages/opencode targeted regression: 1 passed
  • packages/client Promise tests: 8 passed
  • Typechecks passed in packages/protocol, packages/server, packages/client, packages/tui, and packages/opencode
  • Generated client output, Prettier, and git diff --check verified

Screenshots / recordings

Not included. The visible change is the session-creation toast showing the decoded server error instead of generic copy.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2: silent 500 on session create when server schema mismatches the live database

1 participant