# 2026-06-10 (cont.) — Windows bridge installer SyntaxError fix

## Round 2: bridge started but immediately died

After fixing the `manual-start.ps1` 404, Larry ran the command and the bridge *did* start — but the embedded `windows-bridge.py` had a syntax error on its first request:

```
status = {aid: {"installed": (_check_cli(aid)[0]), **_check_cli(aid)[1] and {"path": _check_cli(aid)[1]} or {}, **AGENTS[aid]} for aid in AGENTS}
SyntaxError: invalid syntax
```

The `**expr and {...} or {}` pattern inside a dict-comp doesn't parse in any Python. The standalone `static-bridge/windows-bridge.py` was already correct (uses explicit for-loop), but `installer.ps1` still embedded the broken version — meaning the installer was **actively re-installing a broken bridge** every time it ran.

## Fix

Patched the heredoc in `installer.ps1` to use the same explicit for-loop as the standalone file. Verified by extracting the heredoc and running `ast.parse()`: parses clean. Committed as `be8311e`.

## Why this slipped through

- The installer has been "working" in the sense that it writes a file and the scheduled task starts it. The bridge only crashes when the *first HTTP request* hits `/health`, which the test in step 6/6 may or may not actually exercise visibly.
- Caddy serves installer.ps1 from the same route I patched in 3995a43, so no separate restart needed.
- installer.ps1 isn't immutable (only server.py and index.html are), so the edit was direct.

## Action for Larry

Re-run the installer in PowerShell to overwrite the broken bridge on his Windows box:

```powershell
$env:SEE_OUTPUT = "1"
irm https://dashboard.aisetuppros.com/bridge/installer.ps1 | iex
```

Then verify the bridge works: `Invoke-RestMethod http://127.0.0.1:8766/health` should return JSON with the 3 agents.

## Doc

- `/root/agent-dashboard/docs/hermes/2026-06-10_installer-bridge-syntax-fix.md`

## Lesson

Two sources of truth for the same Python file (standalone + installer-embedded) = silent drift. Need either (a) the installer to fetch the file from /bridge/windows-bridge.py at install time, or (b) a CI/pre-commit check that extracts the heredoc and `ast.parse()`s it. Going to add the check next session.
