bug: large Codex histories block cold-load and make --tail time out
What's broken
After a daemon restart, an existing Codex-backed agent with a large, multi-day history can no longer load in Paseo. The desktop shows Couldn't refresh agent history. Retrying..., and even a request for only the latest 10 entries times out after exactly 60 seconds.
I reproduced this with two separate agents. Upgrading Paseo from 0.2.5 to 0.3.1 and restarting the daemon did not resolve either case. CLI and daemon were both 0.3.1, and the Codex provider was reported as available.
Expected: metadata should load promptly and recent timeline entries should be available without hydrating the entire native provider history.
Actual: agent metadata returns, but timeline cold-load remains in flight beyond the client's 60-second timeout. A request with --tail 10 appears to wait for the complete Codex history first.
Steps to reproduce
-
Use a Codex-backed Paseo agent long enough to accumulate a large, multi-day native history with many compactions.
-
Restart the Paseo daemon so the agent must be cold-loaded.
-
Open the agent in Paseo Desktop, or run:
time paseo logs <agent-id> --tail 10 -
Observe that Desktop repeatedly reports that it cannot refresh agent history and the CLI times out after 60 seconds.
This reproduced on two independent, valid Codex JSONL histories:
- Case A: about 137 MiB, 50,284 records, 84 compaction records.
- Case B: about 248 MiB, 41,911 records, 71 compaction records. Compaction records accounted for about 174 MiB; the largest individual record was about 3.1 MiB.
Both files were newline-terminated and every JSONL record parsed successfully. Full local validation took roughly 3–6 seconds, so this does not appear to be malformed history.
Where did this happen
Daemon
Paseo version
0.3.1 (also reproduced before upgrading from 0.2.5)
OS version
macOS 26.5.2, Apple silicon
Agent provider
Codex
Provider configuration
Codex CLI 0.147.0 with OpenAI; GPT-5.6 Sol. Paseo daemon and CLI both 0.3.1.
Logs
Sanitized raw CLI output from a failing request:
$ time paseo logs <agent-id> --tail 10
Error: Failed to get logs: Timeout waiting for message (60000ms)
paseo logs <agent-id> --tail 10 0.59s user 0.08s system 1% cpu 1:00.53 total
The full daemon log is not attached because its large Pino records contain private conversation content, local paths, and identifiers. A bounded inspection showed the following request sequence without exposing those values:
fetch_agent_request received
fetch_agent_response emitted promptly
fetch_agent_timeline_request received
no fetch_agent_timeline_response before client timeout
runtime.inflightRequests remained 1 for approximately 180 seconds
agents.total remained 0
timeline statistics remained 0
There was no provider error, fatal error, or completed hydration event in that bounded interval. After the CLI disconnected at 60 seconds, the server-side request remained in flight until later cleanup.
Additional bounded diagnostics
Direct calls to the same Codex app-server session separated metadata resume from history pagination:
thread/resumewithexcludeTurns: true: approximately 0.9 seconds.thread/turns/listfor the latest 10 turns: approximately 1.55 seconds total.
By contrast, Paseo's cold-load path appeared to call thread/resume without excludeTurns and wait for the full returned history before making timeline data available. This also explains why paseo logs --tail 10 did not bound the cold-load work.
A durable workaround was to create a curated copy of the history, fork it to a new native Codex thread ID, and retarget the existing Paseo agent record. In Case B, reducing 248 MiB to 11.8 MiB while retaining 313 substantive conversation turns made the same paseo logs --tail 10 call complete in 1.13 seconds. Replacing the rollout while retaining the original native thread ID was not durable because Codex restored the canonical full session.
Possible fix direction: metadata-only resume using excludeTurns: true, followed by bounded thread/turns/list pagination (recent turns first), plus cancellation of server-side hydration when the requesting client disconnects or times out.
Related upstream Codex report about oversized thread/resume payloads: https://github.com/openai/codex/issues/26352
Screenshots or video
Not attached because the UI screenshot contains private conversation and workspace information. The exact UI message is included above.
Still reproducible on Paseo 0.7.2 on macOS 26.6.2.
Affected agent:
- provider: Codex
- model: gpt-6-astra
- agent age: ~1 hour
- Codex CLI: 0.153.0
paseo provider diagnostic codex: Status Ready
UI symptom:
Couldn't refresh agent history
Timeout waiting for message (60000ms)
CLI reproduction:
$ time paseo logs e6dfdc8 --tail 10 Error: Failed to get logs: Timeout waiting for message (60000ms) paseo logs e6dfdc8 --tail 10 0.70s user 0.11s system 1% cpu 1:00.59 total
The daemon remains responsive and other RPCs return normally.
This also reproduces when connected remotely through Tailscale Serve, but the CLI reproduction above is local against the localhost daemon, so the networking path does not appear to be involved.
I couldn't reproduce this on the current release, so there's no fix and the issue stays open.
What I ran locally, with Paseo 0.9.2 built from main and Codex CLI 0.155.1:
- Imported an existing Codex thread as a Paseo agent. Its rollout is 132 MiB and 13,384 records, with 117 turns and 19 compactions.
- Restarted the daemon so the agent had to load its history from Codex again, then ran
paseo logs <agent-id> --tail 10.
before restart: 0.8s
after restart: 1.9s, last 10 entries returned
Each reported symptom:
paseo logs <agent-id> --tail 10times out after 60 seconds: different, it returned in 1.9 seconds.- Desktop shows
Couldn't refresh agent history. Retrying...: unverified, I only ran the CLI.
My run differs from yours in two ways that could matter:
- Codex 0.155 stores this thread in its paginated history format, and a full history read returned 18 MB in 0.3 seconds. Your histories were read by Codex 0.147 and 0.153.
- Your largest history was 248 MiB with 174 MiB of compaction records. Mine is smaller on both counts.
@lstroud @johanhaleby, if you still have an affected agent: does paseo logs <agent-id> --tail 10 still time out on Paseo 0.9.2? If it does, please include the Codex CLI version (codex --version).
Thanks @johanhaleby, your report on 0.7.2 is counted on this issue.
It stays at p1 because an affected agent's history can't be read at all, and two people have hit it. The question in the comment above about whether it still happens on 0.9.2 is still open, and updates go on this issue.
Another report in #5951 by @keevaspeyer10x, on Paseo 0.10.2 (desktop-managed daemon, macOS) with a Codex agent that had run for about 2.5 days:
- After a full desktop and daemon restart, the app shows "couldn't refresh session history" for that agent, and fetching its activity times out even with small limits.
- Other agents on the same daemon load right away.
- The same agent also stays
runningand can't be stopped, archived, or deleted, which #5951 tracks.
That answers the question in the comment above about whether this still happens after 0.9.2. The report doesn't include the Codex CLI version. I've removed cannot-reproduce and needs-more-info so diagnosis takes another look. Priority stays p1.
I couldn't reproduce this on current main with Codex CLI 0.159.0, so there's no fix yet and the issue stays open. This is the second attempt that missed, so I've handed it to the maintainer.
What I ran locally:
- Imported a 180 MiB Codex history (28,046 records, 20 turns, 16 compactions) as a Paseo agent with
paseo agent import, restarted the daemon so the agent had to load cold, then ranpaseo logs <agent-id> --tail 10. - Ran the same Codex calls the daemon makes on a cold load directly against Codex, plus two variants: Codex killed in the middle of a turn, and a second Codex process still holding the thread.
paseo logs --tail 10 after restart: 3.0 s, last 10 entries returned
Codex resume + full history read: 2.1 s total
after Codex was killed mid-turn: 0.07 s
with another Codex process holding it: fails in 19 ms ("already has an active writer"), no hang
Each reported symptom:
paseo logs <agent-id> --tail 10times out after 60 seconds: different, 3.0 seconds.- Desktop shows
Couldn't refresh agent history: unverified, I only ran the CLI. - The agent from #5951 stays
runningand can't be stopped: unverified, none of my runs left an agent stuck.
The open difference is the Codex version. Yours were 0.147 and 0.153, and #5951 didn't include one.
@keevaspeyer10x, if that agent is still stuck: what does codex --version print on that machine?
New report from @iamdenny on #3905, on Paseo 0.10.3 with Codex CLI 0.160.1 (macOS):
- Opening a long-lived Codex agent leaves Desktop loading, and the daemon worker crashes with
RangeError: Invalid string length, then runs out of memory. Quitting and reopening Desktop reproduces it. - That thread's Codex history holds about 84,600 items and 557 MiB of serialized data, against the 180 MiB history in the last attempt here.
- Codex 0.160.1 is newer than the 0.159.0 used in that attempt.
- Archiving the agent let the app start again.
The failure is a crash rather than this issue's 60-second timeout, so the report stays on #3905 and the two issues are linked. I've removed cannot-reproduce so diagnosis takes another look. Updates go on this issue.
Paseo 0.11.4 / Codex 0.162.1에서 관측한 추가 자료
macOS 26.2, Apple silicon, RAM 24GiB에서 Desktop 0.11.4의 로컬 daemon을 사용하며 모바일은 relay로 연결합니다. 큰 Codex 대화를 다시 열거나 재접속하면 기록 조회가 수 분 밀리고 모바일에 호스트 재연결이 표시되는 현상을 관측했습니다.
측정 환경의 한계: 이 환경에는 별도의 로컬 런타임 훅(복원 동시성 제한, 읽음 처리 시 불필요한 복원 제거, 256MiB 이상 대화의 제한된 기록 조회)이 이미 있었습니다. 따라서 아래 시간은 수정하지 않은 공식 릴리스의 독립 재현 결과가 아닙니다. 특정 PR의 회귀나 정확한 단일 원인을 주장하지 않습니다.
로컬 훅에서 기존 전체 기록 경로를 유지하던 두 Codex 대화의 원본 크기는 216.5MiB, 238.1MiB였고, 복원 완료까지 각각 122,712ms, 115,862ms가 기록됐습니다. 별도로 요청 대기는 최대 270,779ms, 메시지 요청의 서버 처리 시간은 최대 324,551ms였습니다. 원본 크기를 daemon의 실제 메모리 적재량과 동일하게 해석하지는 않습니다.
같은 시간대 daemon 지표에서 이벤트 루프 지연 최대 15,493.8ms를 관측했습니다. relay는 38,328ms 동안 제어 신호를 받지 못해 30,000ms stale 기준으로 끊어졌습니다. 이후 로컬 자동 복구 장치가 daemon을 재시작했습니다. 해당 종료는 OOM으로 확인된 것이 아니라 외부 복구 장치의 재시작입니다. 재접속 직후 30초 지표에는 기록 조회 65건, 하위 에이전트 목록 조회 74건, 처리 중 요청 최대 134건이 있었습니다.
설치된 0.11.4 코드를 읽으면 UI는 이미 40개 단위 tail/before 페이지를 요청하지만, 일반적인 cold-load는 ensureAgentLoaded 및 제공자 기록 hydration을 마친 후에 페이지를 선택합니다. 작은 응답 limit이 앞단의 복원 비용까지 제한하지 않는 점이 이 이슈와 연결됩니다.
별도 프로세스의 읽기 전용 실험에서는 Codex의 이미 준비된 thread_history_1.sqlite 인덱스에서 필요한 항목만 읽었습니다. 약 2.28/1.78/1.43GiB 원본에 대해 최근 40개를 각각 436/13/10ms에 가져왔고 제공자 프로세스를 시작하지 않았습니다. 합성 기록 1,200개도 40개씩 앞쪽 페이지로 끝까지 중복·누락 없이 읽었습니다. 이는 로컬 실험 결과이며 공식 수정이나 배포 후 UI 검증은 아닙니다.
원하는 동작은 다음과 같습니다.
- 기록 열람은 provider 실행 복원과 분리하고, 준비된 저장 인덱스/캐시의 최근 페이지부터 응답합니다.
- 스크롤할 때 이전 구간을 추가 조회하며, 전체 기록을 일괄 절단하지 않습니다.
- 하위 에이전트 목록 조회는 메타데이터만 읽고, 본문은 실제로 열 때 조회합니다.
- 인덱스 준비나 하위 기록 탐색이 필요하면 daemon의 연결/heartbeat 처리를 막지 않도록 격리합니다.
- 실제 메시지 전송은 읽기 전용 조회 대기열 뒤에 장시간 갇히지 않게 합니다.
이름, 대화 내용, 호스트 주소, 로컬 경로 및 에이전트 식별자는 생략했습니다. 새 중복 이슈 대신 현재 이슈에 추가 자료로 남깁니다.
Thanks @sm1ee, your report on Desktop 0.11.4 with Codex 0.162.1 is counted on this issue, along with your note that local changes were installed when you measured.
Priority stays p1. Updates go on this issue.