Skip to content

Resolve WSL launch path dynamically - #18

Merged
ADITYA-tp01 merged 1 commit into
mainfrom
dynamic-wsl-path
Aug 29, 2026
Merged

Resolve WSL launch path dynamically#18
ADITYA-tp01 merged 1 commit into
mainfrom
dynamic-wsl-path

Conversation

@ADITYA-tp01

@ADITYA-tp01 ADITYA-tp01 commented Aug 29, 2026

Copy link
Copy Markdown
Owner

User description

Address Qodo Review feedback by dynamically resolving the TrueForge launch script path via wslpath instead of relying on a hardcoded developer-specific absolute path.


CodeAnt-AI Description

Launch TrueForge from the correct project location on any Windows setup

What Changed

  • The WSL launch directory is now resolved from the script’s current location instead of a fixed developer-specific path
  • TrueForge starts correctly when the project is stored in a different folder or under a different Windows username

Impact

✅ Reliable TrueForge startup across Windows user folders
✅ No project path changes required after checkout

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

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

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:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

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.

@codeant-ai

codeant-ai Bot commented Aug 29, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR f560856 Aug 29, 2026 · 23:58 23:59

@codeant-ai

codeant-ai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@ADITYA-tp01
ADITYA-tp01 merged commit 263687f into main Aug 29, 2026
1 check passed
@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Aug 29, 2026
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Resolve the TrueForge WSL launch path dynamically

🐞 Bug fix 🕐 Less than 5 minutes

Grey Divider

AI Description

• Converts the repository-relative launch directory into a WSL-compatible absolute path.
• Removes the developer-specific path so TrueForge launches from any checkout location.
Diagram

graph TD
  A["start.ps1"] -->|passes Windows path| B["WSL wslpath"] -->|returns Linux path| C["WSL Directory"] -->|runs| D["start-trueforge.sh"]
Loading
High-Level Assessment

Using wslpath with a path derived from $PSScriptRoot is the appropriate approach because it supports arbitrary checkout locations while retaining the existing WSL launch command. Hardcoded paths and manual path rewriting were considered but would remain machine-specific or unnecessarily fragile.

Files changed (1) +2 / -1

Bug fix (1) +2 / -1
start.ps1Resolve the TrueForge launch directory for WSL +2/-1

Resolve the TrueForge launch directory for WSL

• Derives the scripts/wsl directory from $PSScriptRoot and converts it to an absolute Linux path with wslpath. The resolved path replaces the developer-specific directory in the TrueForge launch command.

start.ps1

@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

Comment thread start.ps1
Write-Host "[7/7] Starting TrueForge in WSL..." -ForegroundColor Yellow
Start-Process powershell -ArgumentList "-NoExit", "-Command", "wsl -- bash -c 'cd `"/mnt/c/Users/adity/Documents/Mission Control/scripts/wsl`" && bash start-trueforge.sh'"
$wslPath = (wsl -e wslpath -a -u "$PSScriptRoot/scripts/wsl").Trim()
Start-Process powershell -ArgumentList "-NoExit", "-Command", "wsl -- bash -c 'cd `"$wslPath`" && bash start-trueforge.sh'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: The setup and installation steps target the Ubuntu distribution, but this launcher invokes the default WSL distribution. If the default distribution is not Ubuntu, start-trueforge.sh runs where the Node.js installation and globally installed TrueForge package are absent, causing npx to fail. Invoke both wslpath and the launcher against Ubuntu, or use the same configured distribution consistently. [api mismatch]

Severity Level: Major ⚠️
- ❌ TrueForge startup fails with a non-Ubuntu WSL default.
- ⚠️ Dashboard cannot connect to the TrueForge UI.
- ⚠️ Installation and launch use inconsistent distributions.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** start.ps1
**Line:** 83:83
**Comment:**
	*Api Mismatch: The setup and installation steps target the Ubuntu distribution, but this launcher invokes the default WSL distribution. If the default distribution is not Ubuntu, `start-trueforge.sh` runs where the Node.js installation and globally installed TrueForge package are absent, causing `npx` to fail. Invoke both `wslpath` and the launcher against Ubuntu, or use the same configured distribution consistently.

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

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Launch uses wrong distro 🐞 Bug ≡ Correctness
Description
Steps 5–6 install Node and TrueForge in the explicitly selected Ubuntu distribution, but the new
conversion and launch commands use whichever distribution is currently the WSL default. When another
distro is default, TrueForge starts in an environment where the required installation was never
performed and can fail at npx.
Code

start.ps1[R82-83]

