Skip to content

feat(cli): show per-attempt retry detail in checks get [AI-340]#1345

Open
miliberlin wants to merge 9 commits into
mainfrom
michelle/ai-340-cli-show-per-attempt-retry-detail
Open

feat(cli): show per-attempt retry detail in checks get [AI-340]#1345
miliberlin wants to merge 9 commits into
mainfrom
michelle/ai-340-cli-show-per-attempt-retry-detail

Conversation

@miliberlin

@miliberlin miliberlin commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds checkly checks get <check-id> --result <result-id> --include-attempts, which renders the full retry sequence for a result instead of just the final outcome.

A single check run produces one FINAL result plus one ATTEMPT result for each earlier failed try, all sharing a sequenceId. By default only the FINAL result is shown; this flag surfaces the attempts.

$ checkly checks get a1b2c3d4-0000-4000-8000-000000000001 \
    --result 7f3e9a10-1111-4000-8000-0000000000f0 --include-attempts

Login flow · failing · eu-west-1 · 4.2s
...
ATTEMPTS
  #          Status    Location    Duration  Error                      Result ID
  1          failing   eu-west-1   3.9s      Timeout 30000ms exceeded   7f3e9a10-1111-4000-8000-0000000000a1
  2          failing   eu-west-1   4.0s      Timeout 30000ms exceeded   7f3e9a10-1111-4000-8000-0000000000b2
  3 (final)  passing   eu-west-1   4.2s      —                          7f3e9a10-1111-4000-8000-0000000000f0

  View attempt: checkly checks get a1b2c3d4-0000-4000-8000-000000000001 --result 7f3e9a10-1111-4000-8000-0000000000a1

How

  • The list endpoint has no server-side sequenceId filter, so attempts are fetched via resultType=ALL in a bounded time window anchored at the result and grouped client-side by sequenceId (ordered oldest-first, so index = run number).
  • The extra call is skipped entirely when the result has no retries (attempts === 0).
  • Renders attempt number, status, location, duration, and a best-effort short error summary, with the FINAL row marked (final). Works in detail, md, and json (json emits { result, attempts }).

Backend dependencies (both merged)

  • AI-223 — resultType=ALL now returns the full FINAL+ATTEMPT sequence (was returning empty).
  • AI-219 — test-session result detail endpoint (related milestone work).

Changes

  • rest/check-results.tsresultType accepts ALL; documented from/to as UNIX seconds; added errorGroupIds.
  • formatters/check-result-detail.tsgroupAttemptsBySequence, extractResultErrorSummary, formatAttemptsSection; optional extraSections on formatResultDetailWithNavigation.
  • commands/checks/get.ts--include-attempts flag (dependsOn: result), windowed fetch + grouping, per-attempt nav hints.
  • ai-context/references/investigate-checks.md — documents the flag.

Testing

  • New unit tests (grouping, error extraction, terminal+md section, empty cases); full result-detail spec passing.
  • Verified locally against real check results with ./bin/run checks get <id> --result <rid> --include-attempts.
  • tsc --noEmit and eslint clean.

🤖 Generated with Claude Code

miliberlin and others added 8 commits June 10, 2026 10:22
…hanges

Apply Michelle's latest local edits to the AI-340 branch:
- packages/cli/src/commands/checks/get.ts
- packages/cli/src/formatters/check-result-detail.ts
- packages/cli/src/formatters/__tests__/check-result-detail.spec.ts
- packages/cli/src/commands/__tests__/checks-get-attempts.spec.ts (new)
- packages/cli/src/commands/__tests__/checks-get-flags.spec.ts (new)

Committed by Angie on behalf of Michelle (AI-340).
@thebiglabasky thebiglabasky requested a review from sorccu June 11, 2026 14:27
Comment thread packages/cli/src/formatters/check-result-detail.ts
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.

2 participants