Skip to content

fix(cli): show UTC marker in sessions tail - #148022

Merged
obviyus merged 4 commits into
openclaw:mainfrom
TUARAN:fix/sessions-tail-utc-marker
Oct 7, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
TUARAN:fix/sessions-tail-utc-marker

Conversation

@TUARAN

@TUARAN TUARAN commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #146449

Summary

  • Label compact sessions tail timestamps as UTC with an explicit Z.
  • Keep the timestamp cell nine columns wide so invalid timestamps retain the visible --:--:-- fallback without shifting later columns.

What Problem This Solves

The formatter sliced HH:MM:SS from Date#toISOString() and discarded its UTC marker. On a non-UTC host, operators could mistake that value for local time. Appending Z preserves the existing time value and makes its meaning explicit. Stored events, session selection, and follow lifecycle are unchanged.

Evidence

Candidate: cfc6121d027b77c4e122dc5c1a3f6e1a4f70e3de, incorporating main 16e94f50ee95237a79368fd012c44cd135d8d8ab and preserving TUARAN's commits. No overlap with Pash/Sarah changes.

Built and exercised the shipped openclaw.mjs CLI in isolated Linux arm64 containers on Node 24.16.0 with TZ=America/Los_Angeles. A built candidate Gateway completed real openai/gpt-5-mini turns with low reasoning and a 4096-token output budget; the CLI read the resulting persisted trajectory events, not injected formatter fixtures.

For the same stored session.started event:

Event ISO: 2026-10-07T02:35:44.851Z
Local:     Tue Oct 06 2026 19:35:44 GMT-0700 (Pacific Daylight Time)
Base:      02:35:44  session.started
Candidate: 02:35:44Z session.started

The baseline build uses the current-main command owner with the candidate regression tests retained. The candidate Gateway generated the real session state read by both CLI builds.

  • Base regression run: 5 failed, 30 passed, including missing Z and column alignment failures.
  • Candidate regression run: 35 passed (node scripts/run-vitest.mjs src/commands/sessions-tail.test.ts; 49.55 seconds wrapper wall time, 47.38 seconds Vitest duration).
  • pnpm tsgo: passed the real core typecheck.
  • pnpm build: passed for candidate and baseline CLI builds.
  • Candidate sessions tail --follow --tail 0 streamed the second real turn: 02:35:54Z session.started through 02:35:57Z session.ended ... success. Its values match the stored ISO event times.
  • sessions tail has no JSON output mode: registration explicitly rejects inherited --json; its help exposes only human-readable tailing. The patch changes only human-readable rendering, not any JSON serializer.

Risk and limits

CLI-output-only: valid timestamps gain one character and later columns shift one position. Invalid timestamps retain the existing fallback with padding. No persistence, configuration, API, or provider behavior changes.

Not tested: packaged installation, Windows terminal rendering. Exact-head hosted CI and review are tracked in the PR checks rather than claiming an earlier head's status.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S labels Sep 14, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 10:43 PM ET / October 7, 2026, 02:43 UTC (Revision 7).

ClawSweeper review

What this changes

Adds an explicit UTC marker to session-tail timestamps and preserves column alignment for invalid timestamps.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main and the latest release still display unlabeled UTC timestamps. The focused patch has sufficient real CLI proof and no actionable correctness findings; no additional contributor action remains.

Priority: P3
Reviewed head: cfc6121d027b77c4e122dc5c1a3f6e1a4f70e3de

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct patch with convincing real CLI before/after evidence and meaningful existing-boundary regression coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Exact-head terminal evidence exercises the built sessions-tail command against events persisted by a real Gateway on a non-UTC Linux host, showing the corrected Z marker in initial output and follow mode. Regression results supplement that proof; the diff changes no stored-data contract.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Exact-head terminal evidence exercises the built sessions-tail command against events persisted by a real Gateway on a non-UTC Linux host, showing the corrected Z marker in initial output and follow mode. Regression results supplement that proof; the diff changes no stored-data contract.
Evidence reviewed 8 items Pinned introduced change: The pinned base-to-head diff adds Z to the existing ISO UTC time and pads the timestamp cell to nine characters. Test changes extend existing command-boundary assertions for valid timestamps, invalid timestamps, Unicode keys, and sanitized labels.
Current main still needs the fix: Current main still returns date.toISOString().slice(11, 19), discarding the zone marker. Both initial rendering and follow rendering reach the same progress-line formatter.
Latest release retains unlabeled UTC: The source retrieved for v2026.9.8 contains the same ISO-time slice without Z. The release therefore does not supersede this patch.
Findings None None.
Security None None.

How this fits together

The sessions-tail CLI reads stored session trajectory events and displays compact progress lines for operators. Existing events and events arriving in follow mode use the same timestamp renderer.

flowchart LR
  A[Stored session events] --> B[Session selection]
  C[CLI options] --> B
  B --> D[Initial read or follow]
  D --> E[UTC timestamp and aligned columns]
  E --> F[Terminal progress lines]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

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

