Skip to content

Explain Kiro CLI requirement when no fetch strategy is available - #2465

Open
hxy91819 wants to merge 1 commit into
steipete:mainfrom
hxy91819:fix/kiro-cli-fetch-error
Open

Explain Kiro CLI requirement when no fetch strategy is available#2465
hxy91819 wants to merge 1 commit into
steipete:mainfrom
hxy91819:fix/kiro-cli-fetch-error

Conversation

@hxy91819

Copy link
Copy Markdown
Contributor

Problem

When Kiro is enabled but kiro-cli is not installed or is not discoverable, CodexBar only reports:

No available fetch strategy for kiro.

This is not actionable for users. Kiro usage is currently collected exclusively through the local Kiro CLI, which also requires the user to complete kiro-cli login (including enterprise/IAM login flows).

Cause

The Kiro fetch strategy advertises itself as available only when kiro-cli can be resolved. If it is unavailable, the generic ProviderFetchError.noAvailableStrategy message is surfaced without provider-specific guidance.

Solution

Add a Kiro-specific error message that explains the CLI requirement, links to the Kiro CLI documentation, and tells the user to run kiro-cli login.

Other providers retain the existing generic error message.

Validation

  • swift test --filter KiroStatusProbeTests (56 tests passed)
  • make check (passed; SwiftFormat and SwiftLint reported no violations)

@hxy91819
hxy91819 force-pushed the fix/kiro-cli-fetch-error branch from 7cbdd58 to a96e849 Compare July 27, 2026 01:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cbdd58b06

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

try await fetcher.fetchResolvedCookie(logger: logger)
},
clearCached: { cached in
_ = CookieHeaderCache.clearIfCurrent(provider: .ollama, expected: cached)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor failed conditional clears before storing fallback cookies

When the cached Ollama cookie expires while another refresh or login has already replaced the cache, clearIfCurrent returns false, but this path discards that result and fetchAutomatic continues to import and store a browser cookie unconditionally. In that race the older in-flight refresh can overwrite the newer cache entry, switching the app back to a stale or different browser session; treat a failed conditional clear as a retry/abort before allowing storeResolved to run.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 26, 2026, 9:48 PM ET / July 27, 2026, 01:48 UTC.

ClawSweeper review

What this changes

The PR gives Kiro a provider-specific unavailable-strategy message that tells users to install and log in to the Kiro CLI, and adds a focused regression test.

Merge readiness

Blocked until real behavior proof from a real setup is added - 3 items remain

Keep this PR open. Current main still emits the generic unavailable-strategy diagnostic, while the project’s Kiro documentation confirms the local CLI is the supported collection path; the patch is focused and appears correct, but it needs redacted after-fix behavior proof from a real Kiro setup before merge.

Priority: P3
Reviewed head: a96e849784fcb3371ae61f6acf474126f8eb6657

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is a clean, narrow diagnostic fix with focused coverage, but tests and static checks alone do not satisfy the real-behavior proof gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR reports focused tests and make check, but it has no after-fix capture from a real Kiro missing-CLI or login setup; add redacted terminal or app output, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports focused tests and make check, but it has no after-fix capture from a real Kiro missing-CLI or login setup; add redacted terminal or app output, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed 4 items Current main behavior: Current main’s unavailable-strategy error is generic for every provider, so it does not explain Kiro’s CLI dependency; the proposed branch narrows the wording change to Kiro.
Supported Kiro collection path: The Kiro provider documentation describes the local Kiro CLI as the supported usage-data source, supporting a diagnostic that directs users toward that prerequisite.
Focused branch coverage: The branch adds a Swift Testing case asserting that the Kiro unavailable-strategy diagnostic names both the Kiro CLI and the login command.
Findings None None.
Security None None.

How this fits together

CodexBar gathers usage through provider-specific fetch strategies and turns probe failures into diagnostics shown by the menu-bar app. Kiro’s usage provider relies on the locally installed Kiro CLI, so an unavailable strategy currently stops the usage probe before it can return account data.

flowchart LR
  A[Enabled Kiro provider] --> B[Provider fetch plan]
  B --> C{Kiro CLI resolved?}
  C -->|Yes| D[Run Kiro usage probe]
  C -->|No| E[Unavailable strategy error]
  E --> F[Menu bar diagnostic]
  D --> G[Usage status]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports focused tests and make check, but it has no after-fix capture from a real Kiro missing-CLI or login setup; add redacted terminal or app output, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review.
  • Resolve merge risk (P1) - No redacted live output, terminal capture, or app diagnostic currently demonstrates that an unavailable Kiro CLI reaches this exact user-visible message rather than another Kiro probe failure.
  • Complete next step (P2) - The patch has no concrete code defect for an automated repair lane; a contributor must supply real after-fix behavior evidence before merge.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch scope 2 files; 16 additions, 1 deletion The implementation is narrowly scoped to one provider diagnostic and one regression test.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Preserve the generic message for other providers, land the Kiro-specific prerequisite guidance after a redacted real missing-CLI or logged-out-path capture confirms the exact diagnostic, and retain the focused regression test.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Preserve the generic message for other providers, land the Kiro-specific prerequisite guidance after a redacted real missing-CLI or logged-out-path capture confirms the exact diagnostic, and retain the focused regression test.

Do we have a high-confidence way to reproduce the issue?

Yes, from source. Configure Kiro and make kiro-cli unavailable on PATH; Kiro has no alternate documented collection strategy, so the unavailable-strategy branch is the relevant current-main path, although this read-only review did not execute it against a live account.

Is this the best way to solve the issue?

Yes, conditionally. A Kiro-only message preserves the generic contract for other providers and aligns with the documented CLI requirement; the remaining need is real behavior proof that this is the message shown for the intended failure path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against cc8da27cec92.

Labels

Label justifications:

  • P3: This is a limited-blast-radius usability improvement to an optional provider diagnostic.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports focused tests and make check, but it has no after-fix capture from a real Kiro missing-CLI or login setup; add redacted terminal or app output, then update the PR body for re-review or ask a maintainer to comment @clawsweeper re-review.

Evidence

What I checked:

  • Current main behavior: Current main’s unavailable-strategy error is generic for every provider, so it does not explain Kiro’s CLI dependency; the proposed branch narrows the wording change to Kiro. (Sources/CodexBarCore/Providers/ProviderFetchPlan.swift:175, cc8da27cec92)
  • Supported Kiro collection path: The Kiro provider documentation describes the local Kiro CLI as the supported usage-data source, supporting a diagnostic that directs users toward that prerequisite. (docs/kiro.md:248, cc8da27cec92)
  • Focused branch coverage: The branch adds a Swift Testing case asserting that the Kiro unavailable-strategy diagnostic names both the Kiro CLI and the login command. (Tests/CodexBarTests/ProviderFetchErrorTests.swift:6, a96e849784fc)
  • Patch scope: The submitted change touches two files with 16 additions and 1 deletion, limited to the provider error text and its regression coverage. (a96e849784fc)

Likely related people:

  • neror: Current release documentation credits this contributor for the Kiro provider, making them the strongest historical routing candidate for Kiro-specific probe behavior. (role: feature introducer; confidence: medium; files: docs/kiro.md, Sources/CodexBarCore/Providers/ProviderFetchPlan.swift)
  • steipete: The repository owner is the best available fallback for a cross-provider diagnostic in CodexBarCore when the local history trail cannot be fully inspected in this read-only sandbox. (role: adjacent core owner; confidence: low; files: Sources/CodexBarCore/Providers/ProviderFetchPlan.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted terminal or app capture showing the new message after the Kiro strategy is unavailable.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant