Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.
TypeScript agent-skillscodex-clideskop-appdubbingimage-generationlocalizationskillsttsvideo-editingvideo-generationvideo-transcriptionvideo-translation
fix(web): keep optional runtime diagnostics clear of Creator workspace
Leggetta4d95bec3252
diff --git a/apps/desktop/e2e/creator-packaged-app.spec.ts b/apps/desktop/e2e/creator-packaged-app.spec.tsindex 488fc077..872f87b5 100644--- a/apps/desktop/e2e/creator-packaged-app.spec.ts+++ b/apps/desktop/e2e/creator-packaged-app.spec.ts@@ -188,6 +188,10 @@ test('打包 App 的浅色窗口按钮区域与设置侧栏连续且保留标题await expect(fixture.app.page.getByRole('button', { name: '返回应用' })).toBeVisible();for (const [theme, label] of [['light', '浅色'], ['dark', '深色']] as const) {+ const diagnostics = fixture.app.page.getByRole('complementary', { name: 'Agent 诊断' });+ if (await diagnostics.isVisible()) {+ await diagnostics.getByRole('button', { name: '收起诊断' }).click();+ }await fixture.app.page.getByRole('button', { name: label, exact: true }).click();await expect(fixture.app.page.locator('html')).toHaveAttribute('data-theme', theme);expect(await fixture.app.page.evaluate(() => {diff --git a/apps/desktop/test/telemetry.test.ts b/apps/desktop/test/telemetry.test.tsindex b8ccf730..a2ebd496 100644--- a/apps/desktop/test/telemetry.test.ts+++ b/apps/desktop/test/telemetry.test.ts@@ -299,7 +299,8 @@ describe('desktop telemetry', () => {reject(new DOMException('Aborted', 'AbortError'));}, { once: true });});- })+ }),+ persistence: memoryPersistence().persistence as TelemetryPersistence});await requestStarted;diff --git a/apps/web/src/app/AppController.tsx b/apps/web/src/app/AppController.tsxindex cd5876b4..d20ecf82 100644--- a/apps/web/src/app/AppController.tsx+++ b/apps/web/src/app/AppController.tsx@@ -4999,6 +4999,7 @@ export function AppController(props: AppControllerProps) {/><AgentDiagnosticsPanelhiddenCreatorIssues={immersiveWorkspace && props.route.view === 'workbench' && props.route.jobId === undefined}+ hiddenBackgroundRuntimeIssues={immersiveWorkspace && props.route.view === 'workbench'}onAskIssue={askAgentAboutIssue}/></div></PageIssueRoutingProvider>diff --git a/apps/web/src/app/use-runtime-dependencies.ts b/apps/web/src/app/use-runtime-dependencies.tsindex 0547430a..872dd0e2 100644--- a/apps/web/src/app/use-runtime-dependencies.ts+++ b/apps/web/src/app/use-runtime-dependencies.ts@@ -47,12 +47,12 @@ export function useRuntimeDependencies(input: {setYtDlpStatus(response.ytDlp);pageIssues.resolveOperation('runtime.load-yt-dlp');if (!response.ytDlp.checkDue) return;- operationId = 'runtime.check-yt-dlp';+ operationId = 'runtime.auto-check-yt-dlp';setPhase('checking');const checked = await input.service?.checkYtDlpUpdate(false);if (active && checked !== undefined) {setYtDlpStatus(checked.ytDlp);- pageIssues.resolveOperation('runtime.check-yt-dlp');+ pageIssues.resolveOperation('runtime.auto-check-yt-dlp');}}).catch(caught => {@@ -89,6 +89,7 @@ export function useRuntimeDependencies(input: {const response = await input.service.checkYtDlpUpdate(force);setYtDlpStatus(response.ytDlp);pageIssues.resolveOperation('runtime.check-yt-dlp');+ pageIssues.resolveOperation('runtime.auto-check-yt-dlp');pageIssues.resolveOperation('runtime.load-yt-dlp');return response.ytDlp;} catch (caught) {diff --git a/apps/web/src/features/issues/AgentDiagnosticsPanel.test.tsx b/apps/web/src/features/issues/AgentDiagnosticsPanel.test.tsxindex 99019089..2ecc5e06 100644--- a/apps/web/src/features/issues/AgentDiagnosticsPanel.test.tsx+++ b/apps/web/src/features/issues/AgentDiagnosticsPanel.test.tsx@@ -1,10 +1,11 @@import { act, fireEvent, render, screen, within } from '@testing-library/react';import { afterEach, describe, expect, it, vi } from 'vitest';import { LanguageProvider } from '../../i18n/LanguageProvider.js';+import { ApiClientError } from '../../runtime/client.js';import AgentDiagnosticsPanel from './AgentDiagnosticsPanel.js';import { IssueList, PageIssueRoutingProvider } from './IssuePresenter.js';-import { clearPageIssues } from './page-issue-hub.js';-import { usePageIssueState } from './page-issue-state.js';+import { clearPageIssues, publishPageIssue } from './page-issue-hub.js';+import { normalizePageIssue, usePageIssueState } from './page-issue-state.js';afterEach(() => act(() => clearPageIssues()));@@ -24,6 +25,32 @@ function Harness(props: {}describe('AgentDiagnosticsPanel', () => {+ it('keeps background runtime failures accessible without blocking Creator workflows', () => {+ const onAskIssue = vi.fn();+ const { rerender } = render(<LanguageProvider initialPreference="zh-CN"><AgentDiagnosticsPanel hiddenBackgroundRuntimeIssues onAskIssue={onAskIssue} /></LanguageProvider>);+ act(() => {+ publishPageIssue(normalizePageIssue(+ 'runtime',+ 'runtime.load-yt-dlp',+ new ApiClientError({ status: 503, code: 'creator_yt_dlp_update_unavailable', message: 'yt-dlp updates are unavailable' }),+ '无法读取运行组件。'+ ));+ publishPageIssue(normalizePageIssue(+ 'runtime',+ 'runtime.auto-check-yt-dlp',+ new ApiClientError({ status: 502, code: 'creator_yt_dlp_update_check_failed', message: 'yt-dlp update check failed' }),+ '自动检查运行组件失败。'+ ));+ });++ expect(screen.queryByRole('complementary', { name: 'Agent 诊断' })).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: '打开 Agent 诊断' })).not.toBeInTheDocument();+ rerender(<LanguageProvider initialPreference="zh-CN"><AgentDiagnosticsPanel onAskIssue={onAskIssue} /></LanguageProvider>);+ fireEvent.click(screen.getByRole('button', { name: '打开 Agent 诊断' }));+ expect(screen.getByRole('complementary', { name: 'Agent 诊断' })).toHaveTextContent('creator_yt_dlp_update_unavailable');+ expect(screen.getByRole('complementary', { name: 'Agent 诊断' })).toHaveTextContent('creator_yt_dlp_update_check_failed');+ });+it('routes page failures into one conversation, deduplicates retries and follows the selected issue', () => {const onAskIssue = vi.fn();const onRetry = vi.fn();diff --git a/apps/web/src/features/issues/AgentDiagnosticsPanel.tsx b/apps/web/src/features/issues/AgentDiagnosticsPanel.tsxindex 90a3b1f1..06a5dd3b 100644--- a/apps/web/src/features/issues/AgentDiagnosticsPanel.tsx+++ b/apps/web/src/features/issues/AgentDiagnosticsPanel.tsx@@ -16,6 +16,7 @@ import './agent-diagnostics.css';export default function AgentDiagnosticsPanel(props: {hiddenCreatorIssues?: boolean;+ hiddenBackgroundRuntimeIssues?: boolean;onAskIssue(issue: OpenCreatorIssue, question: string): void;}) {const { language } = useAppLanguage();@@ -23,10 +24,9 @@ export default function AgentDiagnosticsPanel(props: {const allIssues = useSyncExternalStore(subscribePageIssues, getPageIssues, getPageIssues);const actionsByIssueId = useSyncExternalStore(subscribePageIssueActions, getPageIssueActionsSnapshot, getPageIssueActionsSnapshot);const issues = useMemo(() => allIssues.filter(issue => (- !props.hiddenCreatorIssues- || issue.scope.kind !== 'page'- || issue.scope.surface !== 'creator-launch'- )), [allIssues, props.hiddenCreatorIssues]);+ !(props.hiddenCreatorIssues && issue.scope.kind === 'page' && issue.scope.surface === 'creator-launch')+ && !(props.hiddenBackgroundRuntimeIssues && isBackgroundRuntimeIssue(issue))+ )), [allIssues, props.hiddenCreatorIssues, props.hiddenBackgroundRuntimeIssues]);const [open, setOpen] = useState(false);const [focusedIssueId, setFocusedIssueId] = useState<string | null>(null);const [input, setInput] = useState('');@@ -36,9 +36,10 @@ export default function AgentDiagnosticsPanel(props: {useEffect(() => {const latest = issues.at(-1);const key = latest === undefined ? undefined : `${latest.id}:${latest.occurrenceCount}`;- if (key !== undefined && key !== latestIssueRef.current) setOpen(true);+ if (latest !== undefined && key !== latestIssueRef.current+ && !isBackgroundRuntimeIssue(latest)) setOpen(true);latestIssueRef.current = key;- }, [allIssues]);+ }, [issues]);useEffect(() => () => clearPageIssues(), []);if (issues.length === 0) return null;@@ -93,6 +94,11 @@ export default function AgentDiagnosticsPanel(props: {);}+function isBackgroundRuntimeIssue(issue: OpenCreatorIssue): boolean {+ return issue.scope.kind === 'page' && issue.scope.surface === 'runtime'+ && (issue.operation === 'runtime.load-yt-dlp' || issue.operation === 'runtime.auto-check-yt-dlp');+}+function DiagnosticMessage(props: {issue: OpenCreatorIssue;language: 'zh-CN' | 'en-US';diff --git a/apps/web/src/features/settings/RuntimeComponentsSettingsView.tsx b/apps/web/src/features/settings/RuntimeComponentsSettingsView.tsxindex ff101501..800e889f 100644--- a/apps/web/src/features/settings/RuntimeComponentsSettingsView.tsx+++ b/apps/web/src/features/settings/RuntimeComponentsSettingsView.tsx@@ -71,6 +71,7 @@ export function RuntimeComponentsSettingsView(props: {issues={issues}actions={{ retryOperations: {'runtime.load-yt-dlp': async () => { await props.controller.checkYtDlpUpdate(true); },+ 'runtime.auto-check-yt-dlp': async () => { await props.controller.checkYtDlpUpdate(true); },'runtime.check-yt-dlp': async () => { await props.controller.checkYtDlpUpdate(true); },'runtime.update-yt-dlp': async () => { await props.controller.updateYtDlp(); }} }}@@ -144,6 +145,7 @@ export function RuntimeComponentsSettingsView(props: {issues={issues}actions={{ retryOperations: {'runtime.load-yt-dlp': async () => { await props.controller.checkYtDlpUpdate(true); },+ 'runtime.auto-check-yt-dlp': async () => { await props.controller.checkYtDlpUpdate(true); },'runtime.check-yt-dlp': async () => { await props.controller.checkYtDlpUpdate(true); },'runtime.update-yt-dlp': async () => { await props.controller.updateYtDlp(); }} }}