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

address review (claude): reset the probe spy between tests, and keep a truncated clip from rendering as 0.0s

[._.]/ Adam Eivy2e09a79946c1
diff --git a/client/src/components/sprites/WalkWorkflow.jsx b/client/src/components/sprites/WalkWorkflow.jsx
index a9b9a34802..dd587c1133 100644
--- a/client/src/components/sprites/WalkWorkflow.jsx
+++ b/client/src/components/sprites/WalkWorkflow.jsx
@@ -44,8 +44,12 @@ function clipLengthLabel(run) {
if (!(delivered > 0)) return null;
const requested = Number(run?.duration);
const mismatch = requested > 0 && Math.abs(requested - delivered) >= 0.5;
+ // A truncated clip (a real but near-zero-length file) must not round to the
+ // "0.0s" that would read as the absent case handled above — give sub-0.05s
+ // lengths the extra digit so a broken clip looks broken, not unknown.
+ const shown = delivered.toFixed(delivered < 0.05 ? 2 : 1);
return {
- text: `${delivered.toFixed(1)}s clip${mismatch ? ` (asked ${requested}s)` : ''}`,
+ text: `${shown}s clip${mismatch ? ` (asked ${requested}s)` : ''}`,
mismatch,
};
}
diff --git a/client/src/components/sprites/WalkWorkflow.test.jsx b/client/src/components/sprites/WalkWorkflow.test.jsx
index 812f00eda9..5db4a615cc 100644
--- a/client/src/components/sprites/WalkWorkflow.test.jsx
+++ b/client/src/components/sprites/WalkWorkflow.test.jsx
@@ -754,6 +754,13 @@ describe('delivered clip length', () => {
expect(screen.queryByText(/asked/)).toBeNull();
});
+ it('keeps a truncated clip distinguishable from an unknown one', () => {
+ // 0.02s is a real (broken) clip; rounding it to "0.0s clip" would read as
+ // the absent/unknown case, which renders nothing at all.
+ renderWithRun({ duration: 6, sourceVideoSeconds: 0.02 });
+ expect(screen.getByText(/0\.02s clip/)).toBeTruthy();
+ });
+
it('renders nothing when the clip length is unknown', () => {
// Absent (older run, or ffprobe unavailable) must NOT read as a 0s clip.
renderWithRun({ duration: 6 });
diff --git a/server/services/sprites/walk.test.js b/server/services/sprites/walk.test.js
index f006977271..0c2189f4da 100644
--- a/server/services/sprites/walk.test.js
+++ b/server/services/sprites/walk.test.js
@@ -276,6 +276,11 @@ beforeEach(() => {
executeTuiRun.mockImplementation(() => new Promise(() => {}));
prepareWalkAnchorChromaInput.mockClear();
runWalkPostprocess.mockClear();
+ // Reset the probe too (not just mockClear): a `mockResolvedValueOnce` primed
+ // by a test whose run errors before packageRun would otherwise stay queued
+ // and leak its value into the next test's first probe.
+ probeVideoDuration.mockReset();
+ probeVideoDuration.mockResolvedValue(null);
rmSync(join(TEST_ROOT, 'sprite-records.json'), { force: true });
});
afterAll(() => rmSync(TEST_ROOT, { recursive: true, force: true }));