Repository navigation
fix(import): continue imported codex sessions on canopy's connection - #351
Merged
Merged
Conversation
This was referenced Nov 13, 2026
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.
Imported Codex threads can fail on their first Canopy turn because their rollout names a custom CLI provider that does not exist in Canopy's private
CODEX_HOME.Fixes: #312
Related: #345
Cause and fix
modelProvideroverride from fix(codex): keep threads working after switching the connection #345. Codex 0.164 accepts it, but 0.166 validates the saved provider before applying it. The real 0.166 binary reproduces the reported “which is no longer configured” refusal against a local fake API.openaiorcanopy_<instance id>). Use the existing staged, identity-checked copy writer and update the manifest, preserving Undo. Session ID, history, messages and turn references stay intact.threads.model_providerin the private index, matching both session ID and verified rollout path. Do not create a database or change its schema; leave unknown schemas alone. Reject symbolic/hard links and special files in the index and SQLite companions. Source CLI files, configuration and databases remain untouched. Codex still enforces managed requirements on the selected connection.connection_changed, reusing the specific explanation and Open provider settings action from fix(codex): keep threads working after switching the connection #345. Retain the native harness error under Show details.Already-imported threads
The next cold resume repairs the existing private copy and its matching index entry, including copies that already failed with 0.166. No re-import, new conversation, history summary or gateway migration is needed. Copies without valid ownership evidence are not rewritten; harness refusals retain their specific classification.
Validation
bun install,bun run gen:check,bun run typecheck,bun run lint,bun run format:check, andbun run --cwd apps/web build.connection_changed, retaining the native error and provider-settings recovery.bun run check:tmp: 1772 passed, 161 skipped, 0 failed (1933 tests across 317 files); no test temp-directory leaks. Its PostgreSQL container and volume were removed.CANOPY_LIVEstayed unset; no paid API calls or UI/E2E tests.git diff --checkpassed. CI and external review are pending.Copy audit — docs/copy.md §8
Effective message before → after: “Canopy had an internal error. Retry. If it happens again, copy the details and report them.” → “Codex could not use this thread with the current connection. Restore its previous connection in provider settings, then retry.” The missing-provider variant now uses the existing actionable connection explanation; no new UI string or layout is introduced.
connection_changed. Technical details use the existing Show details disclosure.