Skip to content

fix: Update @github/copilot-sdk version and enhance version utility t…#840

Merged
gsxdsm merged 1 commit intoAutoMaker-Org:v1.0.0rcfrom
gsxdsm:fix/desktop-build
Mar 13, 2026
Merged

fix: Update @github/copilot-sdk version and enhance version utility t…#840
gsxdsm merged 1 commit intoAutoMaker-Org:v1.0.0rcfrom
gsxdsm:fix/desktop-build

Conversation

@gsxdsm
Copy link
Collaborator

@gsxdsm gsxdsm commented Mar 12, 2026

…o locate package.json

  • Changed @github/copilot-sdk dependency from "^0.1.16" to "0.1.16" in package.json and package-lock.json.
  • Improved version utility in version.ts to check multiple candidate paths for package.json, ensuring better reliability in locating the file.

Summary by CodeRabbit

Release Notes

  • Chores
    • Pinned dependency version for improved build reproducibility
    • Enhanced backend startup process with improved Node executable detection across development and packaged builds
    • Improved error handling and logging in version detection
    • Updated build configuration

…o locate package.json

- Changed @github/copilot-sdk dependency from "^0.1.16" to "0.1.16" in package.json and package-lock.json.
- Improved version utility in version.ts to check multiple candidate paths for package.json, ensuring better reliability in locating the file.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 focuses on improving the stability and self-sufficiency of the application, particularly for packaged Electron builds. It ensures consistent dependency resolution and enhances the internal mechanism for identifying application metadata, leading to a more reliable and predictable runtime environment.

Highlights

  • Dependency Update: The @github/copilot-sdk dependency has been updated to a fixed version 0.1.16 in package.json and package-lock.json.
  • Improved Version Utility: The version.ts utility now robustly locates package.json by checking multiple candidate paths, enhancing reliability in different environments.
  • Electron Backend Runtime: The Electron application's backend server now utilizes Electron's bundled Node.js runtime in packaged builds, ensuring self-contained operation and avoiding system Node.js version conflicts.
  • Git Ignore Update: Added .bg-shell/ to the .gitignore file.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • Added .bg-shell/ to the list of ignored files.
  • apps/server/package.json
    • Changed @github/copilot-sdk dependency from ^0.1.16 to 0.1.16.
  • apps/server/src/lib/version.ts
    • Imported existsSync from the fs module.
    • Modified getVersion function to check multiple candidate paths for package.json.
    • Added error handling if package.json is not found in any expected location.
  • apps/ui/src/electron/server/backend-server.ts
    • Refactored server startup logic to differentiate between development and packaged builds.
    • Configured packaged builds to use Electron's bundled Node runtime (process.execPath) instead of searching for a system Node.js executable.
    • Added ELECTRON_RUN_AS_NODE: '1' environment variable for packaged builds.
    • Improved logging to show the runtime command and its source.
  • package-lock.json
    • Updated the locked version of @github/copilot-sdk to 0.1.16.
Activity
  • No human activity has been recorded on this pull request yet.
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 Mar 12, 2026

📝 Walkthrough

Walkthrough

This PR updates configuration and enhances backend initialization. It adds a gitignore rule, pins a dependency to a fixed version, improves package.json location resolution with better error handling, and refactors Node executable path selection in the Electron backend to handle dev and packaged builds differently with source tracking.

Changes

