feat: full one-click start - #12
Conversation
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
PR Summary by QodoAutomate WSL Node.js and TrueForge startup
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
|
Failed to generate code suggestions for PR |
| $wslLinuxNode = wsl -d Ubuntu -- bash -c 'test -f /usr/bin/node && echo ok || echo missing' | ||
| if ($wslLinuxNode -match "missing") { | ||
| Write-Host " Installing Node.js 20 in WSL (first time only)..." -ForegroundColor Yellow | ||
| wsl -d Ubuntu -- bash -c 'curl -fsSL https://deb.nodesource.com/setup_20.x -o /tmp/ns.sh' | ||
| wsl -d Ubuntu -- bash -c 'sudo bash /tmp/ns.sh' | ||
| wsl -d Ubuntu -- bash -c 'sudo apt-get install -y nodejs' | ||
| Write-Host " Node.js installed in WSL" -ForegroundColor Green |
There was a problem hiding this comment.
Suggestion: The WSL discovery and installation commands do not validate their exit status. If Ubuntu is unavailable or curl, sudo, or apt fails, $wslLinuxNode may not contain missing, causing the script to print that Node.js was installed or already available and continue to TrueForge setup. Check $LASTEXITCODE after every native wsl invocation and stop with an actionable error when setup fails. [possible bug]
Severity Level: Major ⚠️
- ❌ Clean WSL setup can continue without Node.js.
- ❌ TrueForge launch fails after a misleading success message.
- ⚠️ Users receive no actionable WSL installation error.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** start.ps1
**Line:** 61:67
**Comment:**
*Possible Bug: The WSL discovery and installation commands do not validate their exit status. If Ubuntu is unavailable or curl, sudo, or apt fails, `$wslLinuxNode` may not contain `missing`, causing the script to print that Node.js was installed or already available and continue to TrueForge setup. Check `$LASTEXITCODE` after every native `wsl` invocation and stop with an actionable error when setup fails.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix| wsl -d Ubuntu -- bash -c 'export PATH=/usr/bin:/usr/local/bin:$PATH && npm install -g @truefoundry/trueforge' | ||
| Write-Host " TrueForge installed in WSL" -ForegroundColor Green |
There was a problem hiding this comment.
Suggestion: npm install -g is executed as the normal WSL user after installing the apt-provided Node.js, whose global npm prefix is normally root-owned. On a clean Ubuntu installation this commonly fails with a permissions error, but the script still prints that TrueForge was installed and proceeds to launch it. Install into a user-writable prefix, invoke npm with the required privileges, or verify the command succeeds before reporting success. [possible bug]
Severity Level: Major ⚠️
- ❌ First-run TrueForge installation can fail.
- ❌ The advertised TrueForge UI may never start.
- ⚠️ Users receive a false installation-success message.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** start.ps1
**Line:** 77:78
**Comment:**
*Possible Bug: `npm install -g` is executed as the normal WSL user after installing the apt-provided Node.js, whose global npm prefix is normally root-owned. On a clean Ubuntu installation this commonly fails with a permissions error, but the script still prints that TrueForge was installed and proceeds to launch it. Install into a user-writable prefix, invoke npm with the required privileges, or verify the command succeeds before reporting success.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix|
|
||
| # Launch TrueForge in WSL | ||
| Write-Host " Launching TrueForge in WSL..." -ForegroundColor Yellow | ||
| Start-Process powershell -ArgumentList "-NoExit", "-Command", "wsl -d Ubuntu -- bash -c 'export PATH=/usr/bin:/usr/local/bin:`$PATH && cd ~ && npx @truefoundry/trueforge'" |
There was a problem hiding this comment.
Suggestion: The launch bypasses scripts/wsl/start-trueforge.sh, which loads the repository .env, validates OPENAI_API_KEY, adds the supported user-local Node path, binds TrueForge to 0.0.0.0, and explicitly selects port 3000. Running npx from ~ without those settings can start a differently configured or loopback-only server, making it unreachable from the dashboard or lacking the required credentials. [api mismatch]
Severity Level: Major ⚠️
- ❌ Dashboard agent chat may fail to reach TrueForge.
- ❌ Webhook incident sessions may fail authentication.
- ⚠️ Repository `.env` configuration is ignored.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** start.ps1
**Line:** 85:85
**Comment:**
*Api Mismatch: The launch bypasses `scripts/wsl/start-trueforge.sh`, which loads the repository `.env`, validates `OPENAI_API_KEY`, adds the supported user-local Node path, binds TrueForge to `0.0.0.0`, and explicitly selects port 3000. Running `npx` from `~` without those settings can start a differently configured or loopback-only server, making it unreachable from the dashboard or lacking the required credentials.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
Code Review by Qodo
1. Global install ignored at launch
|
| wsl -d Ubuntu -- bash -c 'curl -fsSL https://deb.nodesource.com/setup_20.x -o /tmp/ns.sh' | ||
| wsl -d Ubuntu -- bash -c 'sudo bash /tmp/ns.sh' | ||
| wsl -d Ubuntu -- bash -c 'sudo apt-get install -y nodejs' | ||
| Write-Host " Node.js installed in WSL" -ForegroundColor Green |
There was a problem hiding this comment.
1. Install failures report success 🐞 Bug ☼ Reliability
The Node setup runs download, repository setup, and apt installation as independent native commands without checking any exit code, then unconditionally reports success. A failed download/setup therefore still runs apt-get install nodejs against the existing Ubuntu repositories and can leave no Node or the wrong major version while the one-click flow proceeds.
Agent Prompt
## Issue description
The Node installation stages do not short-circuit or validate native exit codes, so failed setup can be reported as a successful Node.js 20 installation.
## Issue Context
Windows PowerShell does not make a native process's nonzero exit status terminating merely because `$ErrorActionPreference` is `Stop`. Keep the setup atomic and verify the resulting Node version before continuing.
## Fix Focus Areas
- start.ps1[64-67]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| $wslLinuxNode = wsl -d Ubuntu -- bash -c 'test -f /usr/bin/node && echo ok || echo missing' | ||
| if ($wslLinuxNode -match "missing") { |
There was a problem hiding this comment.
2. Valid node installs misdetected 🐞 Bug ≡ Correctness
Node detection now accepts only /usr/bin/node, so a valid Linux-native installation under a user-managed prefix is treated as missing and triggers an unnecessary privileged system installation. The repository's own TrueForge launcher explicitly supports $HOME/.local/node/bin, which this check fails to recognize.
Agent Prompt
## Issue description
The WSL Node check hard-codes `/usr/bin/node` and misclassifies supported user-local Linux Node installations.
## Issue Context
Use a login shell or explicitly include repository-supported user-local prefixes, then validate that the resolved executable is Linux-native rather than requiring one fixed path.
## Fix Focus Areas
- start.ps1[61-62]
- scripts/wsl/start-trueforge.sh[24-26]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # Launch TrueForge in WSL | ||
| Write-Host " Launching TrueForge in WSL..." -ForegroundColor Yellow | ||
| Start-Process powershell -ArgumentList "-NoExit", "-Command", "wsl -d Ubuntu -- bash -c 'export PATH=/usr/bin:/usr/local/bin:`$PATH && cd ~ && npx @truefoundry/trueforge'" |
There was a problem hiding this comment.
3. Global install ignored at launch 🐞 Bug ≡ Correctness
After installing TrueForge globally, the script launches npx @truefoundry/trueforge from ~ without -y; because the package is not a local project dependency, npx can prompt to fetch another copy before starting. The supposedly automatic install therefore still requires terminal confirmation and may run the npx cache copy rather than the globally installed executable that was just verified.
Agent Prompt
## Issue description
The launch command does not use the globally installed `trueforge` executable and can cause npx to prompt for another installation.
## Issue Context
Launch the detected global binary directly, or intentionally use `npx -y` and remove the redundant global-install/detection flow. Preserve the required PATH and port configuration.
## Fix Focus Areas
- start.ps1[74-85]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
User description
Handles WSL Node.js + TrueForge install automatically.
CodeAnt-AI Description
Start MissionControl and its WSL tools with one command
What Changed
Impact
✅ One-command WSL setup✅ Fewer manual installation steps✅ TrueForge opens ready to configure💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.