Skip to content

[Bug] Completed turn duration grows after the app is quit and reopened #260

Closed

Description

@ladydd

Affected area

Session / workspace / local sync

Installation method

Built from source

Lody version or commit

0.76.0 (1cc6553)

Operating system

Linux 6.8.0-138-generic x64

Agent or runtime

Codex 0.148.0 (the managed runtime Lody downloaded), model 5.6-Sol

What happened?

A finished short reply showed Worked for 8s. I fully quit the Lody desktop app, opened the same session again, and that same reply now showed Worked for 1m 02s. The number got larger and did not go back.

Leaving the session open and idle did not change it. It only jumped after the process exited and the session was loaded again.

I saw the same rewrite on three finished turns. The extra time is about as long as the wall clock from "the reply was already on screen" to "I killed the process" — not the time the model spent generating.

Turn Prompt (verbatim) On screen when it finished After quit + reopen
ping3 Reply with exactly the single word ping3. 8s 1m 02s
pong Reply with exactly the single word pong and nothing else. 6s 1m 04s
pong2 Reply with exactly the single word pong2 and nothing else. 8s 4m 22s

ping3 is the cleanest row: I sent it at 14:21:07, the answer was on screen at 14:21:17 (~10s wall clock, label 8s), waited ~40s idle (still 8s), then quit. After reopen it was 1m 02s. pong2 sat in a running app for several more minutes before quit, and grew the most.

What did you expect?

A turn that already displayed 8s should still display 8s after the app is quit and the same session is opened again.

How can we reproduce it?

  1. Build and run the OSS desktop from 1cc6553 (pnpm start:local). Use a Codex session on a model that will answer quickly.

  2. Send exactly:

    Reply with exactly the single word ping3.

  3. Wait until the assistant message is on screen. Read Worked for … under that reply (I got 8s).

  4. Do not send anything else. Leave the session open about 40 seconds. Confirm the label is still 8s.

  5. Fully quit the Lody desktop process (not only switching chats or hiding the window).

  6. Start Lody again, open the same session, do not send a new message.

  7. The same ping3 reply now shows a larger Worked for (I got 1m 02s). Opening it a third time keeps the larger number.

How often does it happen?

Every time

Relevant log output

No crash or error log. The duration label on the finished turn is the symptom.

Additional context

What I saw in the UI is only the label change above, including that idle does not grow the number.

The next paragraph is from reading the tree at 1cc6553, not from extra UI steps.

The desktop formats endedAt - timestamp via resolveSessionHistoryDurationMs (packages/components/src/lib/session-history-duration.ts). While the turn is finishing, that difference is the 8s I saw. On session exit / terminated, apps/cli/src/lib/message-handler.ts calls finalizeACPState(sessionId) with no turnId (:3722 and :3742). That function always does const endedAt = Date.now() (:5729) and writes it onto the last assistant entry (:5750–5752) even when that entry already has endedAt. Reloading the session then shows shutdown time minus start time.

A teardown path that does not overwrite endedAt on a turn that already completed would match what the UI showed before quit. You will know better which write should be skipped.

Screenshots of ping3 at 8s (right after the reply, and again after idle) and at 1m 02s after reopen are attached.

ping3 刚答完:Worked for 8s

同一条再闲置约 40s:仍是 8s

整进程退出再打开同一会话:ping3 变成 Worked for 1m 02s

Before submitting

  • I searched the existing issues and did not find a duplicate.
  • This report concerns an open-source component in this repository, not a hosted service, Web or mobile app, account, or billing issue.
  • This is not a security vulnerability; security reports follow the repository's security policy.
  • I removed credentials, private source, conversations, prompts, personal data, and other sensitive information.
  • If I plan to submit a pull request, I will wait for a Lody maintainer to explicitly agree on the scope and approach before implementation.

Activity

  1. changed the title [-]Completed turn duration grows after the app is quit and reopened[/-] [+][Bug] Completed turn duration grows after the app is quit and reopened[/+] on Sep 1, 2026
  2. added a commit that references this issue on Sep 5, 2026
    fe26b55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions