Previously, CLI backend responses wrote hardcoded zeros for token usage
in session transcripts (input: 0, output: 0, totalTokens: 0). This caused
the UI to show incorrect token counts and status to fall back to stale
accumulated values.
Changes:
- Add usage parameter to appendMessageToTranscript and related functions
in session-utils.fs.ts to accept NormalizedUsage from CLI backends
- Pass result.meta.agentMeta?.usage when persisting assistant messages
in agent-runner-execution.ts
- Create CliSessionManager class with SDK-aligned API for future use:
static factories (open/create), accessor methods, write locking
- Add comprehensive tests for both session-utils.fs usage parameter
and the new CliSessionManager class (17 + 2 new tests)
Transcript entries now include actual input/output/cache token counts
from CLI backends like claude-cli and opus.
Read the final user/assistant message from session transcripts and display
it in the picker alongside the session update time. Allows quick previews
of what's in each session without opening it.
Enable meaningful session titles via priority-based derivation:
1. displayName (user-set)
2. subject (group name)
3. First user message (truncated to 60 chars)
4. sessionId prefix + date fallback
Opt-in via includeDerivedTitles param to avoid perf impact on
regular listing. Reads only first 10 lines of transcript files.
Closes#1161