Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
This fixes the skipped opencode-next.db import. I ran the reproduction from #56732: on the base, a target without legacy tables imports nothing and reports completed. With this PR, the session and message are imported and {"phase":"completed"} is written to kv. The empty-legacy-tables case still works. v1-migration and permission tests pass, and core and server type-check cleanly.
Public API: unchanged. migration.v1.status keeps the same response shape. It now reports required when there is an opencode-next.db to import, even without legacy tables.
One thing to fix: the branch also contains the unrelated commit a169e190c ("dismiss interrupted permission prompts" in permission.ts and permission.test.ts). That change is already proposed in #55977, so please drop it from this PR and keep it to the migration fix.
For maintainers: V2 users whose opencode.db has no legacy tables but who still have an opencode-next.db will get it imported once on their next start after upgrading. That is the intent of #56732, but sessions they had not seen in the current database may appear.
| // WITH feedback (CorrectedError) intentionally stays typed so the leaf can turn | ||
| // it into ToolFailure and the model continues. | ||
| Effect.catchTag("Permission.DeclinedError", (error) => Effect.die(error)), | ||
| Effect.onInterrupt(() => |
There was a problem hiding this comment.
This change (and its test in permission.test.ts) comes from the separate commit a169e190c. It isn't related to the migration fix and duplicates #55977. Please remove it from this branch so each change can be reviewed on its own.
8d1c276 to
ef47a71
Compare
Issue for this PR
Closes #56732
Type of change
What does this PR do?
Fresh databases without a legacy
sessiontable incorrectly reported migration as completed and skipped importingopencode-next.db.Check for previous V2 sessions independently of legacy tables, and record completion after import. Only run V1 backfill and event cleanup when legacy tables exist, preserving current events during a V2-only import.
How did you verify your code works?
bun run checkpassed.Screenshots / recordings
N/A — no UI changes.
Checklist