Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

keep Enter from discarding an unscored POST drill answer after a scoring failure

[._.]/ Adam Eivya5f262546af8
diff --git a/client/src/components/meatspace/post/PostLlmDrillRunner.jsx b/client/src/components/meatspace/post/PostLlmDrillRunner.jsx
index 07bf327729..38b41d7db1 100644
--- a/client/src/components/meatspace/post/PostLlmDrillRunner.jsx
+++ b/client/src/components/meatspace/post/PostLlmDrillRunner.jsx
@@ -204,8 +204,12 @@ export default function PostLlmDrillRunner({ drill, timeLimitSec, drillIndex, dr
// LLM round-trip that scores the answer means Enter is usually long released
// by the time the verdict lands, so this is the latent form of the same bug,
// but the shape is the shape.
+ // A scoring FAILURE is also `scoring: false`, but its screen offers only
+ // "Retry scoring" — the answer was never appended to `responses`, so
+ // advancing from there would discard it and score the drill one response
+ // short. Stay disarmed until there is a verdict to acknowledge.
useEffect(() => {
- if (!isTraining || !trainingFeedback || trainingFeedback.scoring) return undefined;
+ if (!isTraining || !trainingFeedback || trainingFeedback.scoring || trainingFeedback.error) return undefined;
const onKey = (e) => {
if (e.key !== 'Enter' || shouldIgnoreGlobalKey(e)) return;
e.preventDefault();
diff --git a/client/src/components/meatspace/post/PostLlmDrillRunner.test.jsx b/client/src/components/meatspace/post/PostLlmDrillRunner.test.jsx
index ccebab4e06..9156f60d03 100644
--- a/client/src/components/meatspace/post/PostLlmDrillRunner.test.jsx
+++ b/client/src/components/meatspace/post/PostLlmDrillRunner.test.jsx
@@ -228,6 +228,31 @@ describe('PostLlmDrillRunner — training-mode scoring path', () => {
expect(await screen.findByText('75')).toBeInTheDocument();
expect(scorePostLlmDrill).toHaveBeenCalledTimes(2);
});
+
+ it('does not let Enter advance past a scoring failure, which would discard the unscored answer', async () => {
+ scorePostLlmDrill.mockRejectedValueOnce(new Error('provider unavailable'));
+ const onComplete = vi.fn();
+
+ render(
+ <PostLlmDrillRunner
+ drill={{ type: 'word-association', questions: [{ prompt: 'ocean' }] }}
+ timeLimitSec={60}
+ drillIndex={0}
+ drillCount={1}
+ onComplete={onComplete}
+ isTraining
+ />
+ );
+
+ fireEvent.change(screen.getByPlaceholderText(/type your associations/i), { target: { value: 'wave' } });
+ fireEvent.click(screen.getByText('Next'));
+ expect(await screen.findByText(/Scoring failed: provider unavailable/)).toBeInTheDocument();
+
+ fireEvent.keyDown(window, { key: 'Enter' });
+
+ expect(onComplete).not.toHaveBeenCalled();
+ expect(screen.getByText('Retry scoring')).toBeInTheDocument();
+ });
});
describe('combineTrainingScoreResults', () => {