← Back to Pull requests

feat(agentctl): improve session inspection and JSON output #234

Closed
unknown closed this pull request without merging on Nov 13, 2026 23:29 UTC
View on GitHub
unknown unknown commented on Oct 29, 2026 18:40 UTC
Author

Summary

Closes #227.

  • Make get readable and list headed/aligned, with consistent human-readable execution, compute, and deletion states.

  • Add protobuf JSON for unary session commands and JSON Lines for replay. Share snake_case protobuf JSON rendering with approval and harness commands; leave exec streaming unchanged.

  • Support AGENTSESSIONS_SERVER with explicit flag precedence, an environment-target notice on stderr, and rejection of explicit --journal with a remote target. Explicit --server= selects embedded mode.

  • Keep deletion-pending warnings on stderr, suppress embedded server INFO logs, and preserve explicit diagnostics for already-committed mutations when subsequent output fails.

  • Walk every list page while preserving the command tracing context. Update documentation, changelog fragments, and behavioral tests.
  • Compatibility and scope

    Approval JSON field names change from camelCase to snake_case. Human get and list formats change; create retains its bare UID output by default. JSON field names, enum values, and protobuf types are documented contracts, not serialized byte ordering. No journal or wire-format changes.

    Aligned with the feedback in https://github.com/agent-primitives/sessions/issues/227#issuecomment-6460924265. Color is deliberately deferred; this change adds no libraries or dependency-manifest changes.

    Validation

    After rebasing onto the latest tracing changes:

  • go test -race -shuffle=on ./cmd/agentctl ./cmd/agentsessionsd

  • go build ./...

  • go vet ./cmd/agentctl ./cmd/agentsessionsd

  • golangci-lint for both command packages: 0 issues

  • changelog fragment validation and git diff --check

  • Regression coverage for command-context propagation across list pages
  • Before that final rebase, the complete root race suite, separate Substrate module race suite, root vet/lint, govulncheck, protobuf lint/generation, API-reference generation, chain verification, documentation checks, and module-tidiness checks passed.

    Diff: 250 lines (+187 / -63) across 3 files Reviewer: aramase Review duration: 21889m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 250 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.331
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #234"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.0% (MEDIUM) · Higher = larger blast radius
    39.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.4% · Safe to merge
    15.4%