diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-09 16:13:57 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-09 16:13:57 +0200 |
| commit | f820a3f1d7797640f1a21c04773af119561fb2e0 (patch) | |
| tree | dae2e5f4f7a7211f2767ae9c8a15ef8db6f856c5 /llamachat_venv.py | |
| parent | 379d9211fab61db2da9b34d6f385fc240e00a061 (diff) | |
| download | llamachat-f820a3f1d7797640f1a21c04773af119561fb2e0.tar.gz llamachat-f820a3f1d7797640f1a21c04773af119561fb2e0.zip | |
fix: reject non-finite prices and escape a model named DEFAULT
float() accepts "nan" and "inf", so a hand-edited models.ini could feed
either into the cost arithmetic and render "$nan". Rejected once in _get
rather than at each downstream call site.
A model whose id is literally DEFAULT wrote a [DEFAULT] section, which a
stock configparser reader treats as defaults inherited by every other
model. Since the file is documented for hand-editing, that reintroduces
the contamination the renamed default_section exists to prevent, so the
id is escaped on write and mapped back on read.
Also drops the marker branch in save(), leaving mark_skipped() as the
sole writer of the "marker present iff no real keys" invariant, and
prunes two test blocks that could not fail.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'llamachat_venv.py')
0 files changed, 0 insertions, 0 deletions
