Skip to content

feat: add CLI commands for inspecting and replaying session logs#260

Merged
l50 merged 3 commits into
mainfrom
feat/telemetry-session-logs-cli
May 8, 2026
Merged

feat: add CLI commands for inspecting and replaying session logs#260
l50 merged 3 commits into
mainfrom
feat/telemetry-session-logs-cli

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented May 7, 2026

Key Changes:

  • Introduced ares ops sessions CLI commands for listing, showing, and replaying session logs
  • Added SessionsCommands enum and integrated it with the CLI and ops command dispatch
  • Implemented session log directory detection and defaulting logic for consistent CLI/file access
  • Updated dependencies and tests to support new session log features

Added:

  • SessionsCommands enum to the CLI, enabling subcommands for listing operation/task IDs, showing session logs, and replaying conversations from logs
  • sessions.rs module in ares-cli/src/ops implementing the logic for the new CLI commands, including pretty-printing and JSON output
  • Integration of the new ops sessions subcommand into the main ops command handler
  • Test coverage for the new session log CLI features, including environment isolation and replay behavior
  • tempfile as a dev-dependency for test isolation and temporary directory management

Changed:

  • Updated session log directory resolution in ares-llm to provide a default_root() helper for external consumers (such as CLI commands), ensuring consistent directory lookup
  • Improved environment variable handling for session log enablement in SessionLogConfig, making logging enabled by default unless explicitly disabled
  • Refactored and consolidated session log environment variable tests for thread safety and correctness
  • Updated action versions in GitHub workflow files for actions/upload-artifact and actions/setup-go to new commit SHAs
  • Bumped the Semgrep analysis container image to a newer version in CI workflow

- Flip ARES_SESSION_LOG_ENABLED default to true so JSONL session logs
  land at ~/.ares/sessions out of the box; explicit opt-out remains via
  ARES_SESSION_LOG_ENABLED=0.
- Add SessionLogConfig::default_root() so external callers can resolve
  the same path the agent loop writes to without re-implementing env
  parsing.
- Add `ares ops sessions {list,show,replay}` so operators can inspect
  per-task session logs and reconstruct conversations through
  replay_messages without poking around the filesystem.
- Serialize the env-mutating SessionLogConfig tests with a Mutex; the
  new default-on path created a cross-test race when cargo's parallel
  scheduler observed partial mutations.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 75.73222% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.12%. Comparing base (dc6ac63) to head (bc7ef41).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
ares-cli/src/ops/sessions.rs 73.55% 55 Missing ⚠️
ares-llm/src/agent_loop/config.rs 93.33% 2 Missing ⚠️
ares-cli/src/ops/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #260      +/-   ##
==========================================
+ Coverage   75.10%   75.12%   +0.01%     
==========================================
  Files         383      384       +1     
  Lines       81465    81725     +260     
==========================================
+ Hits        61188    61394     +206     
- Misses      20277    20331      +54     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

l50 added 2 commits May 7, 2026 18:59
**Changed:**

- Reformatted long function calls and argument lists to use multiple lines for better readability in `ares-cli/src/ops/sessions.rs`
- Added a blank comment line for visual separation in doc comment block in `ares-llm/src/agent_loop/config.rs`
@l50 l50 merged commit ee4b684 into main May 8, 2026
11 checks passed
@l50 l50 deleted the feat/telemetry-session-logs-cli branch May 8, 2026 03:27
l50 added a commit that referenced this pull request May 9, 2026
**Key Changes:**

- Introduced `ares ops sessions` CLI commands for listing, showing, and
replaying session logs
- Added `SessionsCommands` enum and integrated it with the CLI and ops
command dispatch
- Implemented session log directory detection and defaulting logic for
consistent CLI/file access
- Updated dependencies and tests to support new session log features

**Added:**

- `SessionsCommands` enum to the CLI, enabling subcommands for listing
operation/task IDs, showing session logs, and replaying conversations
from logs
- `sessions.rs` module in `ares-cli/src/ops` implementing the logic for
the new CLI commands, including pretty-printing and JSON output
- Integration of the new `ops sessions` subcommand into the main ops
command handler
- Test coverage for the new session log CLI features, including
environment isolation and replay behavior
- `tempfile` as a dev-dependency for test isolation and temporary
directory management

**Changed:**

- Updated session log directory resolution in `ares-llm` to provide a
`default_root()` helper for external consumers (such as CLI commands),
ensuring consistent directory lookup
- Improved environment variable handling for session log enablement in
`SessionLogConfig`, making logging enabled by default unless explicitly
disabled
- Refactored and consolidated session log environment variable tests for
thread safety and correctness
- Updated action versions in GitHub workflow files for
`actions/upload-artifact` and `actions/setup-go` to new commit SHAs
- Bumped the Semgrep analysis container image to a newer version in CI
workflow

---------
l50 added a commit that referenced this pull request May 9, 2026
**Key Changes:**

- Introduced `ares ops sessions` CLI commands for listing, showing, and
replaying session logs
- Added `SessionsCommands` enum and integrated it with the CLI and ops
command dispatch
- Implemented session log directory detection and defaulting logic for
consistent CLI/file access
- Updated dependencies and tests to support new session log features

**Added:**

- `SessionsCommands` enum to the CLI, enabling subcommands for listing
operation/task IDs, showing session logs, and replaying conversations
from logs
- `sessions.rs` module in `ares-cli/src/ops` implementing the logic for
the new CLI commands, including pretty-printing and JSON output
- Integration of the new `ops sessions` subcommand into the main ops
command handler
- Test coverage for the new session log CLI features, including
environment isolation and replay behavior
- `tempfile` as a dev-dependency for test isolation and temporary
directory management

**Changed:**

- Updated session log directory resolution in `ares-llm` to provide a
`default_root()` helper for external consumers (such as CLI commands),
ensuring consistent directory lookup
- Improved environment variable handling for session log enablement in
`SessionLogConfig`, making logging enabled by default unless explicitly
disabled
- Refactored and consolidated session log environment variable tests for
thread safety and correctness
- Updated action versions in GitHub workflow files for
`actions/upload-artifact` and `actions/setup-go` to new commit SHAs
- Bumped the Semgrep analysis container image to a newer version in CI
workflow

---------
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.

1 participant