fix: label hook diagnostics by agent - #616
Conversation
Settings rendered every health report as either "Claude Code" or "Codex" by string-matching report.agent, so OpenCode issues showed up labelled "Codex", and the diagnostics summary only aggregated the Claude and Codex reports even though OpenCode's was already being computed. Type HookHealthReport.agent as an enum that owns its own display name, aggregate the reports through one list, and drop the cursorHealthReport and geminiHealthReport properties that were never assigned, the unused agent parameter on findThirdPartyHookNames, and the unused hasNotices helper.
📝 WalkthroughWalkthroughHook health reporting now uses a typed agent enum and a consolidated report collection. Hook checks produce typed reports, coordinators forward available reports, and Settings diagnostics aggregate and display issues across Claude, Codex, and OpenCode. ChangesHook Health Reporting
Estimated code review effort: 3 (Moderate) | ~20 minutes 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Sources/OpenIslandCore/HookHealthCheck.swift`:
- Around line 3-4: Update HookHealthReport to conform to Codable alongside its
existing conformances, and make its stored Issue type Codable as well so
compiler-synthesized Codable support succeeds. Preserve the current Sendable,
Equatable, and Identifiable behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: df852a92-1342-4fe8-8670-6b0de96e4262
📒 Files selected for processing (5)
Sources/OpenIslandApp/AppModel.swiftSources/OpenIslandApp/HookInstallationCoordinator.swiftSources/OpenIslandApp/Views/SettingsView.swiftSources/OpenIslandCore/HookHealthCheck.swiftTests/OpenIslandAppTests/AgentSessionPresentationTests.swift
| /// Structured diagnostic result for a single hook integration. | ||
| public struct HookHealthReport: Equatable, Sendable, Identifiable { |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Make HookHealthReport Codable.
HookHealthReport is a model but lacks Codable; its stored [Issue] also requires Issue to conform before synthesis succeeds.
Proposed fix
-public struct HookHealthReport: Equatable, Sendable, Identifiable {
- public enum Severity: Equatable, Sendable {
+public struct HookHealthReport: Codable, Equatable, Sendable, Identifiable {
+ public enum Severity: Codable, Equatable, Sendable {
...
}
- public enum Issue: Equatable, Sendable, CustomStringConvertible {
+ public enum Issue: Codable, Equatable, Sendable, CustomStringConvertible {
...
}As per coding guidelines, “All models must be Sendable and Codable.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Sources/OpenIslandCore/HookHealthCheck.swift` around lines 3 - 4, Update
HookHealthReport to conform to Codable alongside its existing conformances, and
make its stored Issue type Codable as well so compiler-synthesized Codable
support succeeds. Preserve the current Sendable, Equatable, and Identifiable
behavior.
Source: Coding guidelines
Fixes Settings labelling every non-Claude hook health report as "Codex". References #501 tangentially — primarily a diagnostics-panel bug, not the usage-display bug that issue tracks.
Settings rendered every health report as either "Claude Code" or "Codex" by string-matching
report.agent, so OpenCode issues showed up labelled "Codex", and the diagnostics summary only aggregated the Claude and Codex reports even though OpenCode's was already being computed.Type
HookHealthReport.agentas an enum that owns its own display name, aggregate the reports through one list, and drop thecursorHealthReportandgeminiHealthReportproperties that were never assigned, the unusedagentparameter onfindThirdPartyHookNames, and the unusedhasNoticeshelper.Summary by CodeRabbit
New Features
Bug Fixes