Skip to content

Oshi Engine 0.17.1

Latest

Choose a tag to compare

@github-actions github-actions released this 05 Dec 00:51
· 1 commit to main since this release

This release fixes what the final code review of 0.9 to 0.17.0 found: eleven issues, one high, five medium and five low. It adds no features. One migration adds a column for contacts, and settings and novel get patch versions.

The high one:

  • The travel tool no longer shares other people's homes. travel_time listed every home she knows in its description and found any of them by name, so one user could get another user's address, or the address of someone only that other user had told her about. The tool, a place in start_activity and whereabouts now follow the contact rules: a person hears of her own people's homes, their own, and those of the people they told her about, and the owner in a private chat hears of every home. Any other home gets "You do not know where Ana lives", and the name is never looked up as an address. POST /v1/travel/route sees every home with a key that has users:read.

Medium:

  • Times that crashed a reply are refused. Text like "in 1e30 minutes" or "in inf hours" panicked in the time math, from her tools and from the activity and event routes. Minutes that are not finite, are negative or go past 60 days are not a time now. Moving an activity, until and depart_at go at most 14 days ahead, a typed date and the history day at most ten years.
  • Deleting a user with keep_contact=true keeps the people they told her about, as the docs said. Until now the database deleted them with the user, homes included. They now belong to the kept contact (learned_from_contact), only the owner can ask her about them, in private, and deleting that contact later removes them too. The default delete still removes everything. The Contacts view shows them with a "Told by" badge.
  • Avatars from before 0.16 are copied instead of moved, and backed up. 0.16.0 to 0.17.0 moved <data>/live2d/ to avatars/ and runtimes/ on the first start, while the update's health check was still running, so a failed check rolled back to a 0.15 with no models. An old model whose id was already taken was dropped. 0.17.1 copies them, keeps a taken id as <id>-legacy, and removes live2d/ on a later start with no update pending. Pre-update backups hold live2d/ while it exists. See Upgrading for what this means for a rollback below 0.16.
  • Module keys no longer read contacts. They have users:read to find who a chat is with, which also opened the contact list with homes, birthdays and the people she heard of in private chats. No module uses /v1/contacts, so module keys get 403 on every contact route.
  • The message log, debug entries and watcher incidents need chat:read. An admin key narrowed to status:read could read every chat through the log. Scoped owner keys also need settings:read for GET /v1/debug, and settings:write to turn debug mode on or off or to clear its entries.

Low:

  • more is now right at the largest page of the message log (500) and of debug entries (1000). It was always false there.
  • A time in the spring-forward gap, such as 02:30 on the night the clocks go forward, is read as an hour later in activities, whereabouts, her week and the transit cache, as her day already did. Activities and whereabouts used to refuse it.
  • In Docker, oshi update restore writes the old core to OSHI_CORE_DIR (/data/bin/oshi) instead of failing on the image's read-only binary. The steps are under Upgrading.
  • The novel card fits narrow screens: at 450x900 it was 468 px wide and is 450 now. The novel manifest names Live2D and Spine.

Modules in this release

Module Version Needs core Builds
browser 0.7.2 0.3.0 or newer x86_64, aarch64
novel 0.16.1 0.16.0 or newer any
settings 0.17.1 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 and novel are new versions. The other modules are unchanged; the store keeps the artifacts of the release that first shipped them.

Settings 0.17.1 still runs on core 0.17.0. Its one change is the "Told by" badge for people kept with a deleted user, read from the new learned_from_contact field. Core 0.17.0 never sends that field and never keeps such people, so there the Contacts view looks as it did. Settings 0.17.0 on core 0.17.1 shows those people as her own until it updates. Novel 0.16.1 changes only the card's CSS and the manifest description, so it keeps its range.

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.1 and novel 0.16.1. Neither waits for core 0.17.1.

Migration 11 adds the column learned_from_contact to contacts, a reference to another contact with ON DELETE CASCADE, and an index on it. Existing rows get no value and nothing else changes. The column is only filled when the owner deletes a user with keep_contact=true: the people she heard of from that user then point at the kept contact instead of the user, so they stay, and they go when that contact is deleted.

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 column. An older binary started on the migrated database without the backup also starts: it applies only the steps above the stored schema version and reads contacts by column name. People kept from a deleted user have no learned_from there, though, so 0.17.0 treats them as her own people, whom any user may hear of by name and home. If you go back that way, delete them first; settings 0.17.1 shows them with the "Told by" badge.

Keys narrowed to a scope list: an admin or owner key that reads the message log, watcher incidents or debug entries needs chat:read, and an owner key needs settings:read for GET /v1/debug and settings:write for PUT /v1/debug and DELETE /v1/debug/entries. Logins and keys with the default scopes of their level already have them. Module keys now get 403 on /v1/contacts; no shipped module calls it.

Avatars and a rollback below 0.16:

  • On 0.16.x or 0.17.0, <data>/live2d/ is already gone, and 0.17.1 cannot bring it back. A rollback to 0.15 finds the models only under avatars/. To use them there, copy each <data>/avatars/<id>/ back to <data>/live2d/models/<id>/ and <data>/runtimes/cubism-core/live2dcubismcore.min.js to <data>/live2d/core/ by hand. Live2D models work on 0.15 this way; Spine and Cubism 2 avatars need 0.16 or newer.
  • On 0.15 or earlier, 0.17.1 copies the models and Cubism Core and leaves live2d/ alone during the health check, so a failed check rolls back to a 0.15 that still has them. live2d/.copied-to-avatars.json lists what was copied. The next start with no update pending removes live2d/. When the update comes from pulling the 0.17.1 image, its launcher takes the pre-update backup, which then holds live2d/, so oshi update restore brings it back later. When the running 0.15 engine applies the update (oshi update apply, the settings UI or updates.auto), it takes the backup itself, without live2d/, so once the folder is removed, a rollback to 0.15 needs the same copy by hand.
  • From 0.17.1 on, every pre-update backup holds live2d/ while it exists. avatars/ and runtimes/ stay out of backups: a model can be 100 MB or more, an update never changes them, and a rollback finds them in place.

To restore a backup by hand in Docker:

  1. List the backups with docker compose exec oshi-engine oshi update backups and note the directory and the version in its name (...-pre-update-v0.17.0).
  2. Stop the engine: docker compose stop oshi-engine.
  3. Restore in a one-off container: docker compose run --rm oshi-engine update restore /data/backups/<dir>. The old binary goes to /data/bin/oshi.
  4. Set OSHI_IMAGE_TAG to the backup's version (0.17.0) and run docker compose up -d. In Dokploy, set it in the Environment tab and redeploy.

Step 4 matters because the launcher runs the newer of /data/bin/oshi and the image's binary. On the 0.17.1 image it would take the restored volume as an older install and update it again.

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.gz and oshi-aarch64-linux.tar.gz contain the oshi binary. They need glibc 2.34 or newer.
  • The module tarballs are named <id>-<version>-<target>.tar.gz. The browser, telegram, webchat and webchat extension tarballs are rebuilds of unchanged versions.
  • Each tarball has a .sha256 file, and SHA256SUMS covers all of them. store.json holds the store index entries for the modules in this release.

The Docker image is ghcr.io/oshiengine/oshi-engine:0.17.1 (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.17.0...v0.17.1