Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MissionControl — Autonomous DevOps Incident Response Agent
# MissionControl — Autonomous DevOps Incident Response Agent

> **Hackathon submission** — WeMakeDevs "The Agent Harness" (Double-O track, TrueFoundry sponsor)

Expand Down Expand Up @@ -105,7 +105,7 @@ python scripts/trigger_incident.py api-gateway outage "gateway down"
## TrueForge Agent Setup

1. Start TrueForge: `npx @truefoundry/trueforge` (in a separate terminal)
2. Open `http://localhost:3000`
2. Open `http://localhost:8790`
3. **Add model provider** → paste your `OPENAI_API_KEY`
4. **Add MCP server** → URL: `http://localhost:8000/mcp` (name: `demo-infra`)
5. **Create agent** named `missioncontrol`:
Expand Down Expand Up @@ -139,8 +139,8 @@ python scripts/trigger_incident.py api-gateway outage "gateway down"
| Variable | Default | Description |
|----------|---------|-------------|
| `OPENAI_API_KEY` | *required* | OpenAI API key for TrueForge |
| `TRUEFORGE_URL` | `http://localhost:3000` | TrueForge UI URL |
| `NEXT_PUBLIC_TRUEFORGE_URL` | `http://localhost:3000` | Browser-side TrueForge URL |
| `TRUEFORGE_URL` | `http://localhost:8790` | TrueForge UI URL |
| `NEXT_PUBLIC_TRUEFORGE_URL` | `http://localhost:8790` | Browser-side TrueForge URL |
| `MCP_ENDPOINT` | `http://localhost:8000/mcp` | MCP streamable-HTTP endpoint |
| `DEMO_INFRA_API_URL` | `http://localhost:8001` | REST sidecar URL |
| `DEMO_INFRA_TOKEN` | `local-demo-token` | Shared token for mutating POSTs |
Expand All @@ -165,7 +165,7 @@ npm run build

## Security Notes

- **CORS**: Restricted to `localhost:3000/3001` only
- **CORS**: Restricted to `localhost:8790/3001` only
- **Mutation auth**: All state-mutating POSTs require `Authorization: Bearer <DEMO_INFRA_TOKEN>`
- **Default token**: `local-demo-token` (override via `DEMO_INFRA_TOKEN` in `.env`)
- **MCP approval**: Agent tools `rollback_deploy` / `restart_service` require TrueForge human approval
Expand Down
4 changes: 2 additions & 2 deletions Submissions List/01-PUBLIC-REPOSITORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ chmod +x scripts/setup.sh
# 5. Start TrueForge (in a separate terminal / WSL)
npx @truefoundry/trueforge

# 6. In TrueForge UI (http://localhost:3000):
# 6. In TrueForge UI (http://localhost:8790):
# a. Connect your model provider (OpenAI key from .env)
# b. Add an MCP server -> URL: http://localhost:8000/mcp
# c. Create an agent named 'missioncontrol'
Expand Down Expand Up @@ -368,7 +368,7 @@ pkill -f trueforge

| Port | Service |
|---|---|
| 3000 | TrueForge UI |
| 8790 | TrueForge UI |
| 3001 | MissionControl Dashboard |
| 4000 | LiteLLM proxy |
| 5432 | PostgreSQL |
Expand Down
4 changes: 2 additions & 2 deletions Submissions List/03-PROJECT-WRITEUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ TrueForge is the agent harness that:
- Runs the AI agent (GPT-4o-mini)
- Manages MCP server connections
- Handles human-in-the-loop approval
- Provides the agent UI at `http://localhost:3000`
- Provides the agent UI at `http://localhost:8790`

