Skip to content

Conversation

@hbruceweaver
Copy link

@hbruceweaver hbruceweaver commented Jan 21, 2026

Summary

  • When running npm run dev after previously using the packaged DMG, settings.json may retain autoBuildPath pointing to the packaged app's backend
  • This causes confusing errors like "require is not defined" in Graphiti setup because the wrong Python venv is used
  • This fix detects dev mode and automatically prefers the source backend when available

The Problem

  1. User installs Auto-Claude from DMG
  2. User later clones source and runs npm run dev
  3. settings.json still points to /Applications/Auto-Claude.app/Contents/Resources/backend
  4. Dev mode uses the packaged venv instead of source venv
  5. Missing/mismatched dependencies cause cryptic errors

The Fix

Added dev-mode detection in apps/frontend/src/main/index.ts:

  • Checks !app.isPackaged to detect dev mode
  • Validates source backend exists at ../../../backend
  • If source backend exists and differs from settings, prefers source backend
  • Logs informative messages when overriding

No changes to packaged app behavior.

Test plan

  • Verify settings.json has stale path pointing to packaged app backend
  • Run npm run dev
  • Confirm logs show dev mode detection and override
  • Verify Graphiti setup works correctly with source backend

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed development build path resolution to correctly locate the Python backend from source code, improving the development experience when running in non-packaged mode.

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

When running `npm run dev` after having previously used the packaged DMG app,
settings.json may contain an `autoBuildPath` pointing to the packaged app's
backend instead of the source code backend. This causes confusing errors like
"require is not defined" in the Graphiti setup wizard because the wrong Python
venv is used.

This fix detects dev mode (`!app.isPackaged`) and automatically prefers the
source backend when it exists, overriding stale settings paths. Packaged app
behavior is unchanged.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hbruceweaver, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a common development environment problem where a user's settings.json might retain a backend path from a previously installed packaged application. This stale setting could lead to npm run dev using an incorrect Python virtual environment, causing cryptic errors. The changes introduce a mechanism to detect development mode and automatically switch to the correct source backend path if available, streamlining the developer experience and preventing configuration-related issues.

Highlights

  • Development Mode Detection: Implemented logic to detect if the application is running in development mode (not packaged) using !app.isPackaged.
  • Source Backend Preference: Added a mechanism to prefer the source backend path over any stale autoBuildPath stored in settings.json when in development mode, preventing incorrect virtual environment usage.
  • Improved Developer Experience: Automatically resolves issues where npm run dev might use a packaged app's backend, leading to 'require is not defined' errors due to mismatched Python virtual environments.
  • Informative Logging: Included console logs to provide clear messages when the backend path is overridden, indicating both the old settings path and the new source path.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

A development mode fix is added to override the saved backend path with the source backend path when running in development mode. The code checks for spec_runner.py existence and updates the path if it differs from the current configuration.

Changes

Cohort / File(s) Summary
Development Mode Path Selection
apps/frontend/src/main/index.ts
Adds logic to detect development mode and prefer source backend path over saved settings. Includes file existence check for spec_runner.py and conditional path override with logging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

bug, area/frontend, size/XS, priority/medium, Missing AC Approval

Suggested reviewers

  • AndyMik90
  • marcefalcondev

Poem

🐰 In dev mode, a path does hop,
Source preferred, no saved path flop,
A spec_runner check keeps things right,
The frontend now works as it might! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: prefer source backend over stale settings path in dev mode' clearly and specifically summarizes the main change: fixing dev mode to prioritize the source backend over outdated settings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🎉 Thanks for your first PR!

A maintainer will review it soon. Please make sure:

  • Your branch is synced with develop
  • CI checks pass
  • You've followed our contribution guide

Welcome to the Auto Claude community!

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request effectively resolves a common development issue where a stale autoBuildPath in settings.json could lead to incorrect Python virtual environment usage during npm run dev. The introduced logic correctly detects development mode and prioritizes the source backend path, significantly improving the developer experience by preventing cryptic dependency errors. The changes are well-placed and include informative logging for debugging purposes.

Comment on lines +314 to +327
let sourceBackendExists = false;
try {
accessSync(sourceSpecRunnerPath);
sourceBackendExists = true;
} catch {
// Source backend doesn't exist
}

if (sourceBackendExists && validAutoBuildPath !== sourceBackendPath) {
console.log('[main] Dev mode detected - preferring source backend over settings');
console.log('[main] Settings path:', validAutoBuildPath);
console.log('[main] Source path:', sourceBackendPath);
validAutoBuildPath = sourceBackendPath;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The sourceBackendExists boolean variable is redundant. The logic can be simplified by directly performing the if condition check inside the try block, leveraging the EAFP (Easier to Ask for Forgiveness than Permission) pattern more directly. This makes the code slightly more concise and easier to follow.

      try {
        accessSync(sourceSpecRunnerPath); // If this succeeds, the file exists
        if (validAutoBuildPath !== sourceBackendPath) {
          console.log('[main] Dev mode detected - preferring source backend over settings');
          console.log('[main]   Settings path:', validAutoBuildPath);
          console.log('[main]   Source path:', sourceBackendPath);
          validAutoBuildPath = sourceBackendPath;
        }
      } catch {
        // Source backend doesn't exist or isn't accessible, so we don't override.
        // No action needed, validAutoBuildPath retains its original value.
      }

@sentry
Copy link

sentry bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AndyMik90 AndyMik90 self-assigned this Jan 21, 2026
@AndyMik90 AndyMik90 force-pushed the develop branch 2 times, most recently from 67a743f to e83e445 Compare January 21, 2026 14:26
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.

3 participants