Skip to content

[BUG] [v0.0.7] cortex sessions shows date without seconds (YYYY-MM-DD HH:MM) but cortex export picker shows date with seconds (YYYY-MM-DD HH:MM:SS) — inconsistent timestamp precision for the same session #48566

@vasylchow

Description

@vasylchow

Project

cortex

Description

cortex sessions truncates session timestamps to 16 bytes (timestamp[..16]), producing YYYY-MM-DD HH:MM (no seconds). cortex export (session picker) truncates to 19 bytes (timestamp[..19]), producing YYYY-MM-DD HH:MM:SS (with seconds). The same session viewed through these two commands displays different date precision, confusing users who try to cross-reference sessions between them.
In src/cortex-cli/src/cli/handlers.rs line 806-807:

let date = if session.timestamp.len() >= 16 {
  session.timestamp[..16].replace('T', " ")

In src/cortex-cli/src/export_cmd.rs line 268-269:

let date = if session.timestamp.len() >= 19 {
  session.timestamp[..19].replace('T', " ")

Both operate on the same SessionInfo objects returned by list_sessions(), so the source timestamp is identical. The only difference is the hard-coded slice length: 16 vs 19.

Error Message

Debug Logs

System Information

Ubuntu 24.04

Screenshots

Image Image

Steps to Reproduce

  1. Run a session so at least one session exists (e.g. cortex run "hello")
  2. Run cortex sessions and note the Date column for a session — it shows YYYY-MM-DD HH:MM (e.g. 2026-03-31 14:30)
  3. Run cortex export and note the date for the same session ID — it shows YYYY-MM-DD HH:MM:SS (e.g. 2026-03-31 14:30:45)
  4. Observe that the same session displays different timestamp precision in the two commands

Expected Behavior

Both cortex sessions and cortex export should use the same timestamp precision for session dates. Either both should show seconds ([..19]) or both should omit them ([..16]), so users can consistently identify sessions across commands.

Actual Behavior

cortex sessions shows 2026-03-31 14:30 (no seconds) while cortex export shows 2026-03-31 14:30:45 (with seconds) for the same session, making cross-referencing unnecessarily difficult.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingideIssues related to IDEvalidValid issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions