fix(coding-agent): preserve nested legacy config#96
Merged
Conversation
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.
Summary
Fixes a startup migration gap that stranded custom model config under nested legacy senpi paths such as
~/.senpi/.pi/agent. The user-facing impact is that custommodels.jsonentries andfavoriteModelscan reappear after migration instead of being hidden from the model picker.Root cause: the previous migration skipped legacy directories whenever the current target directory already existed. That protected existing files, but it also stranded missing files such as
models.json. While fixing that, the migration also needed to avoid draining~/.pi -> ~/.senpisymlinked home config into external sandbox agent dirs.Changes
migrations.tsso startup migration code stays smaller and focused.legacy-senpi-dir-migration.tsto move only missing files from legacy/nested config directories without overwriting current files.SENPI_CODING_AGENT_DIRsandboxes do not consume real home config through.pisymlinks.QA / Evidence
npx tsx ../../node_modules/vitest/dist/cli.js --run test/senpi-migration.test.tsfrompackages/coding-agent: 3 tests passed.npm run check: passed; also re-run by the commit hook with no fixes applied.node .agents/skills/senpi-qa/scripts/cli-smoke.mjs --self-test: 5/5 passed. Evidence:local-ignore/qa-evidence/20260701-nested-senpi-pi-migration/cli-smoke-final-after-guard.txt.node .agents/skills/senpi-qa/scripts/mock-loop.mjs --self-test: 5/5 passed, including Anthropic Messages baseUrl override through the real loop and zero real provider calls. Evidence:local-ignore/qa-evidence/20260701-nested-senpi-pi-migration/mock-loop-final-after-guard.txt.modelsError null; favorites resolved toanthropic/claude-opus-4-8,anthropic/claude-opus-4-7,anthropic/claude-opus-4-6, andapitopia/glm-5.2.Risks
Secret safety
No raw tokens, auth headers, OAuth blobs, or private credentials are included in the diff or PR text. QA evidence uses isolated fake-provider runs and only records sanitized paths/results.
Summary by cubic
Fixes startup migration to recover nested legacy Senpi config under
~/.senpi/.pi/*without overwriting current files. Restoresmodels.jsonand favorites in the model picker, and prevents draining home config into external sandboxes.Bug Fixes
~/.senpi/.pi/agent/momand project.piinto the current~/.senpilayout; keep existing files intact..pisymlinks don’t pull config into external sandboxes whenSENPI_CODING_AGENT_DIRpoints outside the home dir.Refactors
extension-system-migration.tsand addedlegacy-senpi-dir-migration.ts; slimmedmigrations.ts.Written for commit 9a71aae. Summary will update on new commits.