fix(api): point fresh installs at project setup when resolve finds an empty projects table#990
Merged
Merged
Conversation
… empty projects table On a brand-new config dir, model_post_init bootstraps a 'main' default in config.json but the one-shot CLI path never runs the server-lifespan reconciliation that would create its database row, so the first read fails with a bare "Project not found: 'main'" — which reads as a broken install rather than a missing first-run step. When resolution misses and the projects table is empty, the 404 now names the setup command. Follow-up to #974/#985/#987 (which repair the default during project add but cannot help when the first action is a read). Refs #974. Signed-off-by: phernandez <paul@basicmachines.co>
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
Follow-up to #974 / #985 / #987. Those fixes repair the config/DB default during
project add— but on a truly fresh install where the first action is a read (e.g. the Claude Code plugin's SessionStart brief on a new machine), no repair path runs and the user gets:which reads as a broken install rather than a missing first-run step.
config.jsonbootstraps themaindefault inmodel_post_init, but the one-shot CLI path never executes the server-lifespan reconciliation that would create its database row.Per design discussion: rather than silently reconciling on read, fail with direction. When
/v2/projects/resolvemisses and the projects table is empty, the 404 detail now names the setup command:Misses against a populated table keep the plain message, and the
Project not foundprefix is preserved for existing error-classification code (e.g.mcp/tools/search.py).Test evidence
test_resolve_project_not_found_fresh_install_names_setup_command— fails without the fix (bare message), passes with ittest_resolve_project_not_found_with_projects_keeps_plain_message— populated-table miss keeps the exact plain detailBASIC_MEMORY_CONFIG_DIR/HOME+bm tool read-notenow prints the guidancetests/api/v2/test_project_router.py29 passed;ruffandtycleanRefs #974
🤖 Generated with Claude Code