Skip to content

Oshi Engine 0.15.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 09:25
· 23 commits to main since this release

This release finishes milestone 0.15, Random events. Now and then she plans something of her own: karaoke with friends on Saturday, a museum on Sunday, the dentist. She fits it into her free time, invites people, talks about it before and after, and remembers how it went.

  • Once a day, at a time between 10:00 and 22:00 when she can look at her phone, the life tick rolls whether she plans an event. The draw comes from the seed and the date, so a given day rolls the same on every run. Her sociability, how full her week is and her mood scale the chance: the rate is life.events_per_week / 7 × (0.2 + 1.8 × sociability), so with the default of 2 a simulated year gave 0.7, 1.8 and 2.6 events a week at sociability 0.1, 0.5 and 0.9. life.max_events_per_week caps the events made in seven days. The day's roll is stored, so a restart does not roll again.
  • When the roll says yes, the background model plans one with event_plan.md. It picks from her free time in the next seven days, starting at least three hours ahead: only stretches the generator filled in, never a block of her week, an activity, sleep, work or a commute. It also gets up to twelve people she could invite. A plan that names a time or a person that was not offered is dropped or trimmed, and each one records an event_dropped watcher incident.
  • An event is an activity decided by event, with a kind (social, family, hobby, errand, appointment, culture, sport or trip), a note, guests with their answers, and how it went. It shows in her day, "Your plans", her schedule feed and novel mode like any other activity.
  • She invites users with a message she writes first. Only users who are enabled, not guests, have the initiative feature on and can be reached on an app are offered, and people she heard about in someone else's chats never are. The person answers in the chat. She notes the answer with the new answer_invite tool, and when the model answers only in words, the appraisal after her reply takes a yes, no or maybe that their words back. People of her own life are on no app, so they answer at once from the seed, yes more often the closer they are.
  • She brings an event up once before it (from 17:00 the day before, with someone who is coming, else someone close) and once after it (with someone who was not invited).
  • When it ends, event_outcome.md asks for two or three sentences in her voice about how it went. The text passes the sanitizer and the memory guard, is kept on the event, and is in her prompt ("Right now") for three days. It is never written to memory directly. It becomes a memory only through what she tells someone in a chat, like anything else she says.
  • Deleting a user still deletes the plans they joined, but not her own events. The event stays and the person leaves its guest list. With keep_contact nothing is deleted and they stay on the list as someone she knows.
  • The Activities view in the settings UI has a "Her own plans" card. It shows today's roll as a bar (the fill is the chance, a mark shows the draw once she decided) and has a "Plan one now" button. Event cards show the kind, the note, the guests with their answers (click one to set it by hand) and how it went. Her day and the week preview mark events with a star.
  • API: GET and POST /v1/character/events, GET, PATCH and DELETE /v1/character/events/{id}. Reading needs character:read and users:read, and user keys are refused; planning and changes need character:write and users:read. activity_changed events have four new changes: invited, answered, outcome and deleted. Keys without users:read get events without their guests on /v1/character/life and the activity routes. CLI: oshi life events [--date] and oshi life event plan|change|cancel|delete.
  • New settings: life.events (on), life.events_per_week (2) and life.max_events_per_week (4), with env names OSHI_LIFE__EVENTS, OSHI_LIFE__EVENTS_PER_WEEK and OSHI_LIFE__MAX_EVENTS_PER_WEEK. A change applies at the next roll.

Modules in this release

Module Version Needs core Builds
telegram 0.2.4 0.2.0 or newer x86_64, aarch64
settings 0.15.0 0.15.0 or newer any
webchat 0.10.0 0.10.0 or newer any
webchat-themes 0.5.0 0.5.0 or newer any
webchat-stickers 0.5.0 0.5.0 or newer any
webchat-attachments 0.5.0 0.5.0 or newer any
novel 0.11.0 0.10.0 or newer any
browser 0.7.2 0.3.0 or newer x86_64, aarch64

settings is the only new version. telegram, webchat, novel, browser and the three webchat extensions are unchanged; the store keeps the artifacts of the release that first shipped them.

Settings 0.15.0 needs core 0.15.0. The Activities view reads /v1/character/events, which an older core answers with 404, and its new text comes from the engine, so on core 0.14.0 the "Her own plans" card would show an error and raw string names. Settings 0.14.0 keeps working on core 0.15.0 until it updates, and shows events there as ordinary activities. The unchanged modules do not read activities.

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.15.0. It waits for core 0.15.0: on an older core the store lists it as "needs core 0.15.0" and settings stays on 0.14.0.

This release has a database migration. Step 9 adds two tables with their indexes: life_events (for each event its kind, note, whether the roll or the owner made it, the day of the roll, how it went, and who she talked to about it before and after) and life_event_guests (who she invited to each event, their answer, and when and on which app she asked). It runs by itself the first time 0.15.0 starts, in one transaction, and leaves existing data alone; nothing that 0.14.0 reads is changed or dropped. The updater snapshots the database into the pre-update backup before it replaces the binary. If 0.15.0 fails its health check, the launcher restores that backup, so the rollback undoes the migration too. To go back by hand later, find the backup with oshi update backups, stop the engine and run oshi update restore <dir>. That brings back the 0.14.0 binary and database, and events, invites and answers made since the update are lost. In Docker, also go back to the 0.14.0 image.

Random events are on by default (life.events = true), so she starts rolling once a day after the update. To turn them off, switch off "Plans events of her own" under Life in the settings UI, set life.events = false in oshi.toml, or set OSHI_LIFE__EVENTS=false in the env file, which also locks the setting. A roll already made that day and events already planned stay; delete one in the Activities view or with oshi life event delete <id>.

She now writes first for two new reasons: to invite someone, and to talk about an event before or after. Both are ordinary first messages under the existing limits. They count toward life.max_initiatives_per_day and life.min_initiative_gap_minutes with every other first message, and the person's quiet hours (life.user_quiet_hours), their initiative feature and her availability still apply. Someone with initiative off is never invited. With life.initiative off she still plans events and her own people still answer, but users she picked are never asked and she does not bring events up.

If you keep your own templates in prompts/engine/: five templates are new (event_plan.md, event_invite.md, event_before.md, event_after.md and event_outcome.md), and no existing template or model profile changed, core.md included. A file in prompts/engine/ replaces only the built-in one with the same name, so there is nothing to copy. Copy a new one from assets/prompts/engine/ only if you want to change it. The appraisal rule for invite answers and the line in "Right now" about where an invite stands are built into the engine.

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 telegram, webchat, novel, browser 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.15.0 (also 0.15, 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.14.0...v0.15.0