Skip to content

feat(cli,memory): type agents fleet --status flag and add tracing span#4365

Merged
bug-ops merged 3 commits into
mainfrom
fleet-cli-tracing
May 18, 2026
Merged

feat(cli,memory): type agents fleet --status flag and add tracing span#4365
bug-ops merged 3 commits into
mainfrom
fleet-cli-tracing

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 18, 2026

Summary

  • Add FleetStatus wrapper enum with #[derive(clap::ValueEnum)] in src/cli.rs; keeps clap out of zeph-memory (library crate)
  • Replace Option<String> with Option<FleetStatus> in AgentsCommand::Fleet; remove manual .parse::<SessionStatus>() from handle_fleet
  • Add #[tracing::instrument(name = "memory.fleet.update_status", skip_all, level = "debug", err)] to SqliteStore::update_agent_session_status, matching sibling methods

Closes #4357, #4358

Test plan

  • cargo nextest run --workspace --lib --bins — 9871 passed
  • cargo clippy --workspace -- -D warnings — clean
  • cargo +nightly fmt --check — clean
  • zeph agents fleet --status active — clap validates at parse time, shows variants in --help
  • zeph agents fleet --status invalid — clap-level error with suggestions (no runtime panic)

@github-actions github-actions Bot added memory zeph-memory crate (SQLite) rust Rust code changes enhancement New feature or request size/S Small PR (11-50 lines) labels May 18, 2026
@bug-ops bug-ops linked an issue May 18, 2026 that may be closed by this pull request
@bug-ops bug-ops enabled auto-merge (squash) May 18, 2026 12:52
Closes #4357, #4358

- Add FleetStatus wrapper enum with clap::ValueEnum in src/cli.rs to
  keep clap out of zeph-memory; convert to SessionStatus via From impl
- Replace Option<String> with Option<FleetStatus> in AgentsCommand::Fleet;
  remove manual .parse::<SessionStatus>() from handle_fleet
- Add #[tracing::instrument(name = "memory.fleet.update_status", ...)]
  to SqliteStore::update_agent_session_status, matching sibling methods
@bug-ops bug-ops force-pushed the fleet-cli-tracing branch from 7e2ce23 to b002a10 Compare May 18, 2026 12:52
… tracing spans (#4364)

Extract format_tokens(n: u64) -> String into zeph-common/src/text.rs,
replacing three identical local implementations in fleet.rs, status.rs,
and agents.rs. Closes #4359.

Add #[tracing::instrument] to reconcile_stale_sessions and
update_agent_session_status in agent_sessions.rs, matching the
convention established by upsert_agent_session. Closes #4348.
@github-actions github-actions Bot added size/M Medium PR (51-200 lines) and removed size/S Small PR (11-50 lines) labels May 18, 2026
@github-actions github-actions Bot added size/S Small PR (11-50 lines) and removed memory zeph-memory crate (SQLite) rust Rust code changes size/M Medium PR (51-200 lines) labels May 18, 2026
@bug-ops bug-ops merged commit c92702d into main May 18, 2026
32 checks passed
@bug-ops bug-ops deleted the fleet-cli-tracing branch May 18, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/S Small PR (11-50 lines)

Projects

None yet

1 participant