Skip to content

fix (desktop): fixed weird claude bug #420

Merged
AviPeltz merged 1 commit intomainfrom
vocational-rabbit-f310e9
Dec 18, 2025
Merged

fix (desktop): fixed weird claude bug #420
AviPeltz merged 1 commit intomainfrom
vocational-rabbit-f310e9

Conversation

@AviPeltz
Copy link
Copy Markdown
Collaborator

@AviPeltz AviPeltz commented Dec 18, 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

  • Bug Fixes
    • Improved script path resolution to ensure the notification system functions reliably across different system configurations.

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 18, 2025

Walkthrough

The change updates the Claude agent wrapper in agent-setup.ts to replace tilde-based command paths with explicit $HOME-based paths. It introduces a NOTIFY_SCRIPT variable and updates SUPERSET_CLAUDE_SETTINGS to reference this new script path, addressing tilde expansion issues in shell environments.

Changes

Cohort / File(s) Summary
Claude wrapper path resolution
apps/desktop/src/main/lib/agent-setup.ts
Replaces tilde (~) with explicit $HOME variable in command paths; introduces NOTIFY_SCRIPT constant; updates SUPERSET_CLAUDE_SETTINGS configuration to use the new script path with proper JSON escaping; adds comments explaining the tilde expansion issue and rationale.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Focus areas: Verify $HOME path expansion works correctly across supported shell environments; confirm JSON escaping in SUPERSET_CLAUDE_SETTINGS is syntactically valid; validate the notify script path logic aligns with deployment structure.

Possibly related PRs

Poem

🐰 A tilde walked into a shell, seeking home,

But paths twisted strange in environments unknown.

Now $HOME lights the way, explicit and clear,

The notify script runs true—no more fear! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely empty with an unfilled template; only the 'Bug fix' checkbox is marked while all other required sections lack substantive content. Complete all required template sections: add a clear description of the tilde expansion fix, link related issues, document testing steps, and provide any additional context about the bug.
Title check ❓ Inconclusive The title is vague and generic, using non-descriptive phrases like 'weird claude bug' without explaining the specific issue or fix. Revise the title to be more specific and descriptive, such as 'fix (desktop): resolve tilde expansion in agent-setup script path resolution' to clearly convey the actual change.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 vocational-rabbit-f310e9

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c114eac and 7062fed.

📒 Files selected for processing (1)
  • apps/desktop/src/main/lib/agent-setup.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx,json}

📄 CodeRabbit inference engine (AGENTS.md)

Use Biome for code formatting and linting, running at root level for speed

Files:

  • apps/desktop/src/main/lib/agent-setup.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Avoid any type and prioritize type safety in TypeScript code

Files:

  • apps/desktop/src/main/lib/agent-setup.ts
apps/desktop/src/main/lib/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Implement IPC handlers accepting object parameters (not positional parameters) in apps/desktop/src/main/lib/*.ts files

Files:

  • apps/desktop/src/main/lib/agent-setup.ts
apps/desktop/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

apps/desktop/**/*.{ts,tsx,js,jsx}: For Electron interprocess communication, ALWAYS use trpc as defined in src/lib/trpc
Use alias as defined in tsconfig.json when possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary.

Files:

  • apps/desktop/src/main/lib/agent-setup.ts
🧬 Code graph analysis (1)
apps/desktop/src/main/lib/agent-setup.ts (1)
apps/desktop/src/shared/constants.ts (1)
  • SUPERSET_DIR_NAME (23-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (3)
apps/desktop/src/main/lib/agent-setup.ts (3)

93-94: Excellent explanatory comments.

The comments clearly document the rationale for using $HOME instead of tilde, including the specific symptom (file watcher watching TMPDIR). This helps prevent regression and aids future maintainers.


105-105: Good addition of confirmation log.

The log message helps confirm the Claude wrapper was successfully created and shows which real binary is being wrapped, consistent with the Codex wrapper logging pattern.


99-100: Fix is technically correct; runtime verification needed to confirm Claude Code file watcher bug resolution.

The approach correctly addresses tilde expansion by using $HOME (runtime-expanded) instead of ~ (unexpanded in JSON strings). The JSON escaping and variable expansion flow are sound, matching the implementation.

The Codex wrapper (line 116+) shows an alternative using compile-time path.join(), which could improve consistency if preferred, but both approaches are functionally correct.

Verification requires confirming that Claude Code's file watcher no longer malfunctions after this fix.


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.

@AviPeltz AviPeltz merged commit a5e5859 into main Dec 18, 2025
5 checks passed
@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