Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(cindy-make): 个人版生成期间保护版本切换与源码同步 (#4938)
Lizi3c3053043113
diff --git a/apps/desktop/src/main/bootstrap-electron.ts b/apps/desktop/src/main/bootstrap-electron.tsindex f550996bdb..ba57201997 100644--- a/apps/desktop/src/main/bootstrap-electron.ts+++ b/apps/desktop/src/main/bootstrap-electron.ts@@ -389,6 +389,7 @@ import {deliverCindyVersionOpenEvents,finishCindyVersionStartup,isCindyVersionLaunchPending,+ isCindyVersionSwitching,watchCindyVersionStartupResult,} from './cindy-make/versionStartup.js';import {@@ -7647,8 +7648,10 @@ const registerIpcHandlers = () => {throwIpcError('PRECONDITION_FAILED', 'unavailable');}});+ cindyMakeManager.setVersionSwitchingProbe(isCindyVersionSwitching);configureCindyVersions(() => cindyMakeTestController.hasActiveJobs() || cindyMakeManager.hasActiveWork(),+ () => cindyMakeManager.isPersonalBuildRunning(),);ipcMain.handle('app:cindy-versions-state', async (event) => {assertTrustedAppRendererEvent(event);diff --git a/apps/desktop/src/main/cindy-make/__tests__/historyRuntime.test.ts b/apps/desktop/src/main/cindy-make/__tests__/historyRuntime.test.tsindex 792f8a506d..bebf5686ca 100644--- a/apps/desktop/src/main/cindy-make/__tests__/historyRuntime.test.ts+++ b/apps/desktop/src/main/cindy-make/__tests__/historyRuntime.test.ts@@ -182,6 +182,7 @@ const receipt: MakeFeatureReceipt = {taskTree: 'e'.repeat(40),};beforeEach(() => {+ cindyMakeManager.setVersionSwitchingProbe(() => false);vi.clearAllMocks();store.readBuild.mockReset();store.saveBuild.mockReset();@@ -509,6 +510,12 @@ describe('history Main admission and owner boundary', () => {canBuild: false,});});+ it('does not offer or start a personal build during a version handoff', async () => {+ cindyMakeManager.setVersionSwitchingProbe(() => true);+ expect(await getCindyMakeHistory('aaaa')).toMatchObject({ busy: true, canBuild: false });+ await expect(generateHistoryPersonalVersion()).rejects.toThrow('busy');+ expect(h.build).not.toHaveBeenCalled();+ });it('keeps builds and integrations blocked until cancellation finishes even if its directory is gone', async () => {h.state.upstreamMerge = {id: 'update',diff --git a/apps/desktop/src/main/cindy-make/__tests__/taskLifecycle.test.ts b/apps/desktop/src/main/cindy-make/__tests__/taskLifecycle.test.tsindex ec72b36789..1a9134387b 100644--- a/apps/desktop/src/main/cindy-make/__tests__/taskLifecycle.test.ts+++ b/apps/desktop/src/main/cindy-make/__tests__/taskLifecycle.test.ts@@ -67,6 +67,7 @@ describe('Main-owned Cindy Make task lifecycle', () => {it('reserves one build across entry points and ignores an old release after retry', () => {const manager = new CindyMakeManager();const release = manager.claimPersonalBuild();+ expect(manager.isPersonalBuildRunning()).toBe(true);expect(manager.hasActiveWork()).toBe(true);expect(() => manager.claimPersonalBuild()).toThrow('personal build is running');release();@@ -74,8 +75,60 @@ describe('Main-owned Cindy Make task lifecycle', () => {release();expect(manager.hasActiveWork()).toBe(true);releaseRetry();+ expect(manager.isPersonalBuildRunning()).toBe(false);expect(manager.hasActiveWork()).toBe(false);});+ it('rejects a new build claim while an application version is switching', () => {+ const manager = new CindyMakeManager();+ manager.setVersionSwitchingProbe(() => true);+ expect(manager.isVersionSwitching()).toBe(true);+ expect(() => manager.claimPersonalBuild()).toThrow('version switch is running');+ expect(manager.isPersonalBuildRunning()).toBe(false);+ manager.setVersionSwitchingProbe(() => false);+ const release = manager.claimPersonalBuild();+ expect(manager.isPersonalBuildRunning()).toBe(true);+ release();+ });+ it('rejects a build claim while the source is in use', async () => {+ const manager = new CindyMakeManager();+ await manager.withProjectUse('source', async () => {+ expect(() => manager.claimPersonalBuild()).toThrow('source work is running');+ expect(manager.isPersonalBuildRunning()).toBe(false);+ });+ const release = manager.claimPersonalBuild();+ release();+ });+ it('keeps manual source sync and personal build claims mutually exclusive', () => {+ const manager = new CindyMakeManager();+ const releaseSync = manager.claimManualSourceSync();+ expect(manager.hasActiveWork()).toBe(true);+ expect(() => manager.claimPersonalBuild()).toThrow('manual source sync is running');+ releaseSync();+ const releaseBuild = manager.claimPersonalBuild();+ expect(() => manager.claimManualSourceSync()).toThrow('personal build or source sync is running');+ releaseBuild();+ expect(manager.hasActiveWork()).toBe(false);+ });+ it('keeps build claims blocked until a retained source conflict is settled', () => {+ const manager = new CindyMakeManager();+ manager.setUpstreamMerge({+ id: 'merge',+ status: 'conflict',+ ref: 'main',+ upstreamCommit: 'a'.repeat(40),+ hasWorkspace: true,+ });+ expect(() => manager.claimPersonalBuild()).toThrow('upstream merge is pending');+ manager.setUpstreamMerge({+ id: 'merge',+ status: 'cancelled',+ ref: 'main',+ upstreamCommit: 'a'.repeat(40),+ hasWorkspace: false,+ });+ const release = manager.claimPersonalBuild();+ release();+ });it('publishes only the current build owners and clears them when the lease settles', () => {const manager = new CindyMakeManager();const changed = vi.fn();diff --git a/apps/desktop/src/main/cindy-make/__tests__/testRuntime.test.ts b/apps/desktop/src/main/cindy-make/__tests__/testRuntime.test.tsindex 2f2fc7fa42..71aabcd4c5 100644--- a/apps/desktop/src/main/cindy-make/__tests__/testRuntime.test.ts+++ b/apps/desktop/src/main/cindy-make/__tests__/testRuntime.test.ts@@ -165,6 +165,7 @@ const client = {},};beforeEach(() => {+ cindyMakeManager.setVersionSwitchingProbe(() => false);vi.clearAllMocks();h.verify.mockReset().mockResolvedValue(undefined);h.build.mockReset().mockResolvedValue(installer);@@ -426,6 +427,12 @@ describe('Cindy Make test IPC ownership and persistence', () => {release();}});+ it('does not start a completion build while a version handoff is running', async () => {+ cindyMakeManager.setVersionSwitchingProbe(() => true);+ await expect(actCindyMakeTest('session', 'completion', 'build')).rejects.toThrow('unavailable');+ expect(h.build).not.toHaveBeenCalled();+ expect(cindyMakeTestController.hasActiveJobs()).toBe(false);+ });it('publishes one build identity to Settings and persists cancellation for a reopened card', async () => {let release!: () => void;h.build.mockImplementationOnce(diff --git a/apps/desktop/src/main/cindy-make/__tests__/upstreamMergeRuntime.test.ts b/apps/desktop/src/main/cindy-make/__tests__/upstreamMergeRuntime.test.tsindex 079ca5bf24..36ade8b66e 100644--- a/apps/desktop/src/main/cindy-make/__tests__/upstreamMergeRuntime.test.ts+++ b/apps/desktop/src/main/cindy-make/__tests__/upstreamMergeRuntime.test.ts@@ -26,6 +26,8 @@ const h = vi.hoisted(() => ({head: 'c'.repeat(40),tree: 'd'.repeat(40),dirty: false,+ building: false,+ manualClaimed: false,projected: undefined as CindyMakeMergeState | undefined,source: {status: 'ready',@@ -118,6 +120,12 @@ vi.mock('../manager.js', () => ({}},isPreparingSource: () => false,+ isPersonalBuildRunning: () => h.building,+ claimManualSourceSync: () => {+ if (h.building || h.manualClaimed) throw Object.assign(new Error('busy'), { code: 'busy' });+ h.manualClaimed = true;+ return () => { h.manualClaimed = false; };+ },refreshSourceStatus: async () => {},},}));@@ -213,6 +221,8 @@ beforeEach(() => {h.head = 'c'.repeat(40);h.tree = 'd'.repeat(40);h.dirty = false;+ h.building = false;+ h.manualClaimed = false;h.actualRollback = false;h.afterReadError = undefined;h.refs = new Map();@@ -300,6 +310,17 @@ it.each(['dev', 'beta', 'release'] as const)(]);},);+it('rejects a manual source sync during a personal build without queuing it', async () => {+ h.building = true;+ await expect(actUpstreamMerge({ action: 'update' })).rejects.toThrow('busy');+ expect(h.fetch).not.toHaveBeenCalled();+ expect(h.projected).toBeUndefined();+});+it('releases the manual source reservation after an update', async () => {+ h.fetch.mockResolvedValueOnce(new Response(JSON.stringify({ sha: 'f'.repeat(40) })));+ await actUpstreamMerge({ action: 'update' });+ expect(h.manualClaimed).toBe(false);+});it('uses the same fresh official sync before a task worktree is created', async () => {h.fetch.mockResolvedValueOnce(new Response(JSON.stringify({ sha: 'f'.repeat(40) })));await syncSourceBeforeCindyMakeTask(new AbortController().signal);@@ -317,6 +338,7 @@ it('stops task preparation when latest source cannot be fetched', async () => {});});it('publishes source sync as a distinct personal build step', async () => {+ h.building = true;h.fetch.mockResolvedValueOnce(new Response(JSON.stringify({ sha: 'f'.repeat(40) })));const publish = vi.fn(async () => {});await syncSourceBeforeCindyMakeBuild(new AbortController().signal, publish);diff --git a/apps/desktop/src/main/cindy-make/__tests__/versionService.test.ts b/apps/desktop/src/main/cindy-make/__tests__/versionService.test.tsindex ac43c9d64d..6262b1efb5 100644--- a/apps/desktop/src/main/cindy-make/__tests__/versionService.test.ts+++ b/apps/desktop/src/main/cindy-make/__tests__/versionService.test.ts@@ -174,7 +174,7 @@ describe('version management main boundary', () => {await expect(actCindyVersion(action, target)).rejects.toMatchObject({ code: 'INVALID_PARAMS' });expect(h.handoff).not.toHaveBeenCalled();});- it('allows switching during build or other running work and never quits on a failed handoff', async () => {+ it('allows switching during other running work and never quits on a failed handoff', async () => {setPersonal();configureCindyVersions(() => true);await actCindyVersion('switch', id);@@ -188,6 +188,16 @@ describe('version management main boundary', () => {await expect(actCindyVersion('switch', id)).rejects.toThrow('incompatible');expect(h.quit).not.toHaveBeenCalled();});+ it('blocks switching while a personal version is being built', async () => {+ setPersonal();+ configureCindyVersions(() => true, () => true);+ await expect(actCindyVersion('switch', id)).rejects.toThrow('building');+ expect(h.handoff).not.toHaveBeenCalled();+ expect(h.quit).not.toHaveBeenCalled();+ configureCindyVersions(() => true, () => false);+ await actCindyVersion('switch', id);+ expect(h.handoff).toHaveBeenCalledOnce();+ });it('uses normal quit only after the host-owned handoff accepts the current owner', async () => {setPersonal();h.handoff.mockImplementationOnce(async (_id, current: () => Promise<boolean>) => {diff --git a/apps/desktop/src/main/cindy-make/historyRuntime.ts b/apps/desktop/src/main/cindy-make/historyRuntime.tsindex 90e8ce676e..6806c260fc 100644--- a/apps/desktop/src/main/cindy-make/historyRuntime.ts+++ b/apps/desktop/src/main/cindy-make/historyRuntime.ts@@ -329,6 +329,7 @@ async function readCindyMakeHistory(: undefined;const ownsBuild = !!ownBuild && buildJob === ownBuild && ownBuild.current();const globalBusy =+ cindyMakeManager.isVersionSwitching() ||cindyMakeTestController.hasActiveJobs() ||(!ownsBuild && (!!buildJob || cindyMakeManager.hasActiveWork()));const items: CindyMakeHistoryItem[] = [];diff --git a/apps/desktop/src/main/cindy-make/manager.ts b/apps/desktop/src/main/cindy-make/manager.tsindex da7f7d977a..d7aee735df 100644--- a/apps/desktop/src/main/cindy-make/manager.ts+++ b/apps/desktop/src/main/cindy-make/manager.ts@@ -99,6 +99,7 @@ export class CindyMakeManager {private readonly projectJobs = new Map<string, Promise<unknown>>();private readonly projectUsers = new Map<string, number>();private personalBuild: { sessionIds: string[]; isCurrent: () => boolean } | undefined;+ private manualSourceSync = false;private readonly reports = new Map<string,{ report: MakeDoctorReport; isCurrent: () => boolean }@@ -114,22 +115,38 @@ export class CindyMakeManager {>();private sourceRevision = 0;private isProjectBusy: (root: string) => boolean = () => false;+ private versionSwitching: () => boolean = () => false;private mergeSessionCurrent: () => boolean = () => true;setProjectBusyProbe(probe: (root: string) => boolean): void {this.isProjectBusy = probe;}+ setVersionSwitchingProbe(probe: () => boolean): void {+ this.versionSwitching = probe;+ }++ isVersionSwitching(): boolean {+ return this.versionSwitching();+ }++ private hasPendingUpstreamMerge(): boolean {+ const merge = this.states.upstreamMerge;+ return !!(+ merge &&+ merge.status !== 'merged' &&+ merge.status !== 'cancelled' &&+ (merge.hasWorkspace === true ||+ merge.cancellationRequested === true ||+ merge.status !== 'failed')+ );+ }+private projectInUse(root: string): boolean {return ((this.projectUsers.get(root) ?? 0) > 0 ||this.isProjectBusy(root) ||- (!!this.states.upstreamMerge &&- this.states.upstreamMerge.status !== 'merged' &&- this.states.upstreamMerge.status !== 'cancelled' &&- (this.states.upstreamMerge.hasWorkspace === true ||- this.states.upstreamMerge.cancellationRequested === true ||- this.states.upstreamMerge.status !== 'failed'))+ this.hasPendingUpstreamMerge());}/** Active preparation/cleanup must finish before a local application version switch. */@@ -140,16 +157,41 @@ export class CindyMakeManager {this.preparingTasks.size > 0 ||this.runningTaskActions.size > 0 ||this.projectUsers.size > 0 ||+ this.manualSourceSync ||!!this.personalBuild ||this.projectJobs.size > 0);}+ isPersonalBuildRunning(): boolean {+ return !!this.personalBuild;+ }++ /** Reserve a manual source update before its first asynchronous step. */+ claimManualSourceSync(): () => void {+ if (this.personalBuild || this.manualSourceSync)+ throw Object.assign(new Error('personal build or source sync is running'), { code: 'busy' });+ this.manualSourceSync = true;+ this.notify();+ return () => {+ this.manualSourceSync = false;+ this.notify();+ };+ }+/** Both entry points reserve synchronously, before any asynchronous build work. */claimPersonalBuild(sessionIds: readonly string[] = [],isCurrent: () => boolean = () => true,): () => void {+ if (this.versionSwitching())+ throw Object.assign(new Error('version switch is running'), { code: 'busy' });+ if (this.manualSourceSync)+ throw Object.assign(new Error('manual source sync is running'), { code: 'busy' });+ if (this.hasPendingUpstreamMerge())+ throw Object.assign(new Error('upstream merge is pending'), { code: 'busy' });+ if (this.projectUsers.size > 0)+ throw Object.assign(new Error('source work is running'), { code: 'busy' });if (this.personalBuild)throw Object.assign(new Error('personal build is running'), { code: 'busy' });const claim = { sessionIds: [...new Set(sessionIds)], isCurrent };diff --git a/apps/desktop/src/main/cindy-make/upstreamMergeRuntime.ts b/apps/desktop/src/main/cindy-make/upstreamMergeRuntime.tsindex bf9b05b57e..a0bbd4b693 100644--- a/apps/desktop/src/main/cindy-make/upstreamMergeRuntime.ts+++ b/apps/desktop/src/main/cindy-make/upstreamMergeRuntime.ts@@ -321,6 +321,14 @@ export async function actUpstreamMerge(raw: unknown): Promise<CindyMakeMergeStat}).createOptions;if (!controller || unavailable)throwIpcError('PRECONDITION_FAILED', 'Upstream merge is unavailable');+ let releaseManualSync: (() => void) | undefined;+ if (action === 'update') {+ try {+ releaseManualSync = cindyMakeManager.claimManualSourceSync();+ } catch {+ throwIpcError('PRECONDITION_FAILED', 'busy');+ }+ }try {return action === 'update'? await controller.update(options)@@ -331,6 +339,8 @@ export async function actUpstreamMerge(raw: unknown): Promise<CindyMakeMergeStat: controller.status();} catch {throwIpcError('PRECONDITION_FAILED', 'Upstream merge is unavailable');+ } finally {+ releaseManualSync?.();}}diff --git a/apps/desktop/src/main/cindy-make/versionService.ts b/apps/desktop/src/main/cindy-make/versionService.tsindex 0b6571c72c..093810d7da 100644--- a/apps/desktop/src/main/cindy-make/versionService.ts+++ b/apps/desktop/src/main/cindy-make/versionService.ts@@ -36,8 +36,10 @@ import {import { cleanupPersonalVersions } from './personalVersionCleanup.js';let makeBusy: () => boolean = () => true;-export function configureCindyVersions(probe: () => boolean): void {+let buildBusy: () => boolean = () => false;+export function configureCindyVersions(probe: () => boolean, buildProbe: () => boolean = () => false): void {makeBusy = probe;+ buildBusy = buildProbe;}export async function getCindyVersions(): Promise<CindyVersionsState> {const profile = app.getPath('userData');@@ -92,9 +94,11 @@ export async function actCindyVersion(action: unknown, id: unknown): Promise<Cinconst current = () =>isDataOwnerBroadcastScopeCurrent(scope) && app.getPath('userData') === profile;try {- // An explicit switch may interrupt active work. Normal quit preserves Agent turn- // markers for continuing after startup; background jobs are not replayed.- // Removing the personal version still requires the busy guard below.+ // An explicit switch may interrupt tasks and tests, but a personal build must+ // finish or stop first. Normal quit does not replay background build jobs.+ // Removing the personal version still requires the broad busy guard below.+ if (action === 'switch' && buildBusy())+ throwIpcError('PRECONDITION_FAILED', 'building');if ((action === 'remove' && makeBusy()) || isCindyVersionSwitching())throwIpcError('PRECONDITION_FAILED', 'busy');if (action === 'switch') {@@ -107,6 +111,7 @@ export async function actCindyVersion(action: unknown, id: unknown): Promise<CintargetId,async () =>current() &&+ !buildBusy() &&(targetId === 'original' || personalVersionId(profile) === targetId),);if (!current()) throwIpcError('PRECONDITION_FAILED', 'busy');@@ -155,7 +160,7 @@ export async function actCindyVersion(action: unknown, id: unknown): Promise<Cinreturn getCindyVersions();} catch (error) {const code = (error as { code?: string }).code;- if (code === 'busy' || code === 'incompatible' || code === 'launchFailed')+ if (code === 'busy' || code === 'building' || code === 'incompatible' || code === 'launchFailed')throwIpcError('PRECONDITION_FAILED', code);if (isIpcError(error)) throw error;throwIpcError('PRECONDITION_FAILED', 'unavailable');diff --git a/apps/desktop/src/renderer/components/cindy-make/CindyMakeHistoryPanel.tsx b/apps/desktop/src/renderer/components/cindy-make/CindyMakeHistoryPanel.tsxindex 71d81f2d82..0071254fad 100644--- a/apps/desktop/src/renderer/components/cindy-make/CindyMakeHistoryPanel.tsx+++ b/apps/desktop/src/renderer/components/cindy-make/CindyMakeHistoryPanel.tsx@@ -41,6 +41,8 @@ export function CindyMakeHistoryPanel({onState?: (state: CindyMakeHistoryState) => void;}) {const { t, i18n } = useTranslation();+ const translateRef = useRef(t);+ translateRef.current = t;const navigate = useNavigate();const { confirm } = useConfirmDialog();const make = useCindyMakeState();@@ -48,6 +50,7 @@ export function CindyMakeHistoryPanel({owner: ReturnType<typeof getDataOwnerGeneration>;value: CindyMakeHistoryState;}>();+ const snapshotRef = useRef(snapshot);const state =snapshot && isDataOwnerGenerationCurrent(snapshot.owner) ? snapshot.value : undefined;const [selectedId, select] = useState('');@@ -57,10 +60,29 @@ export function CindyMakeHistoryPanel({const [checkedIds, setCheckedIds] = useState<string[]>([]);const [pending, setPending] = useState<string>();const [failed, setFailed] = useState(false);+ // A failed build is persisted so it can still be retried, but an old failure+ // should not reappear as a fresh red banner every time this panel is opened.+ const [showBuildFailure, setShowBuildFailure] = useState(false);const request = useRef(0);const acting = useRef(false);const actionGeneration = useRef(0);const owner = getDataOwnerGeneration();+ const notifyBuildResult = useCallback(+ (previous: CindyMakeHistoryState['build'], next: CindyMakeHistoryState['build']) => {+ if (+ !previous ||+ !next ||+ (previous.status === next.status && previous.buildId === next.buildId)+ )+ return;+ if (next.status === 'ready') {+ toast.success(translateRef.current('cindyMake.personal.status.ready'));+ } else if (next.status === 'failed' && next.error !== 'cancelled') {+ toast.error(translateRef.current('cindyMake.personal.errors.' + (next.error ?? 'unavailable')));+ }+ },+ [],+ );const refresh = useCallback(async () => {if (!window.electronAPI.getCindyMakeHistory) {setFailed(true);@@ -70,15 +92,29 @@ export function CindyMakeHistoryPanel({try {const next = await window.electronAPI.getCindyMakeHistory(selectedId || undefined);if (isDataOwnerGenerationCurrent(owner) && generation === request.current) {+ const previousBuild = snapshotRef.current?.value.build;+ const nextBuild = next.build;+ notifyBuildResult(previousBuild, nextBuild);+ if (nextBuild?.status !== 'failed') {+ setShowBuildFailure(false);+ } else if (+ previousBuild &&+ (previousBuild.status !== 'failed' || previousBuild.buildId !== nextBuild.buildId)+ ) {+ setShowBuildFailure(true);+ }setSnapshot({ owner, value: next });+ snapshotRef.current = { owner, value: next };setFailed(false);}} catch {if (isDataOwnerGenerationCurrent(owner) && generation === request.current) setFailed(true);}- }, [owner, selectedId]);+ }, [notifyBuildResult, owner, selectedId]);useEffect(() => {setSnapshot(undefined);+ snapshotRef.current = undefined;+ setShowBuildFailure(false);setPending(undefined);setSelecting(false);setCheckedIds([]);@@ -89,6 +125,9 @@ export function CindyMakeHistoryPanel({actionGeneration.current += 1;};}, [owner]);+ useEffect(() => {+ if (!active) setShowBuildFailure(false);+ }, [active]);useEffect(() => {if (!active) return;const timer = window.setInterval(() => {@@ -179,6 +218,7 @@ export function CindyMakeHistoryPanel({: undefined;const selectedIsGlobalFailure =state?.build?.status === 'failed' &&+ showBuildFailure &&!!state.build.buildId &&selectedBuild?.buildId === state.build.buildId;const building = !!state?.build && !['ready', 'failed'].includes(state.build.status);@@ -213,7 +253,19 @@ export function CindyMakeHistoryPanel({const update = (next: CindyMakeHistoryState) => {request.current += 1;if (isDataOwnerGenerationCurrent(owner)) {+ const previousBuild = snapshotRef.current?.value.build;+ const nextBuild = next.build;+ notifyBuildResult(previousBuild, nextBuild);+ if (nextBuild?.status !== 'failed') {+ setShowBuildFailure(false);+ } else if (+ previousBuild &&+ (previousBuild.status !== 'failed' || previousBuild.buildId !== nextBuild.buildId)+ ) {+ setShowBuildFailure(true);+ }setSnapshot({ owner, value: next });+ snapshotRef.current = { owner, value: next };setFailed(false);}};@@ -435,8 +487,9 @@ export function CindyMakeHistoryPanel({const showGlobalResult =state?.build &&!building &&- (state.build.status === 'failed' ||- !items.some((item) => state.build?.buildId && item.build?.buildId === state.build.buildId));+ ((state.build.status === 'failed' && showBuildFailure) ||+ (state.build.status === 'ready' &&+ !items.some((item) => state.build?.buildId && item.build?.buildId === state.build.buildId)));const { stop: confirmStopBuild, stopping: stoppingBuild } = useCindyMakeBuildStop(building ? state?.build?.buildId : undefined,);diff --git a/apps/desktop/src/renderer/components/cindy-make/CindyMakeVersionsPanel.tsx b/apps/desktop/src/renderer/components/cindy-make/CindyMakeVersionsPanel.tsxindex d292783038..f89d7eaa74 100644--- a/apps/desktop/src/renderer/components/cindy-make/CindyMakeVersionsPanel.tsx+++ b/apps/desktop/src/renderer/components/cindy-make/CindyMakeVersionsPanel.tsx@@ -10,12 +10,14 @@ import type { CindyVersionInfo, CindyVersionsState } from '../../../shared/cindyexport function CindyMakeVersionsPanel({active = true,busy = false,+ buildRunning = false,refreshKey,onState,children,}: {active?: boolean;busy?: boolean;+ buildRunning?: boolean;refreshKey?: string;onState?: (state?: CindyVersionsState) => void;children?: ReactNode;@@ -41,6 +43,7 @@ export function CindyMakeVersionsPanel({const personal = versions.state?.versions.find((version) => version.kind === 'personal');const switchBlockedReason = (version: CindyVersionInfo) => {if (switchDisabled) return 'busy' as const;+ if (buildRunning) return 'building' as const;if (!version.available) return 'unavailable' as const;if (!version.compatible) return 'incompatible' as const;return undefined;@@ -48,7 +51,11 @@ export function CindyMakeVersionsPanel({const switchBlockedLabel = (version: CindyVersionInfo) => {const reason = switchBlockedReason(version);if (!reason) return undefined;- return t(reason === 'busy' ? 'cindyMake.versions.errors.busy' : 'cindyMake.versions.' + reason);+ return t(+ reason === 'busy' || reason === 'building'+ ? 'cindyMake.versions.errors.' + reason+ : 'cindyMake.versions.' + reason,+ );};const renderSwitchButton = (version: CindyVersionInfo, actionLabel: string) => {const blockedLabel = switchBlockedLabel(version);@@ -61,7 +68,7 @@ export function CindyMakeVersionsPanel({title={blockedLabel}aria-label={blockedLabel ?? actionLabel}>- {blockedLabel ?? actionLabel}+ {buildRunning ? actionLabel : (blockedLabel ?? actionLabel)}</Button>);};diff --git a/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeHistoryPanel.i18n.test.tsx b/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeHistoryPanel.i18n.test.tsxindex ce68731755..781ea62074 100644--- a/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeHistoryPanel.i18n.test.tsx+++ b/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeHistoryPanel.i18n.test.tsx@@ -15,12 +15,12 @@ import { CindyMakeHistoryPanel } from '../CindyMakeHistoryPanel';import { CindyMakeVersionsPanel } from '../CindyMakeVersionsPanel';import { CindyMakeMergeNotice } from '../CindyMakeMergeNotice';-const h = vi.hoisted(() => ({ make: {} }));+const h = vi.hoisted(() => ({ make: {}, error: vi.fn(), success: vi.fn() }));vi.mock('@/lib/cindyMakeState', () => ({ useCindyMakeState: () => h.make }));vi.mock('@/components/ui/confirm-dialog-provider', () => ({useConfirmDialog: () => ({ confirm: async () => false }),}));-vi.mock('@/lib/toast', () => ({ toast: { error: vi.fn() } }));+vi.mock('@/lib/toast', () => ({ toast: { error: h.error, success: h.success } }));const cases = [{@@ -84,6 +84,8 @@ function strings(value: Record<string, unknown>, prefix = ''): Array<[string, st}beforeEach(() => {+ h.error.mockClear();+ h.success.mockClear();setDataOwnerGeneration('history-real-locales');const state: CindyMakeHistoryState = {busy: false,@@ -187,6 +189,7 @@ describe('Cindy Make history with real translations', () => {buildId: 'build-1',outputLine: 'Test Files 57 passed; token=fake-secret',};+ vi.stubGlobal('electronAPI', { getCindyMakeHistory: async () => structuredClone(state) });const i18n = createInstance();await i18n.use(initReactI18next).init({lng: locale,@@ -211,8 +214,16 @@ describe('Cindy Make history with real translations', () => {state.busy = false;state.canBuild = true;for (const error of ['checksFailed', 'cleanupFailed'] as const) {+ if (error === 'cleanupFailed') {+ state.build = { status: 'checking', buildId: 'build-2', checkStep: 'tests' };+ fireEvent(window, new Event('focus'));+ await screen.findAllByText(resource.cindyMake.personal.checkStep.tests);+ }state.build = { status: 'failed', error };fireEvent(window, new Event('focus'));+ await waitFor(() =>+ expect(h.error).toHaveBeenCalledWith(resource.cindyMake.personal.errors[error]),+ );expect(await screen.findByText(resource.cindyMake.personal.errors[error])).toBeTruthy();expect(screen.queryByText('Test Files 57 passed; token=[REDACTED]')).toBeNull();expect(view.container.textContent).not.toMatch(/cindyMake\.|\{\{|\?{2,}|\uFFFD/);diff --git a/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeHistoryPanel.test.tsx b/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeHistoryPanel.test.tsxindex c59c5fef95..63800f8494 100644--- a/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeHistoryPanel.test.tsx+++ b/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeHistoryPanel.test.tsx@@ -17,6 +17,7 @@ const h = vi.hoisted(() => ({restore: vi.fn(),prepend: vi.fn(),error: vi.fn(),+ success: vi.fn(),make: {},}));vi.mock('react-router-dom', () => ({ useNavigate: () => h.navigate }));@@ -29,7 +30,7 @@ vi.mock('@/lib/cindyMakeState', () => ({ useCindyMakeState: () => h.make }));vi.mock('@/components/ui/confirm-dialog-provider', () => ({useConfirmDialog: () => ({ confirm: h.confirm }),}));-vi.mock('@/lib/toast', () => ({ toast: { error: h.error } }));+vi.mock('@/lib/toast', () => ({ toast: { error: h.error, success: h.success } }));vi.mock('@/components/ui/select', () => ({Select: ({ label, value, options, onValueChange, disabled }: SelectProps) => (<select@@ -142,6 +143,102 @@ afterEach(() => {vi.unstubAllGlobals();});describe('Make history controls', () => {+ it('does not restore an old failed build banner when opening an empty history', async () => {+ const f = harness([]);+ f.set({+ items: [],+ busy: false,+ canBuild: true,+ build: { status: 'failed', error: 'checksFailed', buildId: 'old-build' },+ });+ render(<CindyMakeHistoryPanel hasPersonalVersion />);+ await screen.findByText('settings.cindyMake.tasks.noResults');+ expect(screen.queryByRole('alert')).toBeNull();+ expect(screen.getByRole('button', { name: 'cindyMake.history.regeneratePersonal' })).toBeTruthy();+ expect(h.error).not.toHaveBeenCalled();+ });+ it('keeps the old failure details on its task after reopening history', async () => {+ const failedBuild = {+ status: 'failed' as const,+ error: 'checksFailed' as const,+ buildId: 'old-build',+ };+ const f = harness();+ f.set({+ items: [item({ build: failedBuild })],+ busy: false,+ canBuild: true,+ build: failedBuild,+ });+ render(<CindyMakeHistoryPanel hasPersonalVersion />);+ expect(await screen.findByText('cindyMake.personal.errors.checksFailed')).toBeTruthy();+ expect(screen.getAllByRole('alert')).toHaveLength(1);+ expect(h.error).not.toHaveBeenCalled();+ });+ it('shows one tip when a build finishes and does not repeat it on refresh', async () => {+ const f = harness([]);+ f.set({+ items: [],+ busy: true,+ canBuild: false,+ build: { status: 'packaging', buildId: 'build-1' },+ });+ render(<CindyMakeHistoryPanel />);+ await screen.findAllByText('cindyMake.personal.status.packaging');+ f.set({+ items: [],+ busy: false,+ canBuild: true,+ build: { status: 'ready', buildId: 'build-1' },+ });+ act(() => f.historyChanged());+ await waitFor(() =>+ expect(h.success).toHaveBeenCalledWith('cindyMake.personal.status.ready'),+ );+ act(() => f.historyChanged());+ await waitFor(() => expect(f.read).toHaveBeenCalledTimes(3));+ expect(h.success).toHaveBeenCalledTimes(1);+ f.set({+ items: [],+ busy: false,+ canBuild: true,+ build: { status: 'ready', buildId: 'build-2' },+ });+ act(() => f.historyChanged());+ await waitFor(() => expect(h.success).toHaveBeenCalledTimes(2));+ });+ it('shows the failure reason once when a build fails', async () => {+ const f = harness([]);+ f.set({+ items: [],+ busy: true,+ canBuild: false,+ build: { status: 'checking', buildId: 'build-1' },+ });+ render(<CindyMakeHistoryPanel />);+ await screen.findAllByText('cindyMake.personal.status.checking');+ f.set({+ items: [],+ busy: false,+ canBuild: true,+ build: { status: 'failed', error: 'checksFailed', buildId: 'build-1' },+ });+ act(() => f.historyChanged());+ await waitFor(() =>+ expect(h.error).toHaveBeenCalledWith('cindyMake.personal.errors.checksFailed'),+ );+ act(() => f.historyChanged());+ await waitFor(() => expect(f.read).toHaveBeenCalledTimes(3));+ expect(h.error).toHaveBeenCalledTimes(1);+ f.set({+ items: [],+ busy: false,+ canBuild: true,+ build: { status: 'failed', error: 'cleanupFailed', buildId: 'build-2' },+ });+ act(() => f.historyChanged());+ await waitFor(() => expect(h.error).toHaveBeenCalledWith('cindyMake.personal.errors.cleanupFailed'));+ });it('keeps the running test visible when its stop fails', async () => {const f = harness([item({ test: { status: 'ready' }, actions: ['continue'] })]);f.execute.mockRejectedValueOnce(new Error('[PRECONDITION_FAILED] stopFailed'));diff --git a/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeVersionsPanel.test.tsx b/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeVersionsPanel.test.tsxindex 8e1113386f..16db9b2383 100644--- a/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeVersionsPanel.test.tsx+++ b/apps/desktop/src/renderer/components/cindy-make/__tests__/CindyMakeVersionsPanel.test.tsx@@ -178,4 +178,16 @@ describe('Cindy Make local versions', () => {const remove = await screen.findByRole('button', { name: 'cindyMake.versions.remove' });expect((remove as HTMLButtonElement).disabled).toBe(true);});+ it('disables switching while the personal version is being built', async () => {+ render(<CindyMakeVersionsPanel buildRunning />);+ fireEvent.click(+ await screen.findByRole('button', { name: 'cindyMake.overview.switchVersion' }),+ );+ const switchButton = await screen.findByRole('button', {+ name: 'cindyMake.versions.errors.building',+ });+ expect((switchButton as HTMLButtonElement).disabled).toBe(true);+ fireEvent.click(switchButton);+ expect(h.act).not.toHaveBeenCalled();+ });});diff --git a/apps/desktop/src/renderer/components/settings/CindyMakeSection.tsx b/apps/desktop/src/renderer/components/settings/CindyMakeSection.tsxindex bc6ddd4521..3252e90eb8 100644--- a/apps/desktop/src/renderer/components/settings/CindyMakeSection.tsx+++ b/apps/desktop/src/renderer/components/settings/CindyMakeSection.tsx@@ -31,6 +31,7 @@ import { useCindyMakeSettings } from '@/lib/cindyMakeSettings';import { isSelectableVendor } from '@/lib/agentVendors';import { getDraft, getFastModeForModel } from '@/state/newMakerDraft';import { toast } from '@/lib/toast';+import { extractIpcError } from '@/utils/ipcError';import type { MakeDoctorReport, MakeSourceStatus } from '../../../shared/cindyMakeDoctor';const CINDY_MAKE_SETTINGS_TABS = ['versions', 'environment'] as const;@@ -49,6 +50,10 @@ export function CindyMakeSection() {const [report, setReport] = useState<MakeDoctorReport>();const makeState = useCindyMakeState();const [historyState, setHistoryState] = useState<CindyMakeHistoryState>();+ const buildRunning =+ !!historyState?.build && !['ready', 'failed'].includes(historyState.build.status);+ const buildRunningRef = useRef(buildRunning);+ buildRunningRef.current = buildRunning;const [versionsState, setVersionsState] = useState<CindyVersionsState>();const [dismissedPreparationId, setDismissedPreparationId] = useState<string>();const [trackedPreparationId, setTrackedPreparationId] = useState<string>();@@ -75,7 +80,7 @@ export function CindyMakeSection() {!!operation?.cancellationRequested ||(!!operation?.hasWorkspace && operation.status !== 'merged');const updateSource = async () => {- if (mergeSubmitting.current || mergeBlocked) return;+ if (mergeSubmitting.current || mergeBlocked || buildRunningRef.current) return;const owner = getDataOwnerGeneration();mergeSubmitting.current = true;try {@@ -85,7 +90,7 @@ export function CindyMakeSection() {confirmText: t('cindyMake.merge.confirm'),cancelText: t('settings.cindyMake.source.resetConfirm.cancel'),});- if (!confirmed || !isDataOwnerGenerationCurrent(owner)) return;+ if (!confirmed || !isDataOwnerGenerationCurrent(owner) || buildRunningRef.current) return;previousMergeId.current = operation?.id;setMergePending(true);const draft = getDraft();@@ -118,8 +123,15 @@ export function CindyMakeSection() {);// Refresh failure must not turn a completed update into a second, failure toast.await window.electronAPI.getCindyMakeSourceStatus().catch(() => undefined);- } catch {- if (isDataOwnerGenerationCurrent(owner)) toast.error(t('cindyMake.merge.errors.unavailable'));+ } catch (error) {+ if (isDataOwnerGenerationCurrent(owner))+ toast.error(+ t(+ extractIpcError(error)?.message?.replace(/^\[PRECONDITION_FAILED\]\s*/, '') === 'busy'+ ? 'cindyMake.merge.errors.busy'+ : 'cindyMake.merge.errors.unavailable',+ ),+ );} finally {mergeSubmitting.current = false;setMergePending(false);@@ -407,6 +419,7 @@ export function CindyMakeSection() {<CindyMakeVersionsPanelactive={activeTab === 'versions'}busy={historyState?.activeWork ?? historyState?.busy}+ buildRunning={buildRunning}onState={setVersionsState}refreshKey={historyState?.build?.status === 'ready'@@ -423,6 +436,7 @@ export function CindyMakeSection() {preparing={sourceBusy}merge={mergePending && merge?.id === previousMergeId.current ? undefined : merge}mergeBlocked={mergeBlocked}+ buildRunning={buildRunning}updating={mergePending || (mergeActive && !!merge)}onPrepare={() => {if (!sourceStatus || sourceBusy) return;@@ -476,6 +490,7 @@ function CindyMakeSourceStatusCard({onClear,merge,mergeBlocked = false,+ buildRunning = false,updating = false,}: {status?: MakeSourceStatus;@@ -485,6 +500,7 @@ function CindyMakeSourceStatusCard({onClear?: () => void | Promise<void>;merge?: CindyMakeMergeState;mergeBlocked?: boolean;+ buildRunning?: boolean;updating?: boolean;}) {const { t } = useTranslation();@@ -542,11 +558,13 @@ function CindyMakeSourceStatusCard({<div className="ml-auto flex flex-wrap justify-end gap-2"><CindyMakeMergeActions state={displayMerge} busy={updating}>{status?.status === 'ready' && onPrepare && (- <Tip text={t('cindyMake.merge.updateHint')}>+ <Tip+ text={t(buildRunning ? 'cindyMake.merge.buildingHint' : 'cindyMake.merge.updateHint')}+ ><Buttonvariant="secondary"className="gap-2"- disabled={preparing || mergeBlocked}+ disabled={preparing || mergeBlocked || buildRunning}loading={updating}onClick={onPrepare}>diff --git a/apps/desktop/src/renderer/components/settings/__tests__/CindyMakeSection.test.tsx b/apps/desktop/src/renderer/components/settings/__tests__/CindyMakeSection.test.tsxindex 6815fe3416..d79184fb6f 100644--- a/apps/desktop/src/renderer/components/settings/__tests__/CindyMakeSection.test.tsx+++ b/apps/desktop/src/renderer/components/settings/__tests__/CindyMakeSection.test.tsx@@ -5,6 +5,7 @@ import { MemoryRouter, useLocation } from 'react-router-dom';import { isValidElement } from 'react';import { CindyMakeSection } from '../CindyMakeSection';import type { CindyMakeMergeState, CindyMakeMergeRequest } from '../../../../shared/cindyMakeMerge';+import type { CindyMakePersonalBuildState } from '../../../../shared/cindyMakeSession';import { startMakeDoctor } from '@/lib/cindyMakeDoctor';import { setCindyMakeForceManagedTools } from '@/lib/cindyMakeSettings';import { setDataOwnerGeneration } from '@/contexts/dataOwnerGeneration';@@ -45,7 +46,11 @@ type Api = Parameters<typeof startMakeDoctor>[1];type Listener = Parameters<NonNullable<Api>['onDesktopCommandTriggered']>[0];type Result = Awaited<ReturnType<NonNullable<Api>['executeDesktopCommand']>>;-function harness(history: { busy: boolean; activeWork?: boolean } = { busy: false }) {+function harness(+ history: { busy: boolean; activeWork?: boolean; build?: CindyMakePersonalBuildState } = {+ busy: false,+ },+) {const listeners = new Set<Listener>();const sourceListeners = new Set<(status: MakeSourceStatus) => void>();const stateListeners = new Set<(state: CindyMakeGlobalState) => void>();@@ -1414,6 +1419,20 @@ describe('Settings > Cindy Make', () => {expect(h.starts()).toHaveLength(3);});+ it('disables manual source sync while a personal version is being built', async () => {+ const h = harness({ busy: true, activeWork: true, build: { status: 'checking' } });+ h.api.getCindyMakeSourceStatus.mockResolvedValue({+ status: 'ready',+ path: 'managed-source',+ ref: 'main',+ });+ renderVersions(<CindyMakeSection />);+ const button = await screen.findByRole('button', { name: 'cindyMake.merge.getLatest' });+ await waitFor(() => expect((button as HTMLButtonElement).disabled).toBe(true));+ fireEvent.click(button);+ expect(h.api.cindyMakeMerge).not.toHaveBeenCalled();+ });+it('confirms and starts clearing the source without re-pulling it', async () => {const h = harness();const source: MakeSourceStatus = {diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.jsonindex 11037db94b..d83485eccc 100644--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@ -13270,6 +13270,7 @@"usingHint": "You are using the latest personal version.","errors": {"busy": "Tasks, tests or builds are still running. Finish them before switching or deleting a version.",+ "building": "Your personal version is being built. Wait for it to finish or stop the build before switching versions.","incompatible": "The data structures differ. Rebuild your personal version from the current original version before switching.","unavailable": "This version could not be read. Rebuild it and try again.","launchFailed": "The target version could not start. The current version has been kept.",@@ -13515,6 +13516,7 @@"getLatest": "Sync latest source","taskTitle": "Resolve Source Update Conflicts","updateHint": "Update official source and reapply your personal changes.",+ "buildingHint": "A personal version is being built. Wait for it to finish or stop it before syncing source.","confirmTitle": "Update to the latest source?","confirmDescription": "Your personal changes will be kept. If conflicts occur, you will be asked before a resolution session starts.","conflictConfirm": {diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex 115cb4b830..6249c41593 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -13253,6 +13253,7 @@"usingHint": "最新の個人版を使用しています。","errors": {"busy": "タスク、テスト、ビルドが実行中です。終了してから切り替えまたは削除してください。",+ "building": "個人版をビルド中です。完了を待つか、ビルドを停止してからバージョンを切り替えてください。","incompatible": "データ構造が異なります。現在のオリジナル版から個人版を再度ビルドしてください。","unavailable": "このバージョンを読み込めません。再度ビルドしてお試しください。","launchFailed": "対象のバージョンを起動できませんでした。現在のバージョンは保持されています。",@@ -13496,6 +13497,7 @@"getLatest": "最新ソースを同期","taskTitle": "ソース更新時の競合を解決","updateHint": "公式ソースを更新し、個人の変更を保持します。",+ "buildingHint": "個人版をビルド中です。完了を待つか停止してからソースを同期してください。","confirmTitle": "最新ソースに更新しますか?","confirmDescription": "個人の変更は保持されます。競合が発生した場合は、解決用セッションを開始する前に確認します。","conflictConfirm": {diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex 3a369aa216..22d2a19c4c 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -13253,6 +13253,7 @@"usingHint": "최신 개인 버전을 사용 중입니다.","errors": {"busy": "작업, 테스트 또는 빌드가 진행 중입니다. 완료한 후 버전을 전환하거나 삭제하세요.",+ "building": "개인 버전을 빌드하는 중입니다. 완료될 때까지 기다리거나 빌드를 중지한 후 버전을 전환하세요.","incompatible": "데이터 구조가 다릅니다. 현재 기본 버전에서 개인 버전을 다시 빌드하세요.","unavailable": "이 버전을 읽을 수 없습니다. 다시 빌드한 후 시도하세요.","launchFailed": "대상 버전을 시작하지 못했습니다. 현재 버전은 유지됩니다.",@@ -13496,6 +13497,7 @@"getLatest": "최신 소스 동기화","taskTitle": "소스 업데이트 충돌 해결","updateHint": "공식 소스를 업데이트하고 개인 변경 사항을 유지합니다.",+ "buildingHint": "개인 버전을 빌드하는 중입니다. 완료를 기다리거나 중지한 후 소스를 동기화하세요.","confirmTitle": "최신 소스로 업데이트할까요?","confirmDescription": "개인 변경 사항은 유지됩니다. 충돌이 발생하면 해결 세션을 시작하기 전에 확인을 요청합니다.","conflictConfirm": {diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex 4f3e8d4643..3c06b5f93d 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@ -13253,6 +13253,7 @@"usingHint": "正在使用最新个人版。","errors": {"busy": "还有任务、测试或构建正在进行,请结束后再切换或删除版本。",+ "building": "正在生成个人版,请等待完成或停止制作后再切换版本。","incompatible": "数据结构不同,暂时不能切换到这份版本。请基于当前原版重新生成个人版。","unavailable": "无法读取这份版本,请重新生成后重试。","launchFailed": "未能启动目标版本,当前版本已保留。",@@ -13496,6 +13497,7 @@"getLatest": "同步最新源码","taskTitle": "处理源码更新冲突","updateHint": "更新官方源码,并保留个人改动。",+ "buildingHint": "个人版正在生成,完成或停止制作后才能同步源码。","confirmTitle": "更新到最新源码?","confirmDescription": "会保留你的个人改动。如有冲突,会先询问是否创建任务处理。","conflictConfirm": {diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.jsonindex 408158b7f7..40e510f1ac 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json@@ -13253,6 +13253,7 @@"usingHint": "正在使用最新個人版。","errors": {"busy": "仍有任務、測試或建置正在進行,請結束後再切換或刪除版本。",+ "building": "正在產生個人版,請等待完成或停止製作後再切換版本。","incompatible": "資料結構不同,暫時無法切換至此版本。請以目前原版重新產生個人版。","unavailable": "無法讀取此版本,請重新產生後再試。","launchFailed": "無法啟動目標版本,目前版本已保留。",@@ -13496,6 +13497,7 @@"getLatest": "同步最新原始碼","taskTitle": "處理原始碼更新衝突","updateHint": "更新官方原始碼,並保留個人改動。",+ "buildingHint": "個人版正在產生,完成或停止製作後才能同步原始碼。","confirmTitle": "更新到最新原始碼?","confirmDescription": "會保留你的個人改動。如有衝突,會先詢問是否建立任務處理。","conflictConfirm": {diff --git a/apps/desktop/src/renderer/lib/useCindyVersions.ts b/apps/desktop/src/renderer/lib/useCindyVersions.tsindex 10154a7451..65ecf6bfed 100644--- a/apps/desktop/src/renderer/lib/useCindyVersions.ts+++ b/apps/desktop/src/renderer/lib/useCindyVersions.ts@@ -50,7 +50,7 @@ export function useCindyVersions(enabled = true, refreshKey?: string) {const code = extractIpcError(failure)?.message;if (current())setError(- code && ['busy', 'incompatible', 'launchFailed'].includes(code) ? code : 'unavailable',+ code && ['busy', 'building', 'incompatible', 'launchFailed'].includes(code) ? code : 'unavailable',);} finally {busy.current = false;