+$wslPath = (wsl -e wslpath -a -u "$PSScriptRoot/scripts/wsl").Trim()
+Start-Process powershell -ArgumentList "-NoExit", "-Command", "wsl -- bash -c 'cd `"$wslPath`" && bash start-trueforge.sh'"
Relevance

●●● Strong

Recent PR #5 accepted portability fixes for WSL launch paths; explicit distro selection matches the
same reliability intent.

PR-#5

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The setup commands explicitly target Ubuntu, while both newly changed commands omit -d Ubuntu; the
launched script ultimately executes npx, which depends on the per-distro Node installation.

start.ps1[61-76]
start.ps1[82-83]
scripts/wsl/start-trueforge.sh[24-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The startup path conversion and TrueForge launch use WSL's default distribution even though setup installs the required runtime and package in `Ubuntu`.

## Issue Context
Ensure path resolution and execution target the same distribution configured in steps 5–6, ideally through one shared distro variable.

## Fix Focus Areas
- start.ps1[61-83]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Checkout path breaks command 🐞 Bug ☼ Reliability
Description
The converted path is interpolated as Bash source inside a PowerShell single-quoted -Command
argument without escaping it. A valid checkout path containing an apostrophe (for example
C:\Users\O'Brien\repo) terminates the PowerShell string and prevents launch, while Bash
substitutions such as $() in a directory name are evaluated inside the generated double-quoted
cd operand.
Code

start.ps1[83]

+Start-Process powershell -ArgumentList "-NoExit", "-Command", "wsl -- bash -c 'cd `"$wslPath`" && bash start-trueforge.sh'"
Relevance

●●● Strong

Recent PR #5 accepted clean-checkout portability fixes; escaping nested shell paths is a
deterministic launch reliability fix.

PR-#5

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed line inserts $wslPath into a command delimited by PowerShell single quotes and then
Bash double quotes; the repository launcher is only reached after this generated cd succeeds.

start.ps1[82-83]
scripts/wsl/start-trueforge.sh[9-9]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The dynamically resolved checkout path is embedded directly into nested PowerShell and Bash command text, so valid shell-significant path characters can break or alter execution.

## Issue Context
Pass the path as data rather than interpolating it into Bash source, or apply correct escaping for both parsing layers. Preserve support for spaces, apostrophes, dollar signs, and backticks.

## Fix Focus Areas
- start.ps1[82-83]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: ⚖️ Balanced

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread start.ps1
Comment on lines +82 to +83
$wslPath = (wsl -e wslpath -a -u "$PSScriptRoot/scripts/wsl").Trim()
Start-Process powershell -ArgumentList "-NoExit", "-Command", "wsl -- bash -c 'cd `"$wslPath`" && bash start-trueforge.sh'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Launch uses wrong distro 🐞 Bug ≡ Correctness

Steps 5–6 install Node and TrueForge in the explicitly selected Ubuntu distribution, but the new
conversion and launch commands use whichever distribution is currently the WSL default. When another
distro is default, TrueForge starts in an environment where the required installation was never
performed and can fail at npx.
Agent Prompt
## Issue description
The startup path conversion and TrueForge launch use WSL's default distribution even though setup installs the required runtime and package in `Ubuntu`.

## Issue Context
Ensure path resolution and execution target the same distribution configured in steps 5–6, ideally through one shared distro variable.

## Fix Focus Areas
- start.ps1[61-83]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread start.ps1
Write-Host "[7/7] Starting TrueForge in WSL..." -ForegroundColor Yellow
Start-Process powershell -ArgumentList "-NoExit", "-Command", "wsl -- bash -c 'cd `"/mnt/c/Users/adity/Documents/Mission Control/scripts/wsl`" && bash start-trueforge.sh'"
$wslPath = (wsl -e wslpath -a -u "$PSScriptRoot/scripts/wsl").Trim()
Start-Process powershell -ArgumentList "-NoExit", "-Command", "wsl -- bash -c 'cd `"$wslPath`" && bash start-trueforge.sh'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. Checkout path breaks command 🐞 Bug ☼ Reliability

The converted path is interpolated as Bash source inside a PowerShell single-quoted -Command
argument without escaping it. A valid checkout path containing an apostrophe (for example
C:\Users\O'Brien\repo) terminates the PowerShell string and prevents launch, while Bash
substitutions such as $() in a directory name are evaluated inside the generated double-quoted
cd operand.
Agent Prompt
## Issue description
The dynamically resolved checkout path is embedded directly into nested PowerShell and Bash command text, so valid shell-significant path characters can break or alter execution.

## Issue Context
Pass the path as data rather than interpolating it into Bash source, or apply correct escaping for both parsing layers. Preserve support for spaces, apostrophes, dollar signs, and backticks.

## Fix Focus Areas
- start.ps1[82-83]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant