Repository navigation
Report usage limits as unavailable instead of failing, and give every chat a harness - #1479
Merged
Merged
Conversation
… chat a harness Reading a chat's usage limits threw, so the server answered 500 and reported it to Sentry, whenever the limits simply couldn't be read: the chat's folder was gone (Node reports spawn ENOENT for a missing cwd), its account needed sign-in or couldn't be used, or its harness was unknown, empty, or not installed. Each now answers "unavailable" with the reason, as chats without a local workspace already did, so the Mac app records the answer instead of asking again. A chat can no longer be created or updated with an empty harness, and a migration deletes the existing harnessless chats that have no messages and gives the rest Claude Code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 26, 2026
dylanplayer
added a commit
that referenced
this pull request
Nov 26, 2026
…he chat (#1490) Migration 115 (#1479) deleted empty harnessless chats while foreign keys were off, so nothing cascaded. Their session_state and session_events rows were left pointing at missing chats, the foreign key check after the migrations failed, and the server could not start on any machine that had such a chat. The migration now deletes every row that references a dropped chat (and the plugin event deliveries under its subscriptions) before deleting the chat. The test seeds those rows on the dropped chat, and fails on the old migration with the same error the machines hit. Co-authored-by: Claude Opus 5.5 <[email protected]>
dylanplayer
added a commit
that referenced
this pull request
Nov 26, 2026
…g to start (#1494) * Let migrations apply the schema's own delete rules instead of refusing to start Migrations run with foreign keys off, so a migration that deletes a parent row skips the schema's ON DELETE rules and leaves children pointing at nothing. The runner then refused to start the server (#1479, patched by hand in #1490). After the migrations, the runner now resolves every row pragma foreign_key_check reports by that foreign key's own rule: cascade deletes the row (repeating until nothing new is orphaned), set null and set default reset the columns. Only orphans on a key with no rule (or restrict) still refuse to start. It runs inside the migration transaction, touches only reported rows, does one check and nothing else when nothing is orphaned, and logs what it resolved after the commit. A new test seeds linked rows into every table, derived from the schema, before every migration from the first to the latest, then opens the database through the real runner. It fails on the old runner with #1479's migration 115. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Plan each fixture row once per round and give the chain test a hang guard Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reading a chat's usage limits threw, so the server answered 500 and
reported it to Sentry, whenever the limits simply couldn't be read:
the chat's folder was gone (Node reports spawn ENOENT for a missing
cwd), its account needed sign-in or couldn't be used, or its harness
was unknown, empty, or not installed. Each now answers "unavailable"
with the reason, as chats without a local workspace already did, so
the Mac app records the answer instead of asking again.
A chat can no longer be created or updated with an empty harness, and
a migration deletes the existing harnessless chats that have no
messages and gives the rest Claude Code.
Co-Authored-By: Claude Opus 5.5 [email protected]