Skip to content

fix(hub): refresh session activity on completed turns#524

Merged
tiann merged 1 commit intotiann:mainfrom
Liu-KM:codex/fix-session-updated-at
Apr 25, 2026
Merged

fix(hub): refresh session activity on completed turns#524
tiann merged 1 commit intotiann:mainfrom
Liu-KM:codex/fix-session-updated-at

Conversation

@Liu-KM
Copy link
Copy Markdown
Contributor

@Liu-KM Liu-KM commented Apr 25, 2026

Summary

Fix stale session ordering in the sidebar by refreshing sessions.updated_at when a conversation has real user-visible activity.

Root Cause

Session summaries are sorted from sessions.updated_at, but message writes did not update that field. A session could receive new messages while its sidebar timestamp stayed at the original session metadata update time.

Fix

  • Add a store/cache path for touching session activity and publishing session-updated.
  • Refresh activity when the web app sends a user message.
  • Refresh activity from the CLI socket only for real user text input and the ready event that marks a completed turn.
  • Do not refresh activity for intermediate agent/tool messages such as tool calls, tool results, reasoning, or terminal output.

Validation

  • bun test hub/src/sync/sessionModel.test.ts
  • bun run typecheck from hub
  • bun run test from hub

No dependency or lockfile changes.

@Liu-KM Liu-KM marked this pull request as ready for review April 25, 2026 08:55
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings
None.

Summary
Review mode: initial
No issues found in the latest diff. Residual risk: static review only; tests were not run in this automation pass.

Testing
Not run (automation)

HAPI Bot

@tiann tiann merged commit 7f82df8 into tiann:main Apr 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants