fix(daemon): refresh workspace repos on checkout miss#1085
Merged
Bohan-J merged 2 commits intomultica-ai:mainfrom Apr 15, 2026
Merged
fix(daemon): refresh workspace repos on checkout miss#1085Bohan-J merged 2 commits intomultica-ai:mainfrom
Bohan-J merged 2 commits intomultica-ai:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Collaborator
|
Great work on this PR! The on-demand refresh design is clean — double-checked locking with per-workspace mutex is the right call, and the test coverage is thorough. Merging now, I'll follow up with a small PR for the two nits (URL trim + reposVersion comment). Thanks! 🎉 |
3 tasks
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.
What does this PR do?
This PR adds on-demand repository refresh for daemon checkout so newly added repositories can be checked out without restarting the daemon.
Today,
multica repo checkout <url>can fail withrepo not found in cacheif a repository was added toSettings > Repositoriesafter the daemon started. The daemon only syncs repository cache during workspace registration, so newly added repos are not available until a restart.This change keeps the existing fast path for already-known repositories, but refreshes workspace repository state on checkout miss. If the target repo is now configured for the workspace, the daemon performs a one-time cache sync and retries checkout. It also improves error reporting by distinguishing between:
It also updates UI copy to refer to Git repositories rather than GitHub-only repositories.
Related Issue
Closes #1027
Type of Change
Changes Made
workspace_idreposrepos_versionrepos_versionfrom the normalized repository URL set so URL order and description-only changes do not trigger unnecessary refreshesreposVersionallowedRepoURLslastRepoSyncErrrepoRefreshMuensureRepoReady()before checkout to:repoCache.Sync(...)when neededrepo is not configured for this workspacerepo is configured but not synced: ...packages/views/settings/components/repositories-tab.tsxpackages/views/onboarding/step-complete.tsxHow to Test
cd server && go test ./...Settings > Repositoriesmultica repo checkout <repo-url>Checklist
AI Disclosure
AI tool used: Codex
Prompt / approach:
I used Codex to inspect the daemon register / checkout flow, trace why newly added repositories were not available without restarting the daemon, and help outline a minimal on-demand refresh design. I also used it to identify the relevant files for the daemon, handler, and UI copy updates, and to suggest test scenarios for the new repo-state and checkout behavior. Final code changes, scope decisions, and local verification were reviewed and validated manually.
Screenshots (optional)