Skip to content

Fix claude settings hooks + refactor agents-setup#439

Merged
Kitenite merged 1 commit intomainfrom
mute-flea-20420f
Dec 20, 2025
Merged

Fix claude settings hooks + refactor agents-setup#439
Kitenite merged 1 commit intomainfrom
mute-flea-20420f

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Dec 20, 2025

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • Refactor
    • Reorganized internal agent setup module structure for improved maintainability and modularity. No changes to functionality or user experience.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The PR refactors agent setup from a monolithic module into a modular structure, decomposing the previously consolidated agent-setup.ts into six specialized modules: path constants, shell wrapper generation, agent wrapper creation, notification script generation, binary utilities, and a central orchestrator—maintaining the same public API surface.

Changes

Cohort / File(s) Summary
Module removal and core refactoring
apps/desktop/src/main/lib/agent-setup.ts
Deleted monolithic agent-setup module containing all agent wrapper, notification, and shell initialization logic. Functionality redistributed across new modular structure.
Modular agent setup orchestration
apps/desktop/src/main/lib/agent-setup/index.ts
New entry point exporting setupAgentHooks() to orchestrate directory creation and wrapper script generation on startup; exports getSupersetBinDir() and re-exports getShellEnv/getShellArgs.
Agent wrapper generation
apps/desktop/src/main/lib/agent-setup/agent-wrappers.ts
New module exporting createClaudeWrapper() and createCodexWrapper() functions to generate wrapper scripts at BIN_DIR; includes internal createClaudeSettings() to generate Claude configuration.
Notification hook generation
apps/desktop/src/main/lib/agent-setup/notify-hook.ts
New module exporting createNotifyScript() to generate and write a notify.sh Bash script for sending event notifications via curl to local endpoint.
Path constants
apps/desktop/src/main/lib/agent-setup/paths.ts
New module exporting four constants (BIN_DIR, HOOKS_DIR, ZSH_DIR, BASH_DIR) derived from SUPERSET_HOME_DIR.
Shell wrapper generation
apps/desktop/src/main/lib/agent-setup/shell-wrappers.ts
New module exporting createZshWrapper(), createBashWrapper() to generate shell initialization files; exports getShellEnv() and getShellArgs() for shell-specific environment and argument configuration.
Binary resolution utility
apps/desktop/src/main/lib/agent-setup/utils.ts
New module exporting findRealBinary(name: string) utility to locate real executable paths while filtering out wrapper directories.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • Shell script content generation: Verify correct Bash script syntax in notify-hook.ts and shell-wrappers.ts, including JSON parsing, environment variable handling, and PATH manipulation.
  • Binary resolution logic: Confirm findRealBinary() correctly filters out Superset wrapper paths and handles edge cases.
  • Orchestration and setup flow: Ensure setupAgentHooks() properly sequences directory creation, path verification, and all script generation calls.
  • Public API preservation: Verify that all exports from the original agent-setup.ts are correctly re-exported and available through the new modular structure.
  • Path constant consistency: Check that all modules correctly import and use the centralized path constants.

Possibly related PRs

Poem

🐰 Hops of delight as code finds its place,
One file split into modules with grace,
Paths, wrappers, hooks all neatly arranged,
Agent setup refactored—beautifully changed!

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mute-flea-20420f

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5bf1189 and 3871162.

📒 Files selected for processing (7)
  • apps/desktop/src/main/lib/agent-setup.ts (0 hunks)
  • apps/desktop/src/main/lib/agent-setup/agent-wrappers.ts (1 hunks)
  • apps/desktop/src/main/lib/agent-setup/index.ts (1 hunks)
  • apps/desktop/src/main/lib/agent-setup/notify-hook.ts (1 hunks)
  • apps/desktop/src/main/lib/agent-setup/paths.ts (1 hunks)
  • apps/desktop/src/main/lib/agent-setup/shell-wrappers.ts (1 hunks)
  • apps/desktop/src/main/lib/agent-setup/utils.ts (1 hunks)

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 and usage tips.

@Kitenite Kitenite changed the title Fix claude settings hooks Fix claude settings hooks + refactor agents-setup Dec 20, 2025
@Kitenite Kitenite merged commit 75a8199 into main Dec 20, 2025
4 of 5 checks passed
@Kitenite Kitenite deleted the mute-flea-20420f branch December 20, 2025 01:14
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

Service Status
Neon Database (Neon)

Thank you for your contribution! 🎉


Preview resources have been processed for cleanup

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.

1 participant