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

fix(cos): use queue source for task ETA

[._.]/ Adam Eivy3ac30c54879d
diff --git a/client/src/components/cos/tabs/TaskItem.jsx b/client/src/components/cos/tabs/TaskItem.jsx
index 2d0986a2c0..b22c4e163a 100644
--- a/client/src/components/cos/tabs/TaskItem.jsx
+++ b/client/src/components/cos/tabs/TaskItem.jsx
@@ -83,7 +83,9 @@ export default function TaskItem({ task, isSystem, onRefresh, providers, duratio
const durationEstimate = useMemo(() => {
if (!durations || task.status !== 'pending') return null;
- const taskType = extractCosTaskType(task);
+ // Queue reads return raw parsed tasks without taskType. Supply the queue
+ // source so this estimate stays in the same bucket the server records.
+ const taskType = extractCosTaskType({ ...task, taskType: task.taskType || taskSource });
const typeData = durations[taskType];
const overallData = durations._overall;
diff --git a/client/src/components/cos/tabs/TaskItem.test.jsx b/client/src/components/cos/tabs/TaskItem.test.jsx
index 5bdf50738d..0e327166bd 100644
--- a/client/src/components/cos/tabs/TaskItem.test.jsx
+++ b/client/src/components/cos/tabs/TaskItem.test.jsx
@@ -52,6 +52,23 @@ describe('TaskItem task source', () => {
expect(screen.getByText('~2m')).toBeInTheDocument();
});
+ it('uses its queue source for an untyped raw task ETA', () => {
+ const rawUserTask = {
+ ...task,
+ id: 'user-fix',
+ description: 'Fix the queued task display',
+ };
+ const durations = {
+ 'user-task': { avgDurationMin: 3, p80DurationMs: 180000, completed: 4, successRate: 100 },
+ 'auto-fix': { avgDurationMin: 1, p80DurationMs: 60000, completed: 9, successRate: 100 },
+ };
+
+ render(<TaskItem task={rawUserTask} onRefresh={vi.fn()} providers={providers} durations={durations} />);
+
+ expect(screen.getByTitle('Based on 4 completed user-task tasks')).toBeInTheDocument();
+ expect(screen.getByText('~3m')).toBeInTheDocument();
+ });
+
it('updates a system task in the internal queue when saving its model', async () => {
render(<TaskItem task={task} isSystem onRefresh={vi.fn()} providers={providers} />);