Skip to content

fix: label hook diagnostics by agent - #616

Merged
Octane0411 merged 1 commit into
Octane0411:mainfrom
1AdityaX:pr/hook-diagnostics-agent-label
Sep 2, 2026
Merged

fix: label hook diagnostics by agent#616
Octane0411 merged 1 commit into
Octane0411:mainfrom
1AdityaX:pr/hook-diagnostics-agent-label

Conversation

@1AdityaX

@1AdityaX 1AdityaX commented Jul 24, 2026

Copy link
Copy Markdown

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.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.

Summary by CodeRabbit

  • New Features

    • Expanded hook health diagnostics to support Claude, Codex, and OpenCode in a unified view.
    • Displayed health issues grouped by agent with clear, user-friendly agent names.
    • Added consistent statuses for diagnostics, including not run, all healthy, and repairable issues.
  • Bug Fixes

    • Improved health status aggregation so errors and repairable issues are accurately reflected across all supported agents.
    • Ensured agent identities and display names remain consistent throughout diagnostics.

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.
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Hook 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.

Changes

Hook Health Reporting

Layer / File(s) Summary
Typed health report identities
Sources/OpenIslandCore/HookHealthCheck.swift
HookHealthReport now uses a typed Agent, exposes display names, conforms to Identifiable, and constructs Claude, Codex, and OpenCode reports with enum cases.
Consolidated report flow
Sources/OpenIslandApp/HookInstallationCoordinator.swift, Sources/OpenIslandApp/AppModel.swift
The coordinator and AppModel expose available hook reports through a single ordered healthReports array.
Aggregated diagnostics rendering
Sources/OpenIslandApp/Views/SettingsView.swift, Tests/OpenIslandAppTests/AgentSessionPresentationTests.swift
Settings aggregates issues across reports and renders agent display names; tests validate agent mappings, identifiers, and unique display names.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: octane0411

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: labeling hook diagnostics by agent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6e5e7a6 and b51f81a.

📒 Files selected for processing (5)
  • Sources/OpenIslandApp/AppModel.swift
  • Sources/OpenIslandApp/HookInstallationCoordinator.swift
  • Sources/OpenIslandApp/Views/SettingsView.swift
  • Sources/OpenIslandCore/HookHealthCheck.swift
  • Tests/OpenIslandAppTests/AgentSessionPresentationTests.swift

Comment on lines +3 to +4
/// Structured diagnostic result for a single hook integration.
public struct HookHealthReport: Equatable, Sendable, Identifiable {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 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

@Octane0411
Octane0411 merged commit 2fa9749 into Octane0411:main Sep 2, 2026
1 check passed
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