Skip to content

fix: WSL TrueForge launch - #13

Merged
ADITYA-tp01 merged 1 commit into
mainfrom
fix/wsl-launch
Aug 29, 2026
Merged

fix: WSL TrueForge launch#13
ADITYA-tp01 merged 1 commit into
mainfrom
fix/wsl-launch

Conversation

@ADITYA-tp01

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

Copy link
Copy Markdown
Owner

User description

Fixes TrueForge launch in WSL via script file.


CodeAnt-AI Description

Launch TrueForge reliably in WSL

What Changed

  • TrueForge now starts through a temporary WSL-compatible script instead of an inline command
  • The launch script sets the required executable paths, switches to the home directory, and starts TrueForge consistently
  • The Windows script waits briefly after opening the WSL terminal before reporting that startup is complete

Impact

✅ Reliable TrueForge startup in WSL
✅ Fewer launch failures from command parsing
✅ Clearer startup completion feedback

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

@ADITYA-tp01
ADITYA-tp01 merged commit cbae987 into main Aug 29, 2026
@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 4fbee19 Aug 29, 2026 · 22:55 22:57

@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

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Aug 29, 2026
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix TrueForge startup through a temporary WSL script

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Replaces fragile nested shell quoting with a temporary Bash launch script.
• Preserves Linux PATH resolution and starts TrueForge reliably inside Ubuntu WSL.
• Writes the script without a UTF-8 BOM and briefly waits before reporting success.
Diagram

graph TD
  A["start.ps1"] -->|writes| B["Temp Bash script"] -->|executes| C["WSL Ubuntu"] -->|runs npx| D["TrueForge CLI"]
Loading
High-Level Assessment

Generating a Bash script is appropriate because it removes fragile nested PowerShell, WSL, and Bash quoting while keeping Linux environment setup explicit. Retaining one inline command or adding a permanent repository script would either preserve the original escaping risk or add unnecessary project surface for this focused launcher fix.

Files changed (1) +10 / -1

Bug fix (1) +10 / -1
start.ps1Launch TrueForge through a generated WSL Bash script +10/-1

Launch TrueForge through a generated WSL Bash script

• Replaces the nested inline PowerShell/WSL command with a temporary BOM-free Bash script that configures PATH, enters the WSL home directory, and starts TrueForge. Launches the script through Ubuntu WSL and adds a short delay before reporting that the terminal opened.

start.ps1

@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

Comment thread start.ps1
#!/bin/bash
export PATH=/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH
cd ~
npx @truefoundry/trueforge

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 launcher omits npx -y, unlike the repository-supported TrueForge launcher. Because the package was installed globally but is not necessarily resolved by npx as an executable package, npx can prompt for confirmation to install it in the new terminal, causing the one-click startup to wait instead of launching unattended. [api mismatch]

Severity Level: Major ⚠️
- ❌ One-click TrueForge startup can block on an interactive npx prompt.
- ⚠️ The WSL terminal requires manual confirmation before serving TrueForge.

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:** 89:89
**Comment:**
	*Api Mismatch: The launcher omits `npx -y`, unlike the repository-supported TrueForge launcher. Because the package was installed globally but is not necessarily resolved by `npx` as an executable package, `npx` can prompt for confirmation to install it in the new terminal, causing the one-click startup to wait instead of launching unattended.

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

Comment thread start.ps1
'@
$scriptPath = "$env:TEMP\start-tf.sh"
[System.IO.File]::WriteAllText($scriptPath, $wslScript, [System.Text.UTF8Encoding]::new($false))
Start-Process wsl -ArgumentList "-d Ubuntu -- bash -c 'bash /mnt/c/$($env:TEMP -replace '\\','/')/start-tf.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 constructed WSL path is invalid for the normal Windows TEMP value, which includes the drive prefix, such as C:\Users\...\AppData\Local\Temp. This produces /mnt/c/C:/Users/.../start-tf.sh, so WSL cannot find the generated script. Convert the Windows path with wslpath or strip the drive prefix and map the actual drive before launching. [logic error]

