Skip to content

Conversation

@CSRessel
Copy link
Collaborator

No description provided.

claude and others added 7 commits December 25, 2025 05:42
Plan covers:
- Session discovery module to find transcript files
- Exposing session_id from AcpBackend to TUI
- Integrating token usage into /status command
- Edge case handling for missing/malformed transcripts
Add session_discovery module that locates transcript files based on
agent type and session ID. Supports Claude, Codex, and Gemini agents
with different directory layouts:

- Claude: ~/.claude/projects/<PROJECT_PATH>/<SESSIONID>.jsonl
- Codex: ~/.codex/sessions/<YEAR>/<MM>/<DD>/rollout-*-<GUID>.jsonl
- Gemini: ~/.gemini/tmp/<HASHED>/chats/session-*-<ID>.json

Includes comprehensive tests using TDD approach.
Store the AgentKind from agent config and expose via agent_kind()
method. This enables downstream code to determine which agent type
(Claude, Codex, Gemini) is running for session transcript discovery.
- Add TokenUsageCell to render token usage report in session header
- Add AcpSessionInfo struct and GetSessionInfo command to AcpAgentHandle
- Integrate session discovery and transcript parsing into /status
- Add From<registry::AgentKind> impl for session_parser::AgentKind

When /status is invoked, the TUI now asynchronously:
1. Gets session info (agent kind, session ID) from ACP handle
2. Discovers the transcript path using session_discovery module
3. Parses token usage from the transcript
4. Displays input/output/total tokens with context window usage
- Replace path.is_dir() with entry.file_type().await to avoid blocking
  the async runtime in find_file_with_suffix
- Remove @current-session markers from session discovery tests
- Apply cargo fmt and clippy fixes
- Add test_status_displays_token_usage_from_session_transcript E2E test
- Verifies /status displays token usage from Claude session transcript
- Uses session-claude.jsonl fixture placed in expected Claude directory structure
- Test waits for async transcript discovery and parsing to complete
- Validates Token Usage header and token count labels appear in output

This test documents the session transcript discovery feature implemented
in this branch (session ID discovery + transcript path resolution + parsing).
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.

3 participants