fix(skill-nudge): log swallowed errors in debug mode - #317
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe skill-nudge pre-action now receives the global ChangesSkill-nudge diagnostics
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: 🟡 Moderate · up to The PR adds debug-only diagnostics without changing normal command behavior, but a duplicate declaration in the test file would prevent the test suite from loading. Merge should wait until that test syntax issue is corrected or explicitly accepted. Sequence Diagram(s)sequenceDiagram
participant PreActionHook
participant maybeEmitSkillNudge
participant isVerifySkillInstalled
participant stderr
PreActionHook->>maybeEmitSkillNudge: pass debug flag
maybeEmitSkillNudge->>isVerifySkillInstalled: check skill presence
isVerifySkillInstalled-->>maybeEmitSkillNudge: return presence or report read error
maybeEmitSkillNudge->>stderr: write debug diagnostic when enabled
maybeEmitSkillNudge-->>PreActionHook: preserve non-throwing result
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
What does this PR do?
Threads the existing global
--debugflag into the skill-nudge pre-action context so the two remaining swallowed error paths insrc/lib/skill-nudge.tsare diagnosable when debug output is requested.Specifically:
AGENTS.md) emit a debug-only stderr diagnostic while continuing to treat that target as absent.This follows the debug-emission pattern established in #223.
Related issue
Closes #285
Type of change
Checklist
mainbranch.(
feat(...),fix(...),docs(...), …).npm run lintandnpm run format:checkpass.npm run typecheckpasses.npm testpasses and coverage stays at or above the 80% gate.credentials required).
README.md/DOCUMENTATION.mdwhererelevant.
Notes for reviewers
The implementation is intentionally narrow and follows #223's existing pattern:
capture the swallowed error, honor the existing
--debugflag, emit to stderr,and preserve normal output and exit behavior.
The managed-target read failure occurs inside
isVerifySkillInstalled(), so thisPR adds an optional best-effort diagnostic callback rather than changing the
function's return behavior. The callback is isolated with its own error guard so
diagnostic failures cannot affect command execution.
The branch changes only:
src/index.tssrc/lib/skill-nudge.tssrc/lib/skill-nudge.test.tsFull lint, format, typecheck, unit-test, and coverage verification is left to the
repository CI on this PR.
Summary by CodeRabbit
New Features
Bug Fixes