fraudTech commited on
Commit
08c5272
·
1 Parent(s): e4e3c4c

Fix discover-and-stage status

Browse files
Files changed (1) hide show
  1. src/App.js +6 -5
src/App.js CHANGED
@@ -269,9 +269,9 @@ function App() {
269
  // ============================================================
270
  // SESSION MEMORY (list / clear / discover&stage)
271
  // ============================================================
272
- async function refreshSessionMemory() {
273
  if (!token) return;
274
- setSessionPanelStatus(null);
275
  setSessionPanelLoading(true);
276
  try {
277
  const res = await listSessionLemmas(sessionId, token);
@@ -306,7 +306,7 @@ function App() {
306
  ? `Ingested ${res.arxiv_id || id} and staged ${stagedParas} paragraphs into this session.`
307
  : `Ingested ${res.arxiv_id || id} into this session.`
308
  );
309
- await refreshSessionMemory();
310
  } catch (err) {
311
  setSessionPanelStatus(`Error: ${err.message}`);
312
  } finally {
@@ -331,7 +331,7 @@ function App() {
331
  ? `Ingested story and staged ${stagedParas} paragraphs into this session.`
332
  : "Ingested story into this session."
333
  );
334
- await refreshSessionMemory();
335
  } catch (err) {
336
  setSessionPanelStatus(`Error: ${err.message}`);
337
  } finally {
@@ -373,6 +373,7 @@ function App() {
373
  }
374
 
375
  try {
 
376
  const res = await discoverMath(question, token, sessionId, 5, 250, true);
377
  const staged = res.staged;
378
  if (staged && staged.ok) {
@@ -387,7 +388,7 @@ function App() {
387
  } else {
388
  setSessionPanelStatus("Discovery completed.");
389
  }
390
- await refreshSessionMemory();
391
  } catch (err) {
392
  setSessionPanelStatus(`Error: ${err.message}`);
393
  } finally {
 
269
  // ============================================================
270
  // SESSION MEMORY (list / clear / discover&stage)
271
  // ============================================================
272
+ async function refreshSessionMemory({ clearStatus = true } = {}) {
273
  if (!token) return;
274
+ if (clearStatus) setSessionPanelStatus(null);
275
  setSessionPanelLoading(true);
276
  try {
277
  const res = await listSessionLemmas(sessionId, token);
 
306
  ? `Ingested ${res.arxiv_id || id} and staged ${stagedParas} paragraphs into this session.`
307
  : `Ingested ${res.arxiv_id || id} into this session.`
308
  );
309
+ await refreshSessionMemory({ clearStatus: false });
310
  } catch (err) {
311
  setSessionPanelStatus(`Error: ${err.message}`);
312
  } finally {
 
331
  ? `Ingested story and staged ${stagedParas} paragraphs into this session.`
332
  : "Ingested story into this session."
333
  );
334
+ await refreshSessionMemory({ clearStatus: false });
335
  } catch (err) {
336
  setSessionPanelStatus(`Error: ${err.message}`);
337
  } finally {
 
373
  }
374
 
375
  try {
376
+ setSessionPanelStatus("Running math discovery (hybrid validation)…");
377
  const res = await discoverMath(question, token, sessionId, 5, 250, true);
378
  const staged = res.staged;
379
  if (staged && staged.ok) {
 
388
  } else {
389
  setSessionPanelStatus("Discovery completed.");
390
  }
391
+ await refreshSessionMemory({ clearStatus: false });
392
  } catch (err) {
393
  setSessionPanelStatus(`Error: ${err.message}`);
394
  } finally {