[PR #1195] [CLOSED] serve: a POST /settings body without "defaults" must not clear every … #3301

Closed
opened 2026-11-07 14:40:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1195
Author: @elanonimo832
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/settings-absent-defaults-rebased


📝 Commits (1)

  • 3d4c625 serve: a POST /settings body without "defaults" must not clear every setting

📊 Changes

2 files changed (+17 additions, -1 deletions)

View changed files

📝 serve/server.py (+6 -1)
📝 serve/test_server.py (+11 -0)

📄 Description

…setting

req.get("defaults") returns None both when the key is absent and when it is explicitly null, and set_shared documents None as "clients use their own settings again". A body the endpoint does not recognise therefore cleared every shared setting and deleted strata-.shared-settings.json, answering 200 OK with no error. The natural mistake is the one this fixes: POST {"max_tokens": 9000} without the "defaults" wrapper the web app always sends.

Require the key and answer 400 when it is missing; {"defaults": null} still clears them, as documented. serve/web/app.js:1010 already sends the right shape, so the web app is unaffected.

Test: SharedSettings.test_a_body_without_the_defaults_wrapper_is_rejected. It fails with "200 != 400" before the change and passes after; the other 6 tests of that class still pass. The 268-test serve suite is unchanged (its single failure in test_responses/test_json_schema_text_format is pre-existing: it fails the same way without this change).

Rebased onto the new main after the history cleanup. Replaces #1031.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1195 **Author:** [@elanonimo832](https://github.com/elanonimo832) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/settings-absent-defaults-rebased` --- ### 📝 Commits (1) - [`3d4c625`](https://github.com/Niko1221/Strata/commit/3d4c625e3dadd25d8bb7fe4aeb388dff93a134e3) serve: a POST /settings body without "defaults" must not clear every setting ### 📊 Changes **2 files changed** (+17 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `serve/server.py` (+6 -1) 📝 `serve/test_server.py` (+11 -0) </details> ### 📄 Description …setting req.get("defaults") returns None both when the key is absent and when it is explicitly null, and set_shared documents None as "clients use their own settings again". A body the endpoint does not recognise therefore cleared every shared setting and deleted strata-<model>.shared-settings.json, answering 200 OK with no error. The natural mistake is the one this fixes: POST {"max_tokens": 9000} without the "defaults" wrapper the web app always sends. Require the key and answer 400 when it is missing; {"defaults": null} still clears them, as documented. serve/web/app.js:1010 already sends the right shape, so the web app is unaffected. Test: SharedSettings.test_a_body_without_the_defaults_wrapper_is_rejected. It fails with "200 != 400" before the change and passes after; the other 6 tests of that class still pass. The 268-test serve suite is unchanged (its single failure in test_responses/test_json_schema_text_format is pre-existing: it fails the same way without this change). Rebased onto the new `main` after the history cleanup. Replaces #1031. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:40:28 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3301
No description provided.