mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-07-22 22:26:06 +00:00
|
Some checks are pending
Development Build / extract-version (push) Waiting to run
Development Build / build-regular (push) Blocked by required conditions
Development Build / build-single (push) Blocked by required conditions
Development Build / summary (push) Blocked by required conditions
Tests / Backend Tests (push) Waiting to run
Tests / Frontend Tests (push) Waiting to run
* fix(credentials): persist Ollama num_ctx via a flexible config object The `credential` table is SCHEMAFULL, so the model's `num_ctx` field was silently dropped on write and the override never took effect (#875). Rather than add a typed column per provider option, add a single flexible `config` object to the credential table (migration 15). Provider-specific tuning options (currently `num_ctx`) are still exposed as top-level fields on the Credential model and on the API, but are packed into `config` on save and lifted back out on load via a before-validator. Future options only need a Pydantic field + an entry in CONFIG_EXTRAS — no further migrations. - migration 15 (+ down): DEFINE FIELD config ON credential FLEXIBLE TYPE option<object> - Credential: CONFIG_EXTRAS set, _lift_config before-validator, config packing in _prepare_save_data - tests covering pack/unpack round-trip and the empty-config case * fix(credentials): preserve unmapped config keys on save Address cubic review on #903: - `config` is now a real model field mirroring the credential table's FLEXIBLE object and is the on-disk source of truth. `num_ctx` remains a convenience field mirrored from/to config. On save we start from the existing bag and sync the convenience fields in, so a save never clobbers config keys written by a newer version (repo_update uses MERGE, which replaces the whole object). config is only written as None when the merged result is genuinely empty. (The previous approach relied on Pydantic extras, which ObjectModel's default extra="ignore" silently dropped.) - Update database/CLAUDE.md migration totals (15 up/down, incl. migration 15). - Add tests for unmapped-key preservation and clearing num_ctx while keeping other config keys. * fix(credentials): validate config-mirrored extras via Pydantic Address cubic re-review on #903: mirror known config keys (num_ctx) onto their convenience fields in a `before` model validator so they go through normal Pydantic field validation/coercion, instead of an `after`-validator object.__setattr__ that bypassed type checks. Adds a test asserting num_ctx is coerced to int and a non-coercible value is rejected. |
||
|---|---|---|
| .. | ||
| migrations | ||
| async_migrate.py | ||
| CLAUDE.md | ||
| migrate.py | ||
| repository.py | ||