<span id="根式与工作区式更新差异"></span>

# Root and workspace update differences

Switching paths alone does not switch management protocols. Confirm fields, enums, empty values, success codes, and response envelopes separately before calling.

| Item | Root API | Workspace API |
| --- | --- | --- |
| Backend type | String; invalid/omitted values on creation use OPENAI. | Numeric 0–6; invalid values rejected, omission uses 0. |
| Provider key on creation | OPENAI/QIANWEN/DOUBAO require nonempty values. | The selected creation owner does not universally require a nonempty key. Saving does not establish invocability. |
| Update name/key/timeout | Only nonempty/positive values apply; empty values retain existing values. | Similar nonempty/positive rules; the key field is api_key_encrypted. |
| Update models | Omission/null/[] retain values; a nonempty array replaces them. | Omission/null retain values; [] clears them; a nonempty array replaces them. |
| Reset reasoning to NONE | Nonempty protocol string | Optional numeric 0; omission/null retain the value. |
| Provenance fields | Not used | LLM only. Empty origin_ref/version clears them; empty provider_origin is rejected. |
| Endpoint status | ONLINE/OFFLINE; invalid/omitted values use ONLINE. | 0/1; invalid values rejected, omission/null use 0. |
| Router strategy | Invalid/omitted values use ROUND_ROBIN. | Invalid values rejected; omission uses 0. |
| Router interval | Nonpositive values use 30 | Nonpositive values use 30. |
| Router LLM retries | Nonpositive values use 0 | Zero/omission stay 0; negative values use 2. |
| Router Embedding retries | Nonpositive values use 2 | Nonpositive values use 2. |
| Router affinity | Omission/null overwrite with false | Omission/null overwrite with false. |

An empty array in root update does not clear the value. Although workspace HTTP supports clearing, current dedicated Go/Python clients and their CLI lose empty arrays during repeated-field serialization. A parameter type does not establish that the client can express every valid HTTP input. See [Models and Provider Backends](../../../../../developer/cli/tasks/model-provider-backend.md).

Workspace object fields type=0, status=0, reasoning=0, strategy=0, false, and empty arrays may be omitted from HTTP responses; top-level success code=0 is retained. CLI JSON also omits zero values under its own serialization. Check object IDs, defaults, and field presence rather than treating every missing key as unknown or failure.
