Skip to content

fix(skills): make skippedReason switch exhaustive - #9594

Merged
AmethystLiang merged 1 commit into
stablyai:mainfrom
Zuz666:fix/skills-skipped-reason-exhaustive
Jul 23, 2026
Merged

AmethystLiang merged 1 commit into
stablyai:mainfrom
Zuz666:fix/skills-skipped-reason-exhaustive

Conversation

@Zuz666

@Zuz666 Zuz666 commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #9589.

Adds explicit 'current', 'duplicate', and undefined cases to the skippedReason switch in skill-freshness-group.tsx. The type-aware switch-exhaustiveness lint rule (pnpm run lint:switch-exhaustiveness) requires them; all three fall through to the existing generic skipped message, so behavior is unchanged.

No visual change.

Screenshots

No visual change.

Testing

  • pnpm lint — passes for the changed file; the repo-wide type-aware run now reports only the pre-existing daemon-server.ts:652 violation that also exists on main (untouched here). CI's lint step (non-type-aware oxlint) is green.
  • pnpm typecheck
  • pnpm test — not run in full; change is a no-op branch through the same default path, covered by existing lint/typecheck
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed — not needed: behavior is unchanged; the compiler/lint now verifies exhaustiveness of this switch

AI Review Report

Reviewed the change with the coding agent for cross-platform compatibility (macOS/Linux/Windows — pure TS switch, no platform surface), SSH/remote/local compatibility (renderer-only), agent/integration compatibility (none), performance (none — same code path, explicit cases fall through identically), UI quality (no visual change), and basic security (no input handling changes). No flags; nothing to change as a result.

Security Audit

No input handling, command execution, path handling, auth, secrets, dependency, or IPC surface touched. No follow-up.

Notes

  • main currently has one more pre-existing violation of the same rule in src/main/daemon/daemon-server.ts:652 (closeStartupQueryAuthority). Left alone deliberately — unrelated to this fix and the rule is not CI-enforced.
  • X: @zuz666

@Zuz666
Zuz666 marked this pull request as ready for review July 20, 2026 20:07
@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 302c9f5c-81e2-4897-b504-0be0d8af0ea2

📥 Commits

Reviewing files that changed from the base of the PR and between 9db7bcd3da405c66843dcfeefc1b9dc93a87f0cb and b2a230c.

📒 Files selected for processing (1)
  • src/renderer/src/components/skills/skill-freshness-group.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/skills/skill-freshness-group.tsx

📝 Walkthrough

Walkthrough

Updated skippedReason to explicitly route current, duplicate, and undefined states to the generic “can’t update” translation message instead of relying on a default switch branch.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the switch exhaustiveness fix.
Description check ✅ Passed The description follows the required template and includes all required sections with concrete details.
Linked Issues check ✅ Passed The change adds the missing current, duplicate, and undefined cases and preserves the existing message, matching #9589.
Out of Scope Changes check ✅ Passed No unrelated code changes are evident; the PR stays focused on the reported switch exhaustiveness issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The type-aware switch-exhaustiveness lint rule requires explicit cases
for 'current', 'duplicate', and undefined; they fall through to the
existing generic skipped message, so behavior is unchanged.
@Zuz666
Zuz666 force-pushed the fix/skills-skipped-reason-exhaustive branch from 9db7bcd to b2a230c Compare July 20, 2026 22:50
@AmethystLiang
AmethystLiang requested review from AmethystLiang and brennanb2025 and removed request for brennanb2025 July 22, 2026 17:04
@AmethystLiang
AmethystLiang merged commit ffe54a5 into stablyai:main Jul 23, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
The type-aware switch-exhaustiveness lint rule requires explicit cases
for 'current', 'duplicate', and undefined; they fall through to the
existing generic skipped message, so behavior is unchanged.

Co-authored-by: Yuris Auzins <[email protected]>
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.

[Bug]: switch-exhaustiveness lint fails on skill-freshness-group.tsx

3 participants