Skip to content

fix(cli): display raw log lines without transformation#145

Merged
8nevil8 merged 1 commit intomainfrom
fix/codemie-log-raw-display
Feb 13, 2026
Merged

fix(cli): display raw log lines without transformation#145
8nevil8 merged 1 commit intomainfrom
fix/codemie-log-raw-display

Conversation

@8nevil8
Copy link
Collaborator

@8nevil8 8nevil8 commented Feb 12, 2026

Summary

Fixes the codemie log command to display log entries exactly as written to the file, preserving all metadata.

Problem:

  • Log command was parsing and reconstructing entries, causing:
    • Loss of context tags like [hook], [hook:normalize], etc.
    • Incorrect agent names (showing "unknown" instead of actual agent)
    • Truncated session IDs
    • Missing profile names

Solution:

  • Modified LogFormatter.formatLogEntry() to return entry.rawLine directly
  • Removed transformation logic that was reconstructing log entries from parsed fields
  • All metadata now preserved: timestamp, level, agent, session ID, profile, context tags

Before:

2026-02-12T18:40:49.175Z DEBUG [unknown] .....

After:

[2026-02-12T19:09:15.884Z] [INFO] [claude] [0ed6f983-f15e-430c-95da-cb0d49734e5e] [codemie-sso] [hook:normalize] No mapping defined for agent claude, using event name as-is

Test Plan

  • Build successful (TypeScript compilation)
  • Linting passed (0 warnings)
  • Manual testing: codemie log --lines 10 shows raw entries with all metadata
  • Filters tested: --grep, --agent, --level, --last all work correctly
  • Verbose mode tested: -v flag works as expected
  • All metadata preserved: timestamp, level, agent, session ID, profile, context tags

Log command was parsing and reconstructing log entries,
causing loss of context tags, incorrect agent names,
and truncated session IDs.

Changed formatter to display entries exactly as written,
preserving all metadata including timestamp, level,
agent, session ID, profile, and context information.

Generated with AI

Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
@8nevil8 8nevil8 merged commit d3ac6c2 into main Feb 13, 2026
5 checks passed
@8nevil8 8nevil8 deleted the fix/codemie-log-raw-display branch February 13, 2026 09:37
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