Skip to content

Serve /settings/model-api from the settings shell - #3467

Merged
Birfy merged 1 commit into
mainfrom
dev/3466-settings-model-api-route
Nov 30, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3466-settings-model-api-route

Conversation

@Birfy

@Birfy Birfy commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

What

GET /settings/model-api returned 404 "Not found" even though the settings client
treats that URL as a real route. This adds the path to the server allow-list in
flybot_workspace/settings_page.py and extends the subpage enumeration test with it.

Three places already assumed the URL works:

  • flybot_workspace/static/settings/app.mjs:114 — PATH_VIEWS maps /settings/model-api
    to the model-api view.
  • tests/settings_page.test.mjs:147 — asserts
    settingsViewFromLocation('/settings/model-api', '#video-api') === 'model-api'.
  • flybot_workspace/static/chat/index.html:529,551,579,609,641 — five anchors link to
    /settings/model-api (#image-api, #video-api, #music-api, #model3d-api).

The allow-list, meanwhile, carried the removed section /settings/message-folding
(back-compat, pinned by tests/test_settings_page.py:361) but not the live one.

Change

File Change
flybot_workspace/settings_page.py +1 line: '/settings/model-api': ('settings', 'index.html', 'text/html; charset=utf-8')
tests/test_settings_page.py test_recorded_subpages_serve_the_same_settings_shell now enumerates /settings/model-api too (+2/−1)

Two files, +3/−1. No client code, no markup, no docs/inventory/visible-controls.json
change (no HTML line moves).

Verification (local readings, not CI)

  • python -m unittest tests.test_settings_page → 21 tests OK (8.0s).
  • tests.test_settings_page tests.test_visible_inventory → 23 tests OK (9.4s).
  • Negative control: with only the allow-list line reverted, the extended test fails
    with AssertionError: 404 != 200 : /settings/model-api; with it, the module is green.
  • Live server on this tree (fresh 0700 data dir, --insecure-local --open-registration,
    run then stopped and deleted): GET /settings/model-api → 200, 84,444 B,
    Cache-Control: no-store, body carries id="settings-index" and
    data-settings-page="model-api"; GET /settings/message-folding still 200 with the hub
    (no data-settings-page="message-folding"); GET /settings/missing still 404.
  • Round trip: git apply of slice.patch (sha256 c4a09071…) on a clean 0d18af72
    tree yields tree 38e7a812de5d44a479a75c34000949ca1deadde6, identical to the commit
    tree; blobs 11954654 (settings_page.py) and 23eb5535 (test).

Out of scope

  • /settings/message-folding back-compat route and its assertion are untouched.
  • The five chat anchors above are still hidden and nothing in the repo unhides them;
    the live "configure model" link is built at runtime in static/chat/app.mjs:3444
    with /settings#model-api. Cleaning up the dead markup is a separate slice.
  • Browser-level evidence: this machine has no Playwright/Chromium, so the check is HTTP
    and suite level only.

Related #3466

The settings client routes /settings/model-api to the model-api view
(static/settings/app.mjs PATH_VIEWS) and tests/settings_page.test.mjs
asserts that mapping, but the server allow-list in settings_page.py did
not carry the path, so a hard navigation returned 404 "Not found" while
the removed section /settings/message-folding is still served for
back-compat.

Add the route to the allow-list and extend the subpage enumeration test
with it, so every routed URL keeps a served page.

Related #3466
@github-actions github-actions Bot added the risk:T2 Risk tier T2 (host/plugin code or an unnamed path), set by the controller from the diff label Nov 30, 2026
@Birfy

Birfy commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

Lead review record

Reviewed exact head 7b3f3272871c424625997e71aade3cbbf9c8763e (parent 0d18af72ce8f478be473b16533df4e807ee3222b, tree 38e7a812de5d44a479a75c34000949ca1deadde6). Any new commit voids this record.

Object graph rebuilt on my side: codeload of 0d18af72 → content tree 30086b49, git apply of the slice (sha256 c4a09071ccece6def9279a14048abf5db5310ac77ac7d237adcb5f47938384fe), git write-tree → 38e7a812…, equal to the commit tree. Blobs match the author's report byte for byte: flybot_workspace/settings_page.py 11954654be5e1e179123f8e32c31cdcf191ccee3 (30,319 B), tests/test_settings_page.py 23eb55354b72bbe462cf43613e2cc8a54ad946c8 (30,042 B). 2 files, +3/−1, nothing outside those two paths.

One reviewable slice: the server allow-list gains /settings/model-api, and the subpage enumeration test grows from 8 entries to 9. The gap is server-side only — the shipped shell already carries data-settings-page="model-api" and static/settings/app.mjs already maps the URL to the model-api view — so the fix lands at the layer that was missing and the client contract does not move. The extended test guards the status code, which is what was broken; it does not assert the view.

Deliberately untouched (checked in the diff): the /settings/message-folding back-compat route and its three assertions (tests/test_settings_page.py:303, :324, :362-365); no HTML changes, so docs/inventory/visible-controls.json needs no regeneration; the five hidden chat anchors stay as they are and remain #405's scope.

QA testimony for this head (QA Engineer's own reading, not mine): single parent 0d18af72, tree re-derived with git write-tree as 38e7a812; tests.test_settings_page + tests.test_visible_inventory → 23/23 OK (9.6s); negative control with only the allow-list line removed → AssertionError: 404 != 200 : /settings/model-api, green once restored; live servers on both trees — base 0d18af72 returns 404 for /settings/model-api, head returns 200 (84,444 B, Cache-Control: no-store, id="settings-index", one data-settings-page="model-api"), /settings/message-folding still 200 hub, /settings/missing still 404.

My own local check: the two-file slice reproduces both blobs and the tree on a clean 0d18af72; I did not re-run the Python module myself, so the 23/23 figure above is QA's.

CI (read directly from the check-runs of this head): total_count 18, 18 runs returned, all completed / success. risk-gate applied risk:T2.

No parity or acceptance claim. Enqueuing to the merge queue against this head.

@Birfy
Birfy added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 89e163e Nov 30, 2026
18 checks passed
@Birfy
Birfy deleted the dev/3466-settings-model-api-route branch November 30, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T2 Risk tier T2 (host/plugin code or an unnamed path), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant