Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint .",
"lint": "eslint . --max-warnings 0",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/app/proof/[req_id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function ProofDetailPage() {
setFilterGate(saved.gate);
setFilterResult(saved.result);
setSearch(saved.search);
}, []);
}, [reqId]);

const { data: req, error: reqError, isLoading: reqLoading, mutate: mutateReq } =
useSWR<ProofRequirement>(
Expand Down
5 changes: 3 additions & 2 deletions web-ui/src/components/execution/BatchExecutionMonitor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,16 @@ export function BatchExecutionMonitor({ batchId, workspacePath }: BatchExecution
}, [batchId, workspacePath]); // eslint-disable-line react-hooks/exhaustive-deps

// Poll every 5 seconds while batch is active
const batchStatus = batch?.status;
useEffect(() => {
const isActive = batch && !['COMPLETED', 'FAILED', 'CANCELLED'].includes(batch.status);
const isActive = batchStatus && !['COMPLETED', 'FAILED', 'CANCELLED'].includes(batchStatus);
if (isActive) {
pollRef.current = setInterval(fetchBatch, 5000);
}
return () => {
if (pollRef.current) clearInterval(pollRef.current);
};
}, [batch?.status, fetchBatch]);
}, [batchStatus, fetchBatch]);

// Note: batch.completed / blocker.created notifications are dispatched by the
// cross-page background watcher in NotificationProvider (issue #652), so they
Expand Down
45 changes: 23 additions & 22 deletions web-ui/src/components/prd/DiscoveryPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ export function DiscoveryPanel({
const [error, setError] = useState<string | null>(null);
const [pendingSession, setPendingSession] = useState<PendingSession | null>(null);

// ─── Start a brand-new session ─────────────────────────────────
// Declared before initSession so it can be a stable dependency of it.
const startNewSession = useCallback(async () => {
setError(null);
setPendingSession(null);
try {
const resp = await discoveryApi.start(workspacePath);
setSessionId(resp.session_id);
setState('discovering');
setMessages([
{
role: 'assistant',
content: questionText(resp.question),
timestamp: now(),
},
]);
} catch (err) {
const apiErr = err as ApiError;
setError(apiErr.detail || 'Failed to start discovery session');
}
}, [workspacePath]);

// ─── Initialise: check for existing session before starting ────
const initSession = useCallback(async () => {
setIsThinking(true);
Expand Down Expand Up @@ -80,28 +102,7 @@ export function DiscoveryPanel({
} finally {
setIsThinking(false);
}
}, [workspacePath]);

// ─── Start a brand-new session ─────────────────────────────────
const startNewSession = useCallback(async () => {
setError(null);
setPendingSession(null);
try {
const resp = await discoveryApi.start(workspacePath);
setSessionId(resp.session_id);
setState('discovering');
setMessages([
{
role: 'assistant',
content: questionText(resp.question),
timestamp: now(),
},
]);
} catch (err) {
const apiErr = err as ApiError;
setError(apiErr.detail || 'Failed to start discovery session');
}
}, [workspacePath]);
}, [workspacePath, startNewSession]);

// ─── Resume an existing session ────────────────────────────────
const resumeSession = useCallback(() => {
Expand Down
Loading