Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
182d153
pa-types/pa-cli/pa-tui: the daemon incident forensics — prime-agent i…
Sep 26, 2026
9de6103
fix(incident): the CI round-1 compile + fixture corrections
Sep 26, 2026
b3e2d73
fix(incident): the CI round-2 pa-tui compile errors
Sep 26, 2026
1239bc7
fix(incident): the CI round-3 test failures
Sep 26, 2026
6184b18
fix(incident): fmt the source-tests mtime pinning
Sep 26, 2026
84dd0a3
fix(incident): the CI round-4 clippy hits + the fraction-scaling test
Sep 26, 2026
a560608
fix(incident): the CI round-5 clippy hit
Sep 26, 2026
48748c8
fix(incident): the CI round-6 clippy hits in the e2e
Sep 26, 2026
a4639f9
Merge commit '60e2e198c52ee6537db2eeb72206218a0c5b464b' into lane/inc…
kevinjosethomas Sep 26, 2026
6783385
fix(incident): the leftover std env_lock beside the async one in the e2e
kevinjosethomas Sep 26, 2026
48f2a9f
fix(incident): the CI round-7 clippy hits in the pa-cli incident units
kevinjosethomas Sep 26, 2026
012e35f
fix(incident): the non-Unix log identity degrades to None instead of …
kevinjosethomas Sep 26, 2026
d455301
Merge commit '7064d039ac3437596f75b44423d76a8f4bf4856a' into lane/inc…
kevinjosethomas Sep 26, 2026
f6eea9a
fix(incident): the fold's new agents_view click e2e carries the incid…
kevinjosethomas Sep 26, 2026
32a2d1e
fix(incident): the CLI log scan decodes lossily instead of dropping a…
kevinjosethomas Sep 26, 2026
ffec4ca
fix(incident): the torn-tail fixture carries a 12-hex worker id
kevinjosethomas Sep 26, 2026
068259a
chore: retrigger the exact-head CI (the supervisor_e2e load flake)
kevinjosethomas Sep 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/pa-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The `prime-agent` binary.

## Scope
Argument parsing matching the TS CLI exactly, mode selection (interactive/headless/json/daemon subcommands), binary wiring of crates into processes, exit codes and user-facing errors. Client-side MCP auth flows (`mcp_login.rs`): the `/mcp login`/`/mcp logout` hook the TUI calls — the TS interactive client's placement — resolving a server (settings `mcpServers` + the builtin catalog), running the pa-core OAuth login on the suspended terminal, and persisting through the shared auth store. The same placement serves the TUI's client-command hooks: provider auth (`provider_login.rs` — the `/login`/`/logout` catalog, the API-key store, the MCP device flow, the Prime Inference terminal login (`prime_inference_login.rs` — the API-key flow: prime-cli credential reuse, the paste prompt with the whoami access check, the numbered team selector); the subscription OAuth and the Prime browser challenge stay unported and report it), trace-sharing state (`client_traces.rs` — the settings flag writes and the credential resolution `/traces` shows; the upload subsystem stays unported), and the update child runner + post-update relaunch (`client_update.rs` — the split-CLI child invocations and the exec of the updated launcher from the managed install root).
Argument parsing matching the TS CLI exactly, mode selection (interactive/headless/json/daemon subcommands), binary wiring of crates into processes, exit codes and user-facing errors. The daemon-forensics CLI (`incident.rs`, TS `src/cli/incident.ts`): the `prime-agent incident` timeline command — log-source discovery (agent.jsonl plus its `.old` rotation, falling back to the newest per-daemon log), `--since`/`--until` window and `--session` filter parsing, and the report rendering; the shared classifier lives in pa-types (`pa_types::incident`) and the agents-view notice in pa-tui. Client-side MCP auth flows (`mcp_login.rs`): the `/mcp login`/`/mcp logout` hook the TUI calls — the TS interactive client's placement — resolving a server (settings `mcpServers` + the builtin catalog), running the pa-core OAuth login on the suspended terminal, and persisting through the shared auth store. The same placement serves the TUI's client-command hooks: provider auth (`provider_login.rs` — the `/login`/`/logout` catalog, the API-key store, the MCP device flow, the Prime Inference terminal login (`prime_inference_login.rs` — the API-key flow: prime-cli credential reuse, the paste prompt with the whoami access check, the numbered team selector); the subscription OAuth and the Prime browser challenge stay unported and report it), trace-sharing state (`client_traces.rs` — the settings flag writes and the credential resolution `/traces` shows; the upload subsystem stays unported), and the update child runner + post-update relaunch (`client_update.rs` — the split-CLI child invocations and the exec of the updated launcher from the managed install root).

## Non-goals
No business logic; it composes pa-daemon, pa-core, pa-tui, pa-ai via their public APIs only.
Expand Down
17 changes: 17 additions & 0 deletions crates/pa-cli/src/command_registry.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Command specs and help formatting, ported from `cli/command-registry.ts`.

Check warning on line 1 in crates/pa-cli/src/command_registry.rs

View workflow job for this annotation

GitHub Actions / loc

File size guidance

568 -> 585 lines; consider splitting this module

use crate::config::APP_NAME;

Expand Down Expand Up @@ -125,6 +125,23 @@
"--fix Remove stale sockets and stop idle orphaned services",
"--json Print JSON",
]),
CommandSpec::new(
&["incident"],
"incident [--since <time>] [--until <time>] [--session <id>]",
"Reconstruct a daemon incident from its logs",
)
.description(
"Summarizes the daemon logs for a time window into an operator timeline: supervisor and worker events, session anomalies, and recovery actions. Times without a timezone are read as UTC, matching the log; the default window is the last 24 hours.",
)
.options(&[
"--since <time> Window start (ISO date/time, date, or HH:MM today; default: 24h ago)",
"--until <time> Window end (default: now)",
"--session <id> Only events naming this session id, worker id, or session name (prefix match)",
])
.examples(&[
"incident --since \"2026-09-16T20:02\" --until \"2026-09-16T20:21\"",
"incident --session 2339fb7da605",
]),
CommandSpec::new(
&["shutdown"],
"shutdown [--force] [--json]",
Expand Down
Loading
Loading