Severity Level: Major ⚠️
- ❌ TrueForge fails to launch from the one-click Windows startup script.
- ⚠️ The dashboard starts while its required TrueForge terminal remains unavailable.

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:** 93:93
**Comment:**
	*Logic Error: The constructed WSL path is invalid for the normal Windows `TEMP` value, which includes the drive prefix, such as `C:\Users\...\AppData\Local\Temp`. This produces `/mnt/c/C:/Users/.../start-tf.sh`, so WSL cannot find the generated script. Convert the Windows path with `wslpath` or strip the drive prefix and map the actual drive before launching.

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 (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Invalid WSL temp path 🐞 Bug ≡ Correctness
Description
The launcher prepends /mnt/c/ to the complete Windows %TEMP% value, turning a normal path such
as C:\Users\me\AppData\Local\Temp into the nonexistent
/mnt/c/C:/Users/me/AppData/Local/Temp/start-tf.sh; other drives and paths containing spaces fail
as well. Consequently, Bash cannot find the generated script and TrueForge does not launch.
Code

start.ps1[93]

+Start-Process wsl -ArgumentList "-d Ubuntu -- bash -c 'bash /mnt/c/$($env:TEMP -replace '\\','/')/start-tf.sh'"
Relevance

●●● Strong

Legit bug: hard-coded /mnt/c/ path breaks non-C drives/spaces; matches accepted precedent of fixing
hard-coded WSL paths in PR #5.

PR-#5

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed code writes the file using the complete $env:TEMP Windows path and then embeds that
same drive-qualified value after a hard-coded /mnt/c/. The repository's established WSL launcher
instead calls wslpath -a -u to translate a Windows path before using it in WSL, and prior review
history records the same portability class of hard-coded WSL-path defect.

start.ps1[91-93]
scripts/start-all.ps1[9-17]
PR-#5

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 generated script is written to an absolute Windows `%TEMP%` path, but the launch command incorrectly creates its Linux path by prepending `/mnt/c/` to that complete Windows path. Convert the exact `$scriptPath` through WSL's `wslpath` and quote the resulting Linux path safely when invoking Bash.

## Issue Context
For example, `C:\Users\me\AppData\Local\Temp\start-tf.sh` currently becomes `/mnt/c/C:/Users/me/AppData/Local/Temp/start-tf.sh`, which does not exist. The conversion must also support non-C drives and spaces in user profile paths.

## Fix Focus Areas
- start.ps1[91-93]

ⓘ 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 group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread start.ps1
'@
$scriptPath = "$env:TEMP\start-tf.sh"
[System.IO.File]::WriteAllText($scriptPath, $wslScript, [System.Text.UTF8Encoding]::new($false))
Start-Process wsl -ArgumentList "-d Ubuntu -- bash -c 'bash /mnt/c/$($env:TEMP -replace '\\','/')/start-tf.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. Invalid wsl temp path 🐞 Bug ≡ Correctness

The launcher prepends /mnt/c/ to the complete Windows %TEMP% value, turning a normal path such
as C:\Users\me\AppData\Local\Temp into the nonexistent
/mnt/c/C:/Users/me/AppData/Local/Temp/start-tf.sh; other drives and paths containing spaces fail
as well. Consequently, Bash cannot find the generated script and TrueForge does not launch.
Agent Prompt
## Issue description
The generated script is written to an absolute Windows `%TEMP%` path, but the launch command incorrectly creates its Linux path by prepending `/mnt/c/` to that complete Windows path. Convert the exact `$scriptPath` through WSL's `wslpath` and quote the resulting Linux path safely when invoking Bash.

## Issue Context
For example, `C:\Users\me\AppData\Local\Temp\start-tf.sh` currently becomes `/mnt/c/C:/Users/me/AppData/Local/Temp/start-tf.sh`, which does not exist. The conversion must also support non-C drives and spaces in user profile paths.

## Fix Focus Areas
- start.ps1[91-93]

ⓘ 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:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant