Profile longest task duration does not include completed goal timeUsedSeconds

Resolved 💬 1 comment Opened Jun 2, 2026 by Leezaixian-Ctrl Closed Jun 10, 2026

Summary

The Codex profile page shows "Longest task duration" as 2h 49m, but a completed goal task in the local session history has timeUsedSeconds = 154663 (42h 57m 43s). The profile metric appears not to include the completed goal duration.

Expected behavior

The profile statistic should show approximately 42h 58m, or at least a value greater than the current 2h 49m.

Actual behavior

The profile shows 2h 49m.

Evidence

  • Session ID: 019e6426-0ab8-7731-b255-6bfe3974b260
  • Goal status: complete
  • Final goal timing: timeUsedSeconds = 154663
  • Completion time: 2026-06-02 22:53:45 CST
  • Local rollout path pattern: ~/.codex/sessions/2026/05/26/rollout-2026-05-26T19-57-55-019e6426-0ab8-7731-b255-6bfe3974b260.jsonl

The final thread_goal_updated event contains:

{
  "status": "complete",
  "timeUsedSeconds": 154663
}

Additional local findings

The local goals_1.sqlite database currently has an empty thread_goals table after the goal is complete, so completed goals may be removed from the active-goals table. The thread remains in state_5.sqlite, but that row stores wall-clock timestamps, not the final goal duration.

This suggests the profile statistic may be reading from an active-goal table, a stale aggregate, or a service-side metric that did not ingest the final completed goal event.

Suggested fix

When computing "Longest task duration", include completed goal records from final thread_goal_updated events, not only active goal rows or single-turn task durations.

At minimum, completed goals with:

status = complete
timeUsedSeconds > current_longest_task_duration

should update the profile longest-task statistic.

No private project name, local username, full local path, full logs, or token usage data is included here.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