Repository navigation
Oshi Engine 0.17.0
This release finishes milestone 0.17, Logs and debugging. The owner can read every message in and out of every chat in one list, and can turn on debug mode to see what the engine did and why: the prompts the model saw, the tool calls, the scheduler and the decisions of her day.
- Message log:
GET /v1/logs/messageslists the messages of all chats, newest first, with filters for person, app, chat, direction, text and time, and pages by message id (before,after). Rows the engine made, such as touch notes, notices and system text, havedirection: engineand can be left out withhide_engine=true. Admins and the owner can read it, the same keys that can already read every chat. CLI:oshi log messages. - The Messages view in the settings UI puts the filters on top and the list under them. Tapping a message opens the chat around it, with buttons for earlier and later lines.
- Debug mode (
logging.debug, off by default) records entries for model requests, tool calls, the scheduler, presence, initiative, her day and week, activities, her events, the watcher, background jobs, route lookups, avatar touches and incoming messages. Kinds are named<group>.<what>(llm.request,tool.call, ...), so a filter can take a whole group. While debug mode is off, nothing is collected. - Routes:
GETandPUT /v1/debug,GETandDELETE /v1/debug/entries, andGET /v1/debug/entries/{id}. Every one of them is owner only, reading included. CLI:oshi debug on|off|status|tail|show|clear. - The Debug view in the settings UI, for the owner only: the switch, the space used against the cap, a clear button that asks first, the kinds with their counts, filters, and the entries. A model request opens as the conversation the model saw, with the tools offered and the answer.
Debug mode records the message text and the prompts of everyone she talks to. Only the owner can turn it on, with PUT /v1/debug, oshi debug on, the Debug view, or logging.debug in PUT /v1/settings, which refuses admin keys for that path as it does for updates.*. Admins can still change logging.debug_days and logging.debug_max_mb, because those only remove data.
Entries are written to <data>/logs/debug.db (/data/logs/ in Docker) and appended as JSON lines to one file per day, <data>/logs/debug-<date>.jsonl, which jq can read while the engine is stopped. Entries older than logging.debug_days (7) are removed. The table and the files each keep at most logging.debug_max_mb (100 MB), dropping the oldest entries first, so together they stay under about twice that. A day file starts a new part at an eighth of the cap, so the oldest part can go without the whole day. The caps are also applied once an hour while debug mode is off. Deleting a chat or a user removes their entries from the table and the files, and oshi debug clear or the clear button removes everything.
Keys and passwords are masked before an entry reaches the table or the file. One function replaces provider API keys and extra header values, calendar passwords and iCalendar links, the secret settings of installed modules such as bot tokens, and anything shaped like a key: Authorization and Bearer values, oshi_ keys and login sessions, sk-, ghp_ and similar keys, Telegram bot tokens, passwords in URLs, signed links, link codes, invite links, setup codes and private keys. Model requests are recorded from the request the engine built, before HTTP headers are added, so the provider key is not in them in the first place.
logs/debug.db is a separate SQLite file from oshi.db, so a large debug log does not grow oshi.db or its backups and does not share its write lock. 0.17.0 creates it, empty, on its first start, even with debug mode off.
Modules in this release
| Module | Version | Needs core | Builds |
|---|---|---|---|
| browser | 0.7.2 | 0.3.0 or newer | x86_64, aarch64 |
| novel | 0.16.0 | 0.16.0 or newer | any |
| settings | 0.17.0 | 0.17.0 or newer | any |
| telegram | 0.2.4 | 0.2.0 or newer | x86_64, aarch64 |
| webchat | 0.10.1 | 0.10.0 or newer | any |
| webchat-attachments | 0.5.0 | 0.5.0 or newer | any |
| webchat-stickers | 0.5.0 | 0.5.0 or newer | any |
| webchat-themes | 0.5.0 | 0.5.0 or newer | any |
settings is the only new version. The other modules are unchanged; the store keeps the artifacts of the release that first shipped them.
Settings 0.17.0 needs core 0.17.0. The Messages and Debug views call /v1/logs/messages and /v1/debug, which core 0.16.0 answers with 404, and their text comes from strings that only core 0.17.0 has, so on an older core both views would fail and the menu would show raw string keys. Settings 0.16.0 keeps working on core 0.17.0 until it updates. Its settings form is drawn from the engine's schema, so the three new settings show up in the logging section, and the owner can turn debug mode on there or with oshi debug on.
Upgrading
Run oshi update apply, or in Docker pull the new image. With modules.auto_update on (the default), the next module check installs settings 0.17.0. It waits for core 0.17.0: on an older core the store lists it as "needs core 0.17.0" and it stays on 0.16.0.
Migration 10 adds one index, messages_time on messages(created_at, id), so the message log can read all chats newest first and page by message id without scanning the whole table. It adds no table or column and changes no rows. SQLite builds the index on the first start, which takes a moment on a large messages table.
The pre-update backup holds a snapshot of oshi.db taken before the migration, so a rollback, automatic after a failed health check or by hand with oshi update restore <dir>, brings back the database without the index. A 0.16.0 binary started on the migrated database without the backup also starts: it applies only the steps above the stored schema version, and the extra index does not affect it. It also ignores the logging.debug* keys in oshi.toml.
The pre-update backup does not include logs/. It holds the binary, a database snapshot, oshi.toml, character/, memory/, prompts/ and the module state and settings. Debug entries never end up in a backup, and a rollback leaves logs/debug.db and the day files where they are. 0.16.0 does not read them. To remove them after a rollback, delete logs/debug.db and logs/debug-*.jsonl.
Three new settings, all applied when saved: logging.debug (off, env OSHI_LOGGING__DEBUG), logging.debug_days (7, from 1 to 365, env OSHI_LOGGING__DEBUG_DAYS) and logging.debug_max_mb (100, from 1 to 100000, env OSHI_LOGGING__DEBUG_MAX_MB). The switch applies at once; the caps apply at the writer's next check and at the hourly pass. When the env file sets OSHI_LOGGING__DEBUG, the switch is locked: PUT /v1/debug answers 409 and oshi debug status says to change it in the env file.
No prompt template or model profile changed in this release. If you keep your own templates in prompts/engine/, there is nothing to copy.
Coming from 0.9.0 or earlier, the compose service rename described in the 0.10.0 notes still applies.
Downloads
oshi-x86_64-linux.tar.gzandoshi-aarch64-linux.tar.gzcontain theoshibinary. They need glibc 2.34 or newer.- The module tarballs are named
<id>-<version>-<target>.tar.gz. The browser, novel, telegram, webchat and webchat extension tarballs are rebuilds of unchanged versions. - Each tarball has a
.sha256file, andSHA256SUMScovers all of them.store.jsonholds the store index entries for the modules in this release.
The Docker image is ghcr.io/oshiengine/oshi-engine:0.17.0 (also 0.17, beta, stable and latest) for amd64 and arm64.
Getting started
tar -xzf oshi-x86_64-linux.tar.gz
./oshi init
./oshi serve
With the engine running, ./oshi module install settings and ./oshi module install webchat add the settings and the chat. Open http://127.0.0.1:7420/settings and create the owner login with the setup code from oshi init. Before talking to her, set llm.providers.local.base_url and llm.chat.model in oshi.toml (or the env file) to an OpenAI-compatible server.
With Docker, docker-compose.yml starts the engine with the web chat and its extensions, novel mode and the settings; the setup code is in the log (docker compose logs oshi-engine). docker-compose-full.yml adds every module, SearXNG and the headless Chrome, with SEARXNG_SECRET set in .env.
All changes: v0.16.0...v0.17.0