- Fix `simple_test_analysis` template in E2E test setup to align with Orchestrator's data fetch logic.
- Implement and verify additional E2E scenarios:
- Scenario C: Partial Provider Failure (verified error propagation fix in Orchestrator).
- Scenario D: Invalid Symbol input.
- Scenario E: Analysis Module failure.
- Update `WorkflowStateMachine::handle_report_failed` to correctly scope error broadcasting to the specific task instead of failing effectively silently or broadly.
- Update testing strategy documentation to reflect completed Phase 4 testing.
- Skip Scenario B (Orchestrator Restart) as persistence is not yet implemented (decision made to defer persistence).
78 lines
2.5 KiB
TypeScript
78 lines
2.5 KiB
TypeScript
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
|
||
import { Spinner } from '@/components/ui/spinner';
|
||
import { formatElapsedTime } from '../utils';
|
||
|
||
interface TaskStatusProps {
|
||
requestId: string | null;
|
||
taskProgress: any;
|
||
startTime: number | null;
|
||
elapsedSeconds: number;
|
||
completionProgress: number;
|
||
currentAnalysisTask: string | null;
|
||
analysisConfig: any;
|
||
}
|
||
|
||
export function TaskStatus({
|
||
requestId,
|
||
taskProgress,
|
||
startTime,
|
||
elapsedSeconds,
|
||
completionProgress,
|
||
currentAnalysisTask,
|
||
analysisConfig,
|
||
}: TaskStatusProps) {
|
||
return (
|
||
<>
|
||
<Card className="w-80">
|
||
<CardHeader>
|
||
<CardTitle className="text-lg">任务进度(新架构)</CardTitle>
|
||
</CardHeader>
|
||
<CardContent className="text-xs text-muted-foreground">
|
||
{requestId ? (
|
||
<pre>{JSON.stringify(taskProgress || {}, null, 2)}</pre>
|
||
) : (
|
||
<div>未触发任务</div>
|
||
)}
|
||
</CardContent>
|
||
</Card>
|
||
|
||
<Card className="w-80">
|
||
<CardHeader className="flex flex-col space-y-2 pb-2">
|
||
<div className="flex flex-row items-center justify-between w-full">
|
||
<CardTitle className="text-xl">任务状态</CardTitle>
|
||
{startTime && (
|
||
<div className="text-sm font-medium text-muted-foreground ml-auto">
|
||
总耗时: {formatElapsedTime(elapsedSeconds)}
|
||
</div>
|
||
)}
|
||
</div>
|
||
<div className="w-full bg-muted rounded-full h-2 mt-1">
|
||
<div
|
||
className="bg-primary h-2 rounded-full transition-all duration-300"
|
||
style={{ width: `${completionProgress}%` }}
|
||
/>
|
||
</div>
|
||
</CardHeader>
|
||
<CardContent className="space-y-2">
|
||
{currentAnalysisTask && analysisConfig && (
|
||
(() => {
|
||
const analysisName = analysisConfig.analysis_modules?.[currentAnalysisTask]?.name || currentAnalysisTask;
|
||
const modelName = analysisConfig.analysis_modules?.[currentAnalysisTask]?.model || 'AI';
|
||
return (
|
||
<div className="flex items-center gap-2 text-sm">
|
||
<Spinner className="size-4" />
|
||
<div>
|
||
<div className="font-medium">{analysisName}(来自 {modelName})</div>
|
||
<div className="text-xs text-muted-foreground">正在生成{analysisName}...</div>
|
||
</div>
|
||
</div>
|
||
);
|
||
})()
|
||
)}
|
||
</CardContent>
|
||
</Card>
|
||
</>
|
||
);
|
||
}
|
||
|