View PR surface stats
Area Files Added Removed Net
Source 1 4 2 +2
Tests 1 37 27 +10
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 41 29 +12

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #146449
Summary: This PR is the explicit candidate fix for the canonical timestamp-label issue, which remains open pending merge.

Members:

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

Technical review

Best possible solution:

Keep the compact UTC time format with an explicit Z and a consistently padded timestamp column.

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

Yes. Current-main source deterministically drops the UTC marker, and the supplied real CLI comparison demonstrates the ambiguity on a non-UTC host; this reviewer did not execute target code.

Is this the best way to solve the issue?

Yes. Labeling the existing UTC value resolves the reported ambiguity without changing time-zone policy, persistence, or session selection.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 27ba9720f2c5.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a low-risk CLI clarity fix for operators correlating timestamps outside UTC.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Exact-head terminal evidence exercises the built sessions-tail command against events persisted by a real Gateway on a non-UTC Linux host, showing the corrected Z marker in initial output and follow mode. Regression results supplement that proof; the diff changes no stored-data contract.
  • proof: sufficient: Contributor real behavior proof is sufficient. Exact-head terminal evidence exercises the built sessions-tail command against events persisted by a real Gateway on a non-UTC Linux host, showing the corrected Z marker in initial output and follow mode. Regression results supplement that proof; the diff changes no stored-data contract.

Evidence

What I checked:

  • Pinned introduced change: The pinned base-to-head diff adds Z to the existing ISO UTC time and pads the timestamp cell to nine characters. Test changes extend existing command-boundary assertions for valid timestamps, invalid timestamps, Unicode keys, and sanitized labels. (src/commands/sessions-tail.ts:59, cfc6121d027b)
  • Current main still needs the fix: Current main still returns date.toISOString().slice(11, 19), discarding the zone marker. Both initial rendering and follow rendering reach the same progress-line formatter. (src/commands/sessions-tail.ts:59, 27ba9720f2c5)
  • Latest release retains unlabeled UTC: The source retrieved for v2026.9.8 contains the same ISO-time slice without Z. The release therefore does not supersede this patch. (src/commands/sessions-tail.ts, fc23bc864e45)
  • Human-readable output contract: CLI registration describes human-readable trajectory progress and explicitly rejects inherited --json. Documentation defines compact progress lines with fixed-width columns; this patch changes presentation without changing stored events or a machine-readable serializer. (src/cli/program/register.status-health-sessions.ts:357, cfc6121d027b)
  • Exact-head real behavior evidence: The captured PR body identifies candidate cfc6121 and reports built openclaw.mjs execution in isolated Linux arm64 containers with Node 24.16.0 and TZ=America/Los_Angeles. Both builds read the same persisted event from a real Gateway turn: base displayed 02:35:44, candidate displayed 02:35:44Z, matching 2026-10-07T02:35:44.851Z. Follow mode also displayed Z-marked events from a second real turn. Supplemental baseline regressions failed five cases; the candidate passed all 35. Captured source revision: 6791e322d616d3865985d14ffcc1423010ec6421b80bc4947222ee795a98b11d. (cfc6121d027b)
  • Canonical issue and discussion: [Bug]: sessions tail renders UTC without label while logs use local+offset #146449 remains open and explicitly accepts labeling UTC as a solution. This PR names that issue as its closing target. The contributor requested review, and the later discussion requested re-review; neither introduces a conflicting requirement.

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Zee Zheng: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (6 earlier review cycles)
  • reviewed 2026-09-14T06:59:48.114Z sha 9eca10b :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T01:33:06.909Z sha 922a928 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T02:17:41.781Z sha 922a928 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-24T05:52:45.939Z sha 922a928 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-01T15:04:58.404Z sha 922a928 :: needs changes before merge. :: none
  • reviewed 2026-10-02T03:47:34.888Z sha b197888 :: needs maintainer review before merge. :: none

@TUARAN

TUARAN commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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 Oct 1, 2026
@TUARAN

TUARAN commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Hi maintainers — when you have a chance, could you please review this PR? CI and ClawSweeper are green, and there’s no action pending from me. Thank you!

@obviyus

obviyus commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. and removed triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Oct 7, 2026
@obviyus
obviyus merged commit c486079 into openclaw:main Oct 7, 2026
126 of 128 checks passed
@obviyus

obviyus commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Landed in c486079. Thanks @TUARAN! Verified with the built CLI under TZ=America/Los_Angeles against real Gateway events: main showed bare 02:35:44 for a UTC event, this shows 02:35:44Z, and all 16 timestamps matched the stored ISO values, including in --follow mode.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
Mark openclaw sessions tail timestamps as UTC so they are not mistaken for local time on hosts with a non-UTC timezone.

Fixes openclaw#146449.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

[Bug]: sessions tail renders UTC without label while logs use local+offset

2 participants