From 9182c84b8ac9d905a9d553b95155a993338568b8 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 31 Jul 2026 11:03:51 +0200 Subject: feat: add context meter and file-based system prompts Two additions to the chat window. A context meter in the top bar shows how much of the active model's window the next request will occupy: system prompt, prior turns, attachments and the current draft. The router does not report a usable context size in router mode (/props returns n_ctx 0), so the limit comes from ctx-size in presets.ini. Streaming requests now ask for usage statistics, which makes the figure exact after each reply at no extra round trip; before that it is an estimate marked with a leading ~. The estimate reads low on models with a reasoning budget, since thinking tokens cannot be known before the reply arrives. The tooltip says so. System prompts are markdown files in the prompts/ directory beside the config, one per file, so they can be edited in an editor and kept in version control. default.md is global, any other file is a named preset that replaces it rather than adding to it, and a conversation may instead carry one-off text or opt out entirely. The choice is stored per session so reopening a chat restores the prompt it was built with. Prompt names are reduced to safe filenames, so a name like ../../etc/passwd cannot write outside the prompts directory, and a name that reduces to nothing is rejected rather than creating a dotfile. Co-Authored-By: Claude Opus 5 --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'CHANGELOG.md') diff --git a/CHANGELOG.md b/CHANGELOG.md index a7435e3..1b71e76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Context meter in the top bar showing how much of the active model's + context window the next request will use. It estimates while typing and + switches to the server's exact token counts after each reply, turning + amber at 75% and red at 90%. The limit comes from `ctx-size` in + `presets.ini`, since the router does not report it. +- System prompts stored as markdown files in `~/.config/llamachat/prompts/`. + A global `default.md` applies to new conversations, named presets replace + it, and any conversation can take a one-off custom prompt or none at all. + A dialog behind the picker adds, edits and deletes them; the files stay + editable outside the app. +- `default_prompt` in `config.toml` chooses what new conversations start + with. +- Streaming requests now ask for usage statistics, which is what makes the + meter exact without an extra round trip. + +### Changed + +- Sessions record the system prompt they were built with, so reopening a + conversation restores it rather than applying whatever is selected now. + ## [0.1.0] - 2026-07-31 First working version. -- cgit v1.2.3