Skip to content

[bug]: Craft cumulative growth can fall back to stale createdAt #166

Description

@pitimon

Conditional bug

Craft sessions use cumulative header totals. Timestamp selection is lastMessageAt -> lastUsedAt -> createdAt -> file mtime.

When both activity timestamps are absent or stale but createdAt exists, later cumulative growth remains in the original creation bucket even though the session file was rewritten later.

Expected policy

  • First observation: activity timestamp, then createdAt, then file mtime.
  • Later growth: changed trustworthy activity timestamp; otherwise current file mtime/observation time.
  • Preserve per-session conversation counting, cache-token columns, eviction state, and token conservation.
  • Add deterministic cross-midnight coverage for missing/stale activity timestamps.

Confirmed by provider-wide audit after Hermes #154 and Goose #158. Conditionally affected through v0.39.47.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions