After refreshing the page, conversations that have already completed deep thinking show a duration of 0, whereas time is recorded correctly during the conversation. #21766

Closed
opened 2026-02-21 20:14:13 -05:00 by yindo · 1 comment
Owner

Originally created by @swingAnt on GitHub (Jan 19, 2026).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

Version1.11.4

Cloud or Self Hosted

Cloud

Steps to reproduce

Image

Image
刷新后

Image

✔️ Expected Behavior

预期能够展示之前调用的思考时间,显示貌似是前端写的计时器,刷新之后没有调用记录显示

Image

Actual Behavior

No response

Originally created by @swingAnt on GitHub (Jan 19, 2026). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version Version1.11.4 ### Cloud or Self Hosted Cloud ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/63b41f2a-9336-401f-8375-6ca660b11fcc) ![Image](https://github.com/user-attachments/assets/1bc905c7-cd72-4438-9ee3-2aed40b7a5cd) 刷新后 ![Image](https://github.com/user-attachments/assets/e1db964a-5059-4efd-a618-79d98621ef1c) ### ✔️ Expected Behavior 预期能够展示之前调用的思考时间,显示貌似是前端写的计时器,刷新之后没有调用记录显示 <img width="1396" height="712" alt="Image" src="https://github.com/user-attachments/assets/70aab71d-e8d4-461f-a37d-76878ee8213a" /> ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 20:14:13 -05:00
yindo closed this issue 2026-02-21 20:14:13 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 19, 2026):

This happens because the timer for "thinking time" is managed entirely in the frontend using React hooks and in-memory state, which is lost when you refresh the page. There is currently no mechanism in the codebase to persist or recalculate the timer duration after a refresh—neither localStorage nor Redux-persist is used for this state, and the backend API does not provide an explicit duration field, only timestamps like created_at and updated_at for messages and conversations. As a result, after a refresh, the timer resets to 0 and does not show previous durations, even though it works correctly during the conversation itself. Fixing this would require either persisting the timer state on the frontend or having the backend provide the necessary duration data so the UI can reconstruct and display it after a refresh.
Reference: frontend timer logic | Reference: backend API fields

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 19, 2026): <!-- Answer --> This happens because the timer for "thinking time" is managed entirely in the frontend using React hooks and in-memory state, which is lost when you refresh the page. There is currently no mechanism in the codebase to persist or recalculate the timer duration after a refresh—neither localStorage nor Redux-persist is used for this state, and the backend API does not provide an explicit duration field, only timestamps like created_at and updated_at for messages and conversations. As a result, after a refresh, the timer resets to 0 and does not show previous durations, even though it works correctly during the conversation itself. Fixing this would require either persisting the timer state on the frontend or having the backend provide the necessary duration data so the UI can reconstruct and display it after a refresh. [Reference: frontend timer logic](https://github.com/langgenius/dify/pull/30442) | [Reference: backend API fields](https://github.com/langgenius/dify/blob/62ac02a5680af5276bf65cc5a7f64fa172994990/api/controllers/console/app/conversation.py#L230-L603) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/3ec6cdb0-c935-4cd5-9c28-e06d8f3fa8e2?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/3ec6cdb0-c935-4cd5-9c28-e06d8f3fa8e2?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/3ec6cdb0-c935-4cd5-9c28-e06d8f3fa8e2?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/3ec6cdb0-c935-4cd5-9c28-e06d8f3fa8e2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/3ec6cdb0-c935-4cd5-9c28-e06d8f3fa8e2?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/3ec6cdb0-c935-4cd5-9c28-e06d8f3fa8e2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/3ec6cdb0-c935-4cd5-9c28-e06d8f3fa8e2?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20happens%20because%20the%20timer%20for%20%22thinking%20time%22%20is%20managed%20entirely%20in%20the%20frontend%20using%20React%20hooks%20and%20in-memory%20state%2C%20which%20is%20lost%20when%20you%20refresh%20the%20page.%20There%20is%20currently%20no%20mechanism%20in%20the%20codebase%20to%20persist%20or%20recalculate%20the%20timer%20duration%20after%20a%20refresh%E2%80%94neither%20localStorage%20nor%20Redux-persist%20is%20used%20for%20this%20state%2C%20and%20the%20backend%20API%20does%20not%20provide%20an%20explicit%20duration%20field%2C%20only%20timestamps%20like%20created_at%20and%20updated_at%20for%20messages%20and%20conversations.%20As%20a%20result%2C%20after%20a%20refresh%2C%20the%20timer%20resets%20to%200%20and%20does%20not%20show%20previous%20durations%2C%20even%20though%20it%20works%20correctly%20during%20the%20conversation%20itself.%20Fixing%20this%20would%20require%20either%20persisting%20the%20timer%20state%20on%20the%20frontend%20or%20having%20the%20backend%20provide%20the%20necessary%20duration%20data%20so%20the%20UI%20can%20reconstruct%20and%20display%20it%20after%20a%20refresh.%20%20%0A%5BReference%3A%20frontend%20timer%20logic%5D%28https%3A//github.com/langgenius/dify/pull/30442%29%20%7C%20%5BReference%3A%20backend%20API%20fields%5D%28https%3A//github.com/langgenius/dify/blob/62ac02a5680af5276bf65cc5a7f64fa172994990/api/controllers/console/app/conversation.py%23L230-L603%29)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/31239)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21766