Cohort / File(s) Summary
Configuration
.gitignore, apps/server/package.json
Adds .bg-shell/ ignore rule and pins @github/copilot-sdk from ^0.1.16 to 0.1.16 for stricter version control.
Version Resolution
apps/server/src/lib/version.ts
Implements multi-path search for package.json across development and build directories with enhanced error handling; adds existsSync check and try-catch fallback to '0.0.0'.
Electron Backend
apps/ui/src/electron/server/backend-server.ts
Refactors Node executable selection to distinguish dev (findNodeExecutable with skipSearch=true) from packaged builds (Electron's process.execPath), adds commandSource tracking, ELECTRON_RUN_AS_NODE environment variable for packaged builds, and runtime logging.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Enhancement

Poem

🐰 A rabbit hops through code so bright,
Dependencies pinned, versions tight!
Node paths found with care and grace,
Both dev and packaged, each in place!
bounces

🚥 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 accurately reflects the main changes: updating the @github/copilot-sdk version and enhancing the version utility to locate package.json, which are the primary modifications across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan for PR comments
  • Generate coding plan

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

This pull request introduces several improvements. It pins the @github/copilot-sdk dependency to a specific version for better stability. The version utility is enhanced to more reliably locate the package.json file across different environments. A significant and valuable change is the refactoring of the backend server startup, which now uses Electron's bundled Node.js runtime for packaged builds, making the application more self-contained. My feedback includes a suggestion to improve error handling for better debuggability.

Comment on lines +52 to +55
const originalError = error instanceof Error ? error.message : String(error);
throw new Error(
`Failed to verify Node.js executable at: ${command} (source: ${nodeResult.source}). Reason: ${originalError}`
);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better debuggability, it's recommended to preserve the original error's context (including stack trace) when re-throwing. The cause property on Error is perfect for this (available in Node.js v16.9.0+). This change also provides an opportunity to use the new commandSource variable for consistency instead of nodeResult.source.

Suggested change
const originalError = error instanceof Error ? error.message : String(error);
throw new Error(
`Failed to verify Node.js executable at: ${command} (source: ${nodeResult.source}). Reason: ${originalError}`
);
throw new Error(
`Failed to verify Node.js executable at: ${command} (source: ${commandSource}).`,
{ cause: error }
);

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@apps/ui/src/electron/server/backend-server.ts`:
- Around line 36-62: The dev-mode startup is bypassing full Node discovery by
calling findNodeExecutable({ skipSearch: true, ... }), which returns the literal
'node' and prevents buildEnhancedPath/validation from running; remove the
skipSearch: true option so findNodeExecutable runs platform discovery (keep the
logger usage), then preserve the existing validation logic that checks command
!== 'node' and uses systemPathExists to verify the resolved node path in the
isDev branch (references: findNodeExecutable, buildEnhancedPath, isDev, command,
commandSource).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b5473973-a864-4060-a2a3-7262cef54384

📥 Commits

Reviewing files that changed from the base of the PR and between 7be8163 and 046392c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .gitignore
  • apps/server/package.json
  • apps/server/src/lib/version.ts
  • apps/ui/src/electron/server/backend-server.ts

Comment on lines +36 to 62
if (isDev) {
// In development, run the TypeScript server via the user's Node.js.
const nodeResult = findNodeExecutable({
skipSearch: true,
logger: (msg: string) => logger.info(msg),
});
command = nodeResult.nodePath;
commandSource = nodeResult.source;

// Validate that the found Node executable actually exists
// systemPathExists is used because node-finder returns system paths
if (command !== 'node') {
let exists: boolean;
try {
exists = systemPathExists(command);
} catch (error) {
const originalError = error instanceof Error ? error.message : String(error);
throw new Error(
`Failed to verify Node.js executable at: ${command} (source: ${nodeResult.source}). Reason: ${originalError}`
);
}
if (!exists) {
throw new Error(
`Node.js executable not found at: ${command} (source: ${nodeResult.source})`
);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that the call site disables discovery and that the helper returns the fallback literal.
rg -n -C2 'skipSearch:\s*true' apps/ui/src/electron/server/backend-server.ts
sed -n '275,300p' libs/platform/src/node-finder.ts

Repository: AutoMaker-Org/automaker

Length of output: 952


🏁 Script executed:

# Check other call sites of findNodeExecutable to understand the pattern
rg -n 'findNodeExecutable' apps/ui/src/electron/server/backend-server.ts libs/platform/src/node-finder.ts --type ts

Repository: AutoMaker-Org/automaker

Length of output: 751


🏁 Script executed:

# Check if there are comments or documentation explaining the skipSearch choice
rg -B5 -A5 'skipSearch.*true' apps/ui/src/electron/server/ --type ts

Repository: AutoMaker-Org/automaker

Length of output: 887


🏁 Script executed:

# Verify the function signature and default behavior
rg -B3 -A10 'export function findNodeExecutable' libs/platform/src/node-finder.ts --type ts

Repository: AutoMaker-Org/automaker

Length of output: 477


🏁 Script executed:

# Check the packaged mode branch to see the alternative approach
rg -B5 -A15 'if (isDev)' apps/ui/src/electron/server/backend-server.ts --type ts

Repository: AutoMaker-Org/automaker

Length of output: 49


🏁 Script executed:

# Look for any environment setup or PATH configuration in the Electron context
rg -n 'NODE_PATH|process.env.PATH|ELECTRON' apps/ui/src/electron/ --type ts | head -20

Repository: AutoMaker-Org/automaker

Length of output: 574


🏁 Script executed:

# Get the full context of the backend server startup including buildEnhancedPath usage
sed -n '1,170p' apps/ui/src/electron/server/backend-server.ts | tail -40

Repository: AutoMaker-Org/automaker

Length of output: 1614


🏁 Script executed:

# Look for buildEnhancedPath implementation and documentation
rg -B3 -A15 'export.*buildEnhancedPath|function buildEnhancedPath' libs/platform/src/ --type ts

Repository: AutoMaker-Org/automaker

Length of output: 1418


Don't bypass findNodeExecutable() in dev mode.

With skipSearch: true, the function returns the fallback literal 'node' and skips all platform discovery. Additionally, buildEnhancedPath() explicitly skips PATH enhancement when receiving the fallback value, and validation is skipped at lines 47–62. In dev mode, Electron will rely solely on the current process.env.PATH to resolve node, which is often unavailable outside shell-launched sessions. Use the same discovery logic as packaged mode by removing skipSearch: true.

♻️ Proposed fix
     const nodeResult = findNodeExecutable({
-      skipSearch: true,
       logger: (msg: string) => logger.info(msg),
     });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/ui/src/electron/server/backend-server.ts` around lines 36 - 62, The
dev-mode startup is bypassing full Node discovery by calling
findNodeExecutable({ skipSearch: true, ... }), which returns the literal 'node'
and prevents buildEnhancedPath/validation from running; remove the skipSearch:
true option so findNodeExecutable runs platform discovery (keep the logger
usage), then preserve the existing validation logic that checks command !==
'node' and uses systemPathExists to verify the resolved node path in the isDev
branch (references: findNodeExecutable, buildEnhancedPath, isDev, command,
commandSource).

@gsxdsm gsxdsm merged commit 0311130 into AutoMaker-Org:v1.0.0rc Mar 13, 2026
10 checks 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.

1 participant