Skip to content

fix(warroom): repair broken LLM-call sites so docs/index.html parses#117

Closed
hoptoad-off wants to merge 1 commit into
elder-plinius:mainfrom
hoptoad-off:fix/warroom-ui-syntax
Closed

fix(warroom): repair broken LLM-call sites so docs/index.html parses#117
hoptoad-off wants to merge 1 commit into
elder-plinius:mainfrom
hoptoad-off:fix/warroom-ui-syntax

Conversation

@hoptoad-off

Copy link
Copy Markdown

What & why

The War Room UI (docs/index.html) ships with syntax errors in its main
<script> block from several bad-merge artifacts. Any one of them is a hard
SyntaxError that discards the entire ~20k-line block, so navigateTo is
never defined and sidebar navigation (Settings, Arsenal, …) does nothing — the
UI is stuck on the War Room page. npm run verify-claims doesn't cover the UI,
so this slipped through.

Changes

  • Merge the two split safeLLMCall definitions into one: keep the complete
    model-fallback loop and restore the backend resolution + keyless
    agent/server branch it referenced but no longer defined.
  • Remove premature/dead fetch and options fragments in _safeLLMCallOnce,
    runBenchmarks, runLLMJudge, generateAnalysis,
    autoApplyRecommendations, runSelfImprovementLoop, the benchmark
    evaluator, and the CTF call — keeping the newer _noFallback /
    llmTimeoutFor variant in each.

Net: +17 / −85 (dead-code removal).

Verification

  • Every <script> block passes a syntax check; bracket balance is even.
  • Headless browser: navigateTo defined (global fn count 93 → 515), all 14
    nav pages switch, Settings renders, no console errors.

Notes

Semantics are preserved to the newer of each duplicated pair; no behavior was
invented. Suggest adding a lightweight UI syntax-check (per <script> block)
to CI so this can't regress.

The War Room UI (docs/index.html) shipped with several bad-merge artifacts
in its main <script> block — duplicate/half-merged safeLLMCall call sites,
two `catch` clauses on one `try`, and duplicate lexical declarations
(`response`, `content`, `autoApplyBtn`). Any one of these is a hard
SyntaxError that discards the entire ~20k-line script block, so `navigateTo`
was never defined and sidebar navigation (Settings, etc.) did nothing.

Fixes:
- Merge the two split `safeLLMCall` definitions into one: keep the complete
  model-fallback loop and restore the `backend` resolution + keyless
  agent/server branch it referenced but no longer defined.
- Drop premature/dead fetch and options fragments in `_safeLLMCallOnce`,
  `runBenchmarks`, `runLLMJudge`, `generateAnalysis`,
  `autoApplyRecommendations`, `runSelfImprovementLoop`, the benchmark
  evaluator, and the CTF call — keeping the newer variant
  (`_noFallback` / `llmTimeoutFor`) in each.

Verified in a headless browser: `navigateTo` is defined, all 14 nav pages
switch, Settings renders, and there are no console errors. All <script>
blocks pass a syntax check and bracket-balance is even.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hoptoad-off

Copy link
Copy Markdown
Author

Closing as a duplicate of #112.

I independently reproduced the same 8 botched-merge syntax scars in docs/index.html and arrived at the same reunified safeLLMCall / _safeLLMCallOnce fix (backend-aware endpoint for OpenRouter and Venice, AbortController kept) — but #112 by @lyubomir-bozhinov got there first, is already reviewed and independently confirmed, and is paired with the #113 CI parse/semantic gate. Deferring to it. I can add that I hit the exact same eight sites and the fix works on Linux, if that's a useful extra data point.

Separately I opened #118 for an unrelated backend bug that #112 doesn't touch: getLLMConfig throwing Unknown provider: local-agent, which aborts every keyless (connected-agent) mission.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant