Skip to content

Add messageId display and ANSI reset for log lines#16

Merged
shellicar merged 1 commit intomainfrom
feature/message-id-display
Feb 18, 2026
Merged

Add messageId display and ANSI reset for log lines#16
shellicar merged 1 commit intomainfrom
feature/message-id-display

Conversation

@shellicar
Copy link
Copy Markdown
Owner

Summary

  • Display assistant messageId (UUID) with context % on each assistant message for self-service /compact-at recovery
  • Show last messageId on session resume via UsageTracker.lastAssistant
  • Add ANSI reset (\x1b[0m) at the start of logLine() to prevent colour bleed from truncated tool output

Closes #13
Closes #14

@shellicar shellicar enabled auto-merge (squash) February 18, 2026 14:56
@shellicar shellicar self-assigned this Feb 18, 2026
Copy link
Copy Markdown
Collaborator

@bananabot9000 bananabot9000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three features, all quality-of-life improvements:

1. messageId display on assistant messages — The main feature. Printing messageId: <uuid> (X.X%) before each assistant message gives you the exact UUID you need for /compact-at without having to dig through audit files. The dim styling (\x1b[2m...\x1b[0m) keeps it unobtrusive — it's metadata, not content. Smart to append the context % here too, so you can watch it climbing in real time and know when to compact before you hit the wall.

2. lastAssistant on session resumeUsageTracker.lastAssistant loads the most recent assistant UUID from the audit file tail on startup. This means when you resume a session, you immediately see last messageId: <uuid> — so if you just restarted and need to compact, you have the UUID without sending a query first.

One detail I want to call out: in loadContextFromAudit, the UUID is captured with !this._lastAssistantUuid guard, meaning it takes the first match while scanning in reverse — i.e., the most recent assistant message. That's correct. And during live streaming, onMessage updates it unconditionally (this._lastAssistantUuid = msg.uuid) so it always reflects the latest. Clean.

3. ANSI reset in logLine\x1b[0m at the start of every logLine() call. Simple defensive fix — if tool output has truncated ANSI sequences (e.g., tsc with red background that gets cut off mid-escape), the stale colour bleeds into subsequent lines. Resetting at the start of each log line guarantees a clean slate. Minimal cost, prevents confusing visual artifacts.

No issues. Ship it 🍌

@shellicar shellicar merged commit 669b16a into main Feb 18, 2026
2 checks passed
@shellicar shellicar deleted the feature/message-id-display branch February 18, 2026 15:00
@shellicar shellicar added this to the 1.0.0 milestone Feb 20, 2026
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.

Add ANSI reset to log lines to prevent colour bleed Print messageId (UUID) for assistant messages

2 participants