You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(settings-ui): unblock tool list rendering + always-emit settings_url
Two regressions surfaced while testing PR #1381 against Claude Desktop.
1. Settings page stuck on "Loading...".
stopSidecar()'s JS confirm() prompt used a single-quoted string
'Stop the settings server?\n\n' inside the Python triple-quoted
_SETTINGS_HTML. Python consumed the \n\n as literal newlines, so
the rendered <script> contained a JS string spanning two physical
lines — an unrecoverable SyntaxError that aborted the entire
script before loadTools() could run. The in-page error handler
(window.addEventListener('error', ...)) cannot catch parse-time
errors, so the user saw only the initial "Loading..." indicator
with no diagnostic. Escape the backslashes in the Python source
so the JS engine sees the intended \n\n escape sequence.
2. settings_url invisible to fields=-projecting callers.
An LLM that minimized payload via fields=["system_info"] (or any
narrow projection) would lose the settings_url field, since the
projection ran *after* settings_url was added to the result. With
the field absent the LLM cannot hand the URL to the user even
when it knows the user is asking for it. Move the settings_url
emission to *after* project_fields so it survives every
projection, and surface it in the main tool docstring (which
LLMs read first) instead of relying on the fields= enum
description that less-attentive LLMs may skip.
Regression tests:
- test_rendered_script_parses_as_javascript shells out to
`node --check` against the rendered <script> body so any future
raw-newline-in-JS-string regression fails fast with a precise
parser diagnostic. Skipped when node is not on PATH (the test
matrix installs node already).
- test_settings_url_survives_fields_projection pins the new
always-emit-regardless-of-projection contract.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments