Skip to content

feat(status): show session duration in footer#88988

Merged
steipete merged 2 commits into
openclaw:mainfrom
Alix-007:issue-68226-status-duration
Jun 19, 2026
Merged

feat(status): show session duration in footer#88988
steipete merged 2 commits into
openclaw:mainfrom
Alix-007:issue-68226-status-duration

Conversation

@Alix-007

@Alix-007 Alix-007 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #68226.

Summary

  • adds a session duration segment to the shared status footer when sessionStartedAt is available
  • uses the existing session lifecycle timestamp resolver so stored session metadata and transcript header fallback stay centralized
  • renders multi-unit durations with spaces, matching the requested duration 2h 14m footer format

Verification

  • node scripts/run-vitest.mjs src/auto-reply/status.test.ts
  • pnpm exec oxfmt --check --threads=1 src/status/status-message.ts src/auto-reply/status.test.ts
  • pnpm exec oxlint src/status/status-message.ts src/auto-reply/status.test.ts
  • git diff --check

Real behavior proof

  • Behavior addressed: the shared status footer showed the session key and update age but omitted the current session lifetime even when sessionStartedAt was available.
  • Real environment tested: Local OpenClaw checkout on Linux, PR head 26ad2cdd2dcd2638b72126712924f6afcd46f37b.
  • Exact steps or command run after this patch: node --import tsx/esm --input-type=module script importing the production buildStatusMessage, building a status message with sessionStartedAt 2h 14m before now, and printing the rendered session footer line.
  • Evidence after fix:
🧵 Session: agent:main:main • duration 2h 14m • updated 4h ago
  • Observed result after fix: The runtime status renderer emits a session footer with the session id, readable multi-unit duration, and update age in the same footer line.
  • What was not tested: A deployed channel /status command was not sent; this proof exercises the shared production renderer used by that command path.

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 1, 2026
@clawsweeper

clawsweeper Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 19, 2026, 6:51 AM ET / 10:51 UTC.

Summary
The PR adds a duration <elapsed> segment to the shared status footer by resolving sessionStartedAt and updates the shared status formatter test for the new footer text.

PR surface: Source +12, Tests +2. Total +14 across 2 files.

Reproducibility: not applicable. this is a feature PR rather than a reproducible bug. Source and release checks show current main and v2026.6.8 omit the requested duration/start segment, while the PR proof exercises the shared production renderer after the change.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #68226
Summary: This PR is the candidate implementation for the directly matching session-duration footer request; the older Feishu timing report partially overlaps but was split into narrower status and response-duration work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] The linked request later accepted an absolute started timestamp as an alternative, so maintainers should be comfortable with elapsed-duration wording before landing.
  • [P1] Several exact-head CI and CodeQL checks were still queued when inspected; that is a normal merge gate rather than a patch defect.

Maintainer options:

  1. Decide the mitigation before merge
    Land the shared renderer change if maintainers accept elapsed-duration wording; otherwise adjust the same renderer to the chosen started timestamp format before merge.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair lane is needed; the remaining action is maintainer acceptance of the elapsed-duration footer format and normal exact-head merge readiness.

Security
Cleared: The diff only changes status text rendering and a focused formatter test; it does not touch dependencies, workflows, secrets, permissions, persistence schemas, or code execution surfaces.

Review details

Best possible solution:

Land the shared renderer change if maintainers accept elapsed-duration wording; otherwise adjust the same renderer to the chosen started timestamp format before merge.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a feature PR rather than a reproducible bug. Source and release checks show current main and v2026.6.8 omit the requested duration/start segment, while the PR proof exercises the shared production renderer after the change.

Is this the best way to solve the issue?

Yes, if maintainers accept elapsed duration as the product format. The PR changes the shared status renderer used by chat /status and session_status, reusing the existing lifecycle timestamp resolver and duration formatter instead of adding a channel-specific path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 92d1f04de340.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Sufficient live-output proof: the PR body shows the production buildStatusMessage renderer emitting the new duration footer line, and the rebased head has maintainer-posted build/check/status-suite verification.

Label justifications:

  • P2: This is a normal user-facing status footer improvement with narrow shared renderer and test scope.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Sufficient live-output proof: the PR body shows the production buildStatusMessage renderer emitting the new duration footer line, and the rebased head has maintainer-posted build/check/status-suite verification.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient live-output proof: the PR body shows the production buildStatusMessage renderer emitting the new duration footer line, and the rebased head has maintainer-posted build/check/status-suite verification.
Evidence reviewed

PR surface:

Source +12, Tests +2. Total +14 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 13 1 +12
Tests 1 4 2 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 17 3 +14