**How we use it:**
- Agent system prompt defines MissionControl's personality and rules
Expand Down Expand Up @@ -222,7 +222,7 @@ WSL launchers (`scripts/wsl/start-trueforge.sh`, `scripts/wsl/start-litellm.sh`)
| Agent Runtime | Runs GPT-4o-mini with our system prompt and skill |
| MCP Server Connection | Connects to our FastMCP server at `http://localhost:8000/mcp` |
| Approval Mechanism | Requires human approval before `rollback_deploy` / `restart_service` |
| Agent UI | Provides `http://localhost:3000` for agent interaction |
| Agent UI | Provides `http://localhost:8790` for agent interaction |
| Skill System | Loads `incident-response/SKILL.md` for specialized behavior |
| System Prompt | Loads `agent/system-prompt.md` for personality and rules |

Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/app/api/webhook/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function POST(request: NextRequest) {
const baseUrl =
process.env.TRUEFORGE_URL ||
process.env.NEXT_PUBLIC_TRUEFORGE_URL ||
'http://localhost:3000'
'http://localhost:8790'
const token = process.env.TRUEFORGE_API_KEY

const client = new TrueForge({
Expand Down Expand Up @@ -63,7 +63,7 @@ Alert type: ${alert_type}`
return NextResponse.json(
{
error: 'Failed to trigger incident response',
hint: `Is TrueForge running at ${process.env.TRUEFORGE_URL || process.env.NEXT_PUBLIC_TRUEFORGE_URL || 'http://localhost:3000'} with an agent named "missioncontrol"?`,
hint: `Is TrueForge running at ${process.env.TRUEFORGE_URL || process.env.NEXT_PUBLIC_TRUEFORGE_URL || 'http://localhost:8790'} with an agent named "missioncontrol"?`,
details: String(error),
},
{ status: 502 }
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/components/agent-chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const TrueforgeUI = dynamic(() => import('@truefoundry/trueforge-ui').then((m) =
export function AgentChat({ sessionId }: { sessionId?: string }) {
const [error, setError] = useState<string | null>(null)

const baseUrl = process.env.NEXT_PUBLIC_TRUEFORGE_URL || 'http://localhost:3000'
const baseUrl = process.env.NEXT_PUBLIC_TRUEFORGE_URL || 'http://localhost:8790'
const token = process.env.NEXT_PUBLIC_TRUEFORGE_TOKEN

if (error) {
Expand Down
4 changes: 2 additions & 2 deletions mcp-servers/demo-infra/http_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def _authorized(headers: Any, client_addr: str) -> bool:
# Browser traffic reaches this API only via the Next.js server-side proxy,
# so CORS is a convenience for local debugging, not an authorization layer.
CORS_ALLOWED_ORIGINS = {
"http://localhost:3000",
"http://localhost:8790",
"http://localhost:3001",
"http://127.0.0.1:3000",
"http://127.0.0.1:8790",
"http://127.0.0.1:3001",
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Write-Host " Run in a separate terminal:" -ForegroundColor Cyan
Write-Host ""
Write-Host " npx @truefoundry/trueforge" -ForegroundColor White
Write-Host ""
Write-Host " Then in the TrueForge UI (http://localhost:3000):"
Write-Host " Then in the TrueForge UI (http://localhost:8790):"
Write-Host " a. Connect your model provider (OpenAI key from .env)"
Write-Host " b. Add an MCP server -> URL: http://localhost:8000/mcp"
Write-Host " c. Create an agent named 'missioncontrol' using agent/system-prompt.md"
Expand All @@ -96,7 +96,7 @@ Write-Host "=========================================" -ForegroundColor Cyan
Write-Host " MissionControl is ready!"
Write-Host "========================================="
Write-Host ""
Write-Host " TrueForge UI: http://localhost:3000 (after 'npx @truefoundry/trueforge')"
Write-Host " TrueForge UI: http://localhost:8790 (after 'npx @truefoundry/trueforge')"
Write-Host " Dashboard: http://localhost:3001"
Write-Host " MCP endpoint: http://localhost:8000/mcp"
Write-Host " REST API: http://localhost:8001"
10 changes: 5 additions & 5 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo ""

echo "[1/6] Checking prerequisites..."
command -v docker >/dev/null 2>&1 || { echo "Error: docker is required. Install Docker Desktop."; exit 1; }
if command -v node >/dev/null 2>&1; then echo " - Node: $(node --version)"; else echo "Error: node 18+ is required."; exit 1; fi
if command -v node >/dev/null 2>&1; then echo " - Node: $(node --version)"; else echo "Error: node 22+ is required."; exit 1; fi

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 prerequisite check only tests whether node exists, despite requiring Node 22+ in its error message and installing a runtime that depends on that version. Node 20 or older passes this check and setup proceeds until a later build or TrueForge invocation fails. Parse node --version and reject versions below 22 at the prerequisite boundary. [incorrect condition logic]

Severity Level: Major ⚠️
- ⚠️ Unsupported Node versions pass prerequisite validation.
- ❌ TrueForge startup may fail after setup work completes.
- ⚠️ Users receive delayed runtime errors instead of actionable validation.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

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

**Path:** scripts/setup.sh
**Line:** 13:13
**Comment:**
	*Incorrect Condition Logic: The prerequisite check only tests whether `node` exists, despite requiring Node 22+ in its error message and installing a runtime that depends on that version. Node 20 or older passes this check and setup proceeds until a later build or TrueForge invocation fails. Parse `node --version` and reject versions below 22 at the prerequisite boundary.

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

PYTHON_BIN="$(command -v python3 || command -v python)"
[ -n "$PYTHON_BIN" ] || { echo "Error: python 3.10+ is required."; exit 1; }
echo " - Python: $($PYTHON_BIN --version)"
Expand Down Expand Up @@ -64,17 +64,17 @@ echo ""

echo "[5/6] Building and starting the dashboard (background)..."
(cd apps/dashboard && npm run build)
(cd apps/dashboard && nohup npm run dev >/tmp/missioncontrol-dashboard.log 2>&1 &)
(cd apps/dashboard && NEXT_PUBLIC_TRUEFORGE_URL="http://localhost:8790" TRUEFORGE_URL="http://localhost:8790" nohup npm run dev >/tmp/missioncontrol-dashboard.log 2>&1 &)
sleep 5
echo " Dashboard built and starting on http://localhost:3001 (log: /tmp/missioncontrol-dashboard.log)"
echo ""

echo "[6/6] Starting TrueForge agent runtime..."
if command -v npx >/dev/null 2>&1; then
echo " Starting TrueForge in background..."
nohup npx @truefoundry/trueforge >/tmp/missioncontrol-trueforge.log 2>&1 &
nohup npx -y @truefoundry/trueforge >/tmp/missioncontrol-trueforge.log 2>&1 &

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: This direct startup path does not source .env or export its variables before invoking TrueForge. The setup script creates .env and documents OPENAI_API_KEY there, but the child process inherits only the shell environment, so a key configured in .env is invisible to TrueForge and the command can appear to start while model authentication fails. Source .env or start the repository launcher that already loads it. [incomplete implementation]

Severity Level: Major ⚠️
- ❌ Linux/macOS setup loses configured TrueForge credentials.
- ⚠️ TrueForge starts but model requests fail authentication.
- ⚠️ Users must manually export credentials or configure them again.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

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

**Path:** scripts/setup.sh
**Line:** 75:75
**Comment:**
	*Incomplete Implementation: This direct startup path does not source `.env` or export its variables before invoking TrueForge. The setup script creates `.env` and documents `OPENAI_API_KEY` there, but the child process inherits only the shell environment, so a key configured in `.env` is invisible to TrueForge and the command can appear to start while model authentication fails. Source `.env` or start the repository launcher that already loads it.

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

sleep 3
echo " TrueForge starting on http://localhost:3000 (log: /tmp/missioncontrol-trueforge.log)"
echo " TrueForge starting on http://localhost:8790 (log: /tmp/missioncontrol-trueforge.log)"
else
echo " npx not found - run 'npx @truefoundry/trueforge' manually"
fi
Expand All @@ -84,7 +84,7 @@ echo "========================================="
echo " MissionControl is ready!"
echo "========================================="
echo ""
echo " TrueForge UI: http://localhost:3000 (after 'npx @truefoundry/trueforge')"
echo " TrueForge UI: http://localhost:8790 (after 'npx @truefoundry/trueforge')"
echo " Dashboard: http://localhost:3001"
echo " MCP endpoint: http://localhost:8000/mcp"
echo " REST API: http://localhost:8001"
Expand Down
16 changes: 8 additions & 8 deletions scripts/start-all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ if ($out -eq "200") { Write-Host " LiteLLM: UP" -ForegroundColor Green }
else { Write-Host " LiteLLM: FAILED to start (check WSL ~/litellm.log)" -ForegroundColor Red }

# ---------------------------------------------------------------- [4/8]
Write-Host "[4/8] Starting TrueForge (WSL :3000)..."
Write-Host "[4/8] Starting TrueForge (WSL :8790)..."
$out = ""
try { $out = (wsl -e bash -lc "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3000 --max-time 4") } catch { $out = "000" }
try { $out = (wsl -e bash -lc "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8790 --max-time 4") } catch { $out = "000" }
if ($out -ne "200") {
wsl -e bash -lc "setsid -f -- bash '$tfRunScript' </dev/null > $tfLog 2>&1"
$up = $false
foreach ($i in 1..24) {
Start-Sleep -Seconds 5
$out = wsl -e bash -lc "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3000 --max-time 4"
$out = wsl -e bash -lc "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8790 --max-time 4"
if ($out -eq "200") { $up = $true; break }
}
if (-not $up) { Write-Host " TrueForge: FAILED (check WSL ~/tf.log)" -ForegroundColor Red }
}
$out = wsl -e bash -lc "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:3000 --max-time 4"
$out = wsl -e bash -lc "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8790 --max-time 4"
if ($out -eq "200") { Write-Host " TrueForge: UP" -ForegroundColor Green }

# ---------------------------------------------------------------- [5/8]
Expand All @@ -94,15 +94,15 @@ if ($conn) {
# ---------------------------------------------------------------- [6/8]
Write-Host "[6/8] Keeping TrueForge MCP registration pointed at this machine..."
try {
$mcp = Invoke-RestMethod "http://${wslIp}:3000/api/v1/settings/mcp-servers" -TimeoutSec 10
$mcp = Invoke-RestMethod "http://${wslIp}:8790/api/v1/settings/mcp-servers" -TimeoutSec 10
$current = ($mcp | ConvertTo-Json -Depth 6)
$want = "http://${gw}:8000/mcp"
if ($current -notmatch [regex]::Escape($want)) {
$body = @{ manifest = @{
type = "remote"; name = "demo-infra"; url = $want
description = "Simulated production infra: 4 services with metrics, logs, deploys, chaos injection and approval-gated rollback/restart tools."
} } | ConvertTo-Json -Depth 6
Invoke-RestMethod -Method Put -Uri "http://${wslIp}:3000/api/v1/settings/mcp-servers" `
Invoke-RestMethod -Method Put -Uri "http://${wslIp}:8790/api/v1/settings/mcp-servers" `
-ContentType "application/json" -Body $body -TimeoutSec 15 | Out-Null
Write-Host " MCP registration updated -> $want" -ForegroundColor Yellow
} else {
Expand All @@ -127,7 +127,7 @@ if (Test-Path $envFile) {
# when a variable is missing. The replacement loop emits only the new
# value so stale lines are replaced, never duplicated.
foreach ($key in @("TRUEFORGE_URL", "NEXT_PUBLIC_TRUEFORGE_URL")) {
$newVal = "${key}=http://${wslIp}:3000"
$newVal = "${key}=http://${wslIp}:8790"

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 new per-key value check does not make the subsequent ^${key}= match multiline. When either variable exists below the first line of .env.local, the script fails to detect it, appends a second assignment, and leaves duplicate values that different consumers may resolve differently. Use a multiline-aware match or inspect the split lines consistently before appending. [api mismatch]

Severity Level: Major ⚠️
- ⚠️ Dashboard environment file retains conflicting TrueForge URLs.
- ⚠️ Restarted dashboard configuration may resolve stale endpoint values.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

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

**Path:** scripts/start-all.ps1
**Line:** 130:130
**Comment:**
	*Api Mismatch: The new per-key value check does not make the subsequent `^${key}=` match multiline. When either variable exists below the first line of `.env.local`, the script fails to detect it, appends a second assignment, and leaves duplicate values that different consumers may resolve differently. Use a multiline-aware match or inspect the split lines consistently before appending.

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

if ($newTxt -notmatch [regex]::Escape($newVal)) {
if ($newTxt -match "^${key}=") {
$newTxt = (($newTxt -split "`r?`n") | ForEach-Object {
Expand Down Expand Up @@ -179,7 +179,7 @@ try {

Write-Host ""
Write-Host "=== READY ===" -ForegroundColor Cyan
$tfUrl = "http://${wslIp}:3000"
$tfUrl = "http://${wslIp}:8790"
Write-Host " Dashboard : http://localhost:3001"
Write-Host " TrueForge UI : ${tfUrl}"
Write-Host " MCP endpoint : http://localhost:8000/mcp"
Expand Down
2 changes: 1 addition & 1 deletion scripts/wsl/start-trueforge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ fi

cd "$HOME"
export HOST=0.0.0.0
exec npx -y @truefoundry/trueforge --port 3000
exec npx -y @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 WSL setup installs @truefoundry/trueforge globally, but npx -y resolves the package through the npm package resolver rather than explicitly invoking that installed global binary. Consequently, startup still requires registry access and may select a different version or fail offline even after the prerequisite installation succeeded. Invoke the installed package/binary directly or make the network-dependent installation an explicit prerequisite. [api mismatch]

Severity Level: Major ⚠️
- ❌ Offline WSL startup can fail despite successful installation.
- ❌ TrueForge remains unavailable on port 8790.
- ⚠️ Dashboard agent interactions cannot reach the runtime.

Use CodeAnt Skill Fix in Cursor Fix in VSCode Claude

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

**Path:** scripts/wsl/start-trueforge.sh
**Line:** 30:30
**Comment:**
	*Api Mismatch: The WSL setup installs `@truefoundry/trueforge` globally, but `npx -y` resolves the package through the npm package resolver rather than explicitly invoking that installed global binary. Consequently, startup still requires registry access and may select a different version or fail offline even after the prerequisite installation succeeded. Invoke the installed package/binary directly or make the network-dependent installation an explicit prerequisite.

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

54 changes: 25 additions & 29 deletions start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Write-Host "========================================="
Write-Host ""

# Step 1: Check Docker
Write-Host "[1/6] Checking Docker..." -ForegroundColor Yellow
Write-Host "[1/7] Checking Docker..." -ForegroundColor Yellow
try {
docker info > $null 2>&1
if ($LASTEXITCODE -ne 0) { throw }
Expand All @@ -24,12 +24,12 @@ try {
}

# Step 2: Start containers
Write-Host "[2/6] Starting containers..." -ForegroundColor Yellow
Write-Host "[2/7] Starting containers..." -ForegroundColor Yellow
docker compose up -d --build 2>&1 | Out-Null
Write-Host " PostgreSQL, Redis, MCP server started" -ForegroundColor Green

# Step 3: Wait for health
Write-Host "[3/6] Waiting for MCP server..." -ForegroundColor Yellow
Write-Host "[3/7] Waiting for MCP server..." -ForegroundColor Yellow
$retries = 0
while ($retries -lt 15) {
try {
Expand All @@ -46,53 +46,49 @@ if ($retries -ge 15) {
}

# Step 4: Start dashboard
Write-Host "[4/6] Starting dashboard..." -ForegroundColor Yellow
Write-Host "[4/7] Starting dashboard..." -ForegroundColor Yellow
$dashboardDir = Join-Path $PSScriptRoot "apps\dashboard"
if (-not (Test-Path "$dashboardDir\node_modules")) {
Push-Location $dashboardDir
npm install --silent 2>&1 | Out-Null
Pop-Location
}
Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd '$dashboardDir'; npm run dev"
Start-Process powershell -ArgumentList "-NoExit", "-Command", "`$env:NEXT_PUBLIC_TRUEFORGE_URL='http://localhost:8790'; `$env:TRUEFORGE_URL='http://localhost:8790'; cd '$dashboardDir'; npm run dev"
Write-Host " Dashboard starting on http://localhost:3001" -ForegroundColor Green

# Step 5: Setup WSL - install Linux-native Node.js
Write-Host "[5/6] Setting up WSL..." -ForegroundColor Yellow
$wslLinuxNode = wsl -d Ubuntu -- bash -c 'test -f /usr/bin/node && echo ok || echo missing'
if ($wslLinuxNode -match "missing") {
Write-Host " Installing Node.js 22 in WSL (first time only)..." -ForegroundColor Yellow
wsl -d Ubuntu -- bash -c 'curl -fsSL https://deb.nodesource.com/setup_22.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
# Step 5: Setup WSL - install Linux-native Node.js 22 locally
Write-Host "[5/7] Setting up WSL..." -ForegroundColor Yellow
$localNode = wsl -d Ubuntu -- bash -c 'if [ -x ~/.local/node/bin/node ]; then ~/.local/node/bin/node -v; fi'
if ($localNode -match "v22") {
Write-Host " WSL Node.js 22 already installed locally"
} else {
Write-Host " WSL Node.js already installed" -ForegroundColor Green
Write-Host " Installing Node.js 22 in WSL (~/.local/node)..."
wsl -d Ubuntu -- bash -c 'mkdir -p ~/.local/node && curl -fsSL https://nodejs.org/dist/v22.14.0/node-v22.14.0-linux-x64.tar.gz | tar -xz -C ~/.local/node --strip-components=1'
Comment on lines +65 to +66

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

5. Arm64 wsl downloads x64 🐞 Bug ☼ Reliability

The Windows setup unconditionally downloads the linux-x64 Node archive, which cannot run in an
ARM64 WSL distribution. On Windows-on-ARM systems, the subsequent npm and TrueForge steps therefore
fail instead of installing the matching ARM64 build.
Agent Prompt
## Issue description
The local Node installer always installs an x64 binary, including in ARM64 WSL.

## Issue Context
Detect `uname -m` inside the selected distro and map supported architectures to the corresponding Node archive, failing clearly for unsupported values.

## Fix Focus Areas
- start.ps1[65-67]

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

}

# Step 6: Install TrueForge in WSL
Write-Host "[6/6] Setting up TrueForge in WSL..." -ForegroundColor Yellow
$wslTf = wsl -d Ubuntu -- bash -c 'command -v trueforge 2>/dev/null || echo missing'
if ($wslTf -match "missing") {
Write-Host " Installing TrueForge in WSL (first time only)..." -ForegroundColor Yellow
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
} else {
Write-Host "[6/7] Setting up TrueForge in WSL..." -ForegroundColor Yellow
$tfInstalled = wsl -d Ubuntu -- bash -c 'export PATH=~/.local/node/bin:"$PATH" && npm list -g @truefoundry/trueforge >/dev/null 2>&1 && echo "yes" || echo "no"'
if ($tfInstalled -match "yes") {
Write-Host " TrueForge already installed in WSL" -ForegroundColor Green
} else {
Write-Host " Installing @truefoundry/trueforge in WSL..."
wsl -d Ubuntu -- bash -c 'export PATH=~/.local/node/bin:"$PATH" && npm install -g @truefoundry/trueforge'
Write-Host " TrueForge installed in WSL" -ForegroundColor Green
}

# Step 7: Start TrueForge
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'"

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. Checkout path is hard-coded 🐞 Bug ≡ Correctness

Step 7 always changes into one developer's /mnt/c/Users/adity/Documents/Mission Control checkout,
so every clone at a different username, drive, or directory fails the cd and never starts
TrueForge. This makes the advertised one-command startup unusable for a normal clean checkout.
Agent Prompt
## Issue description
The TrueForge startup command hard-codes one developer's WSL checkout path, so other clones cannot start.

## Issue Context
Use `$PSScriptRoot` and convert the resulting Windows path with `wslpath`, as the repository's other launcher already does.

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

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

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

2. Setup and launch differ 🐞 Bug ≡ Correctness

Steps 5–6 install Node and TrueForge specifically into the Ubuntu WSL distro, but Step 7 launches
the default distro by omitting -d Ubuntu. When another distro is the default, startup runs where
the installed runtime and package do not exist and TrueForge fails to launch.
Agent Prompt
## Issue description
The installer targets Ubuntu but the launcher targets whichever WSL distro is default.

## Issue Context
Use the same explicit distro for installation, detection, path conversion, and startup, or consistently use the default distro for all steps.

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

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

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 uses a checkout path belonging to one developer instead of deriving the repository location from $PSScriptRoot. On any other machine or clone location, WSL changes into a nonexistent directory and cannot find start-trueforge.sh, so TrueForge never starts. Resolve the Windows repository path dynamically and convert it to a WSL path. [api mismatch]

Severity Level: Critical 🚨
- ❌ TrueForge cannot start from ordinary clone locations.
- ❌ Windows one-click startup fails for other developers.
- ⚠️ Success output incorrectly reports TrueForge as starting.

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:** 82:82
**Comment:**
	*Api Mismatch: The launcher uses a checkout path belonging to one developer instead of deriving the repository location from `$PSScriptRoot`. On any other machine or clone location, WSL changes into a nonexistent directory and cannot find `start-trueforge.sh`, so TrueForge never starts. Resolve the Windows repository path dynamically and convert it to a WSL path.

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

Write-Host " TrueForge starting on http://localhost:8790" -ForegroundColor Green

# Done
Write-Host ""
Write-Host "=========================================" -ForegroundColor Green
Write-Host " Everything is running!" -ForegroundColor Green
Write-Host "=========================================" -ForegroundColor Green
Write-Host ""
Write-Host " Now start TrueForge manually:" -ForegroundColor Cyan
Write-Host " 1. Open a NEW terminal" -ForegroundColor White
Write-Host " 2. Type: wsl" -ForegroundColor White
Write-Host " 3. Type: cd ~" -ForegroundColor White
Write-Host " 4. Type: npx @truefoundry/trueforge" -ForegroundColor White
Write-Host ""
Write-Host " Then in TrueForge UI (http://localhost:3000):" -ForegroundColor Cyan
Write-Host " Then in TrueForge UI (http://localhost:8790):" -ForegroundColor Cyan
Write-Host " 1. Add your OpenAI API key" -ForegroundColor White
Write-Host " 2. Add MCP server -> http://localhost:8000/mcp" -ForegroundColor White
Write-Host " 3. Create agent 'missioncontrol'" -ForegroundColor White
Expand Down