Profile "Longest task" does not update for completed long-running /goal tasks
Bug
Codex Profile "Longest task" is not updating for completed long-running slash goals.
This appears related to goal/profile persistence, but the key detail is that this is not only old experimental-goal history: an 8h+ /goal was run after the Profile / "Longest task" feature was already visible in the Codex app, completed successfully, and still did not update the profile stat.
Environment
- Codex CLI:
codex-cli 0.130.0 - Platform: macOS
- Local
~/.codex/version.jsonlatest_version:0.130.0
Details
- Current Profile "Longest task" remains stuck at 3h 48m.
- I ran an 8h+ Codex task after the Profile / "Longest task" feature was already visible in the app.
- That task was an actual slash goal (
/goal) and completed successfully. - The profile stat still did not update.
- I originally remembered an older long task as roughly 41h, but local evidence shows the PRISM
/goalsession actually spanned about 53.63h and did not save/show in profile stats.
Local Evidence
Local Codex CLI session history exists for a task longer than my original ~41h estimate:
~/.codex/sessions/2026/05/04/rollout-2026-05-04T17-27-21-019df51a-6664-7600-b1bb-c46a6f9f54c3.jsonl- Timestamp span: about 53.63h
- Appears to be a PRISM
/goaltask
But:
~/.codex/goals_1.sqliteexiststhread_goalscurrently has 0 rowsgoals_1.sqlitemigration:1 | thread goals | 2026-05-22 18:16:08 | success=1state_5.sqlitegoal migrations:29 | thread goals | 2026-05-01 00:36:17 | success=133 | thread goal stopped statuses | 2026-05-22 18:16:08 | success=134 | drop thread goals | 2026-05-22 18:16:08 | success=1
So the raw session history exists, but the structured goal/profile tracker did not persist the long-running goal records.
Related Issue
Possibly related to #25407, but this report is specifically about Profile "Longest task" not updating for a post-Profile, real completed /goal, plus local evidence that the goal DB has no persisted rows.
Expected
The Profile "Longest task" stat should update to the longest completed /goal task.
Actual
The stat remains stuck at 3h 48m despite completed 8h+ and much longer goal sessions.
Evidence Available
I can provide screenshots of:
- Profile showing "Longest task" stuck at 3h 48m
- Completed 8h+
/goal - Longer CLI/session evidence
I am not pasting raw JSONL contents publicly because session logs may contain sensitive material, but I can provide them privately through a secure support channel if needed.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Adding context after checking the related goal-storage issues (#23984, #25407, and the duplicate suggestion #25881):
The existing recovery advice/workarounds I found are:
codex app-serverprocesses so the app-server version matches the CLI version;goalsfeature flag is not explicitly disabled;thread/goal/getfailures that may be SQLite corruption, rebuild local Codex state DBs (goals_1.sqlite*/state_5.sqlite*) after backup/restart.This issue is meant to track a distinct downstream symptom: the Profile
Longest taskstat did not update for a completed 8h+/goalthat happened after the Profile stat existed, and local raw session history shows much longer goal-like sessions while the structuredgoals_1.sqlite.thread_goalstable is empty (count(*) = 0).So even if restart/DB rebuild fixes future
/goaloperation, there still appears to be a profile-stat persistence/backfill gap: completed long-running goal history exists in session JSONL, but the structured goal/profile tracker did not retain it forLongest task.Yes, the "longest task" displayed in the profile should more accurately be labeled "longest turn". A
/goalis composed of many turns, so it doesn't appear in this accounting. We're considering adding separate accounting for goals.The profile metric needs separate concepts for
turn,goal run, andsession.For
/goal, storegoal_run_id, started_at, completed_at, terminal status, turn ids included, model legs, and interruptions. The profile can then show longest turn and longest completed goal separately, instead of making an 8h goal disappear because it was split across many turns.---
_Generated with ax._