What I checked:

  • Current main omits duration: Current main builds the session footer from the session key plus updated/no-activity text only; it does not read sessionStartedAt or render a duration segment. (src/status/status-message.ts:900, 92d1f04de340)
  • PR implementation uses the shared renderer: The PR head resolves sessionStartedAt, formats now - sessionStartedAt with spaced compact duration output, and inserts duration ... before the existing update age. (src/status/status-message.ts:902, 9a3a503279e3)
  • PR test covers requested footer shape: The PR head seeds sessionStartedAt and asserts both duration 2h 14m and updated 4h ago in the existing buildStatusMessage formatter test. (src/auto-reply/status.test.ts:112, 9a3a503279e3)
  • Shared /status path reaches the changed renderer: buildStatusText passes sessionEntry, sessionKey, agentId, and sessionStorePath into buildStatusMessage, so the change is not channel-specific. (src/status/status-text.ts:612, 92d1f04de340)
  • session_status also reaches the shared renderer: The built-in session_status tool resolves the target session and calls buildStatusText, so the same shared status output is affected. (src/agents/tools/session-status-tool.ts:882, 92d1f04de340)
  • Timestamp source already exists: resolveSessionLifecycleTimestamps prefers stored entry.sessionStartedAt and falls back to the transcript session header, matching the PR's chosen source of truth. (src/config/sessions/lifecycle.ts:120, 92d1f04de340)

Likely related people:

  • vincentkoc: Local blame and GitHub path history show recent status renderer/status-text work on the central shared status files. (role: recent area contributor; confidence: high; commits: 7b74d7332f70, a18cbcb7c690, 5b460c4669d4; files: src/status/status-message.ts, src/status/status-text.ts)
  • hxy91819: Recent merged status changes and tests touched the same formatter surface around context-window and pinned-model behavior. (role: recent status renderer contributor; confidence: medium; commits: f046d7aa23df, 4029fbd2b238, 3ce3ed668d92; files: src/status/status-message.ts, src/auto-reply/status.test.ts)
  • jalehman: Recent merged work added plugin-health and transcript-reader seams in the shared status-message/status-text path. (role: recent adjacent contributor; confidence: medium; commits: 10a4c7c10b6a, 8ded75628437; files: src/status/status-message.ts, src/status/status-text.ts)
  • ferminquant: Recent session lifecycle work owns the timestamp resolver that the PR reuses for sessionStartedAt. (role: session lifecycle contributor; confidence: medium; commits: 57bed6ae0c4b, 0c9ac48d2cc7; files: src/config/sessions/lifecycle.ts)
  • steipete: History shows adjacent work on bounded lifecycle timestamps and duration formatter coverage, both relevant to the timestamp source and display helper. (role: adjacent lifecycle and formatter contributor; confidence: medium; commits: 59f96078b29b, fa059472252c, c9c8125941b4; files: src/config/sessions/lifecycle.ts, src/infra/format-time/format-duration.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 1, 2026
@Alix-007 Alix-007 force-pushed the issue-68226-status-duration branch from 26ad2cd to cd60846 Compare June 3, 2026 17:34
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 3, 2026
@Alix-007 Alix-007 force-pushed the issue-68226-status-duration branch from cd60846 to 26ad2cd Compare June 3, 2026 17:44
@Alix-007

Alix-007 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Reverted the branch to its prior reviewed head (no content change) — please @clawsweeper re-review. The brief force-push was an accidental rebase; the diff is identical to what you previously rated platinum / ready for maintainer look.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 3, 2026
@Alix-007 Alix-007 force-pushed the issue-68226-status-duration branch from 26ad2cd to 6d54ea1 Compare June 4, 2026 07:24
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@Alix-007 Alix-007 force-pushed the issue-68226-status-duration branch from 6d54ea1 to 26ad2cd Compare June 4, 2026 07:33
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 4, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@Alix-007 Alix-007 force-pushed the issue-68226-status-duration branch from d4e33c4 to b796274 Compare June 15, 2026 09:15
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 15, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 15, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 16, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 16, 2026
@Alix-007

Copy link
Copy Markdown
Contributor Author

@vincentkoc surfacing this small one in case you're sweeping the Control-UI area — it adds the session duration to the footer (diamond, proof: sufficient, CI green, mergeable clean, no author action pending). It's behind main by a bit since it's been ready a while; happy to rebase onto a fresh base on request. Thanks!

@steipete steipete self-assigned this Jun 19, 2026
@steipete steipete force-pushed the issue-68226-status-duration branch from 3a35e9f to 9a3a503 Compare June 19, 2026 10:46
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 19, 2026
@steipete

Copy link
Copy Markdown
Contributor

Land-ready verification:

  • Rebased onto origin/main at 3091c13713f.
  • pnpm build: passed (Node 24.16.0).
  • pnpm check: passed.
  • node scripts/run-vitest.mjs src/auto-reply/status.test.ts src/status/status-message.test.ts: 86 tests passed.
  • Fresh Codex autoreview: clean; no accepted/actionable findings.

Known gap: broad local pnpm test was not used as a gate because the latest-main macOS run hit unchanged NFS/permission fixture failures under src/state/; the touched status suites pass. Thanks @Alix-007.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 19, 2026
@steipete steipete merged commit 4da36da into openclaw:main Jun 19, 2026
40 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 20, 2026
Show elapsed session duration in the status footer using the canonical session lifecycle timestamps and compact formatter.

Fixes openclaw#68226.

Co-authored-by: Alix-007 <li.long15@xydigit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add session duration (elapsed time) to status footer

2 participants