fix(desktop): ground agent workspace, migrate legacy nest, configurable repos_dir (#1194)

Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
Will Pfleger
2026-06-23 18:30:12 -04:00
committed by GitHub
parent fa1262a92c
commit 1011cea268
20 changed files with 1034 additions and 29 deletions

View File

@@ -67,7 +67,7 @@ export function useWorkspaceInit(
// On the initial mount we skip resetting singletons (they're fresh).
const hasInitializedRef = useRef(false);
// biome-ignore lint/correctness/useExhaustiveDependencies: we intentionally depend on specific properties (id/relayUrl/token) — depending on the whole object would trigger resets on name-only changes
// biome-ignore lint/correctness/useExhaustiveDependencies: we intentionally depend on specific properties (id/relayUrl/token/reposDir) — depending on the whole object would trigger resets on name-only changes
useEffect(() => {
let cancelled = false;
@@ -136,9 +136,20 @@ export function useWorkspaceInit(
activeWorkspace.relayUrl,
undefined,
activeWorkspace.token,
activeWorkspace.reposDir,
);
} catch (error) {
// apply_workspace validates repos_dir before touching relay/keys, so a
// hard reject (bad path) leaves the backend on the previous/default
// relay with nothing applied. Marking the workspace ready here would
// render workspace-scoped UI against the wrong relay — a silent
// split-brain. Park on the loading gate (isReady:false, no appliedKey)
// instead; the backend already toasts a `repos-dir-error`.
console.error("Failed to apply workspace to backend:", error);
if (!cancelled) {
setResult({ isReady: false, needsSetup: false, appliedKey: null });
}
return;
}
if (!cancelled) {
@@ -159,6 +170,7 @@ export function useWorkspaceInit(
activeWorkspace?.id,
activeWorkspace?.relayUrl,
activeWorkspace?.token,
activeWorkspace?.reposDir,
isSharedIdentity,
workspaceKey,
]);