man oscar The manual Chat

Chat gateways: Matrix, Telegram, Discord

Matrix, Telegram and Discord in one process, chat commands, the system service, shared rooms (per-person conversations, admins, approvers, pairing, room settings, voice replies), control from the chat, webhook triggers.

MANUAL / CHAT 6 / 29

Oscar answers in chats the same way on every platform: one conversation per private chat (and per person in a group room), the same commands, approvals asked in the chat, questions with buttons (or pills), a live activity message, voice notes, pictures and files. Set up the platforms you want, then run them all in one process. For rooms shared by several people there are admins and approvers, pairing for newcomers and settings per room; oscar gateway serve can also start turns from webhooks.

Platform Set up Turned on by
Matrix Matrix gateway MATRIX_HOMESERVER and MATRIX_ACCESS_TOKEN
Telegram Telegram TELEGRAM_BOT_TOKEN
Discord Discord DISCORD_BOT_TOKEN

Tokens go in $OSCAR_HOME/credentials.env (mode 0600) or the environment; who may talk to Oscar (*_ALLOWED_USERS) can also go in config.toml. Tokens are never printed or logged.

One process for every platform

shell
oscar gateway serve

starts every platform whose token is set. They share the model, the session store, the approval settings and the browsers; each chat keeps its own conversation (named matrix-…, telegram-…, discord-…). Each platform runs on its own: when one fails (the network, a revoked token, a refused Discord intent) or crashes, the log says why and it is started again after 5 s, then 10 s, 20 s … up to 5 minutes, while the others keep answering. A settings problem (no allowed users, a refused token) waits 5 minutes and reads the settings again, so fixing credentials.env is enough.

oscar gateway serve also runs the scheduler for scheduled jobs (cron = "off" turns it off) and, when switched on, the board worker. Their results go into chats through the running platforms; a result for a platform that is down waits until it is back. When session_archive_after_days or session_retention_days is set, it also tidies the session store once a day (see session housekeeping).

To run one platform alone: oscar matrix serve, oscar telegram serve, oscar discord serve. These stop with the error instead of retrying, and do not run scheduled jobs.

One bot token belongs to one gateway: before a platform starts, its gateway locks the token (by a hash of it, in ~/.local/state/oscar/locks, shared by every profile; OSCAR_LOCK_DIR moves it). A second gateway — another profile with the same token — leaves that platform off and says which home and process have it, instead of both stealing each other's messages. The lock ends with the process; the token itself is written nowhere.

Text the model writes before a tool call ("I'll read the logs first") reaches the chat as a quiet message when it was not already streamed there.

Several conversations at once

Every conversation runs one turn at a time, but conversations do not wait for each other: a slow turn in one chat does not hold up the others. Each platform answers up to max_concurrent_turns conversations at once (default 8; 1 brings back one at a time); messages for a conversation whose turn is still running wait in its queue, in order. A conversation is a private chat, a person's own conversation in a group room (or the room's, with group_sessions = "shared"), or a thread or forum topic. <PLATFORM>_MAX_CONCURRENT_TURNS sets it for one platform.

Stopping and restarting

oscar gateway stop and restart (and the service manager, and Ctrl-C) drain: no new turn starts, the running ones get up to drain_timeout seconds (default 60) to finish, then the process ends. Messages that arrive meanwhile wait in the queue and are answered after the restart. A second signal stops at once. A turn still running when the time is up is cut off; after the restart its chat gets one note — "♻️ Back online. I was interrupted before I could answer “…”" — and replying continue (or "go on", "yes") picks it up again, with the original message.

A reply the platform could not take (a network error, a server error) is kept and sent again after 30 seconds, after 2 minutes, then every 10 minutes for up to a day, marked "♻️ recovered reply". So is the rest of a reply a restart cut off mid-way. Nothing is ever sent twice.

Posting from the command line

shell
oscar send telegram home "deploy finished"
oscar send matrix '!room:example.org' "logs attached" --file logs/today.txt

posts without the model, into the chats send_message may reach (see below); home is the platform's home channel. A file passes the same checks as send_file: inside the workspace, nothing that holds keys.

Run it as a service

shell
oscar gateway install --dry-run   # show the unit, change nothing
oscar gateway install --start     # write it, enable it, start it
oscar gateway status | start | stop | restart
oscar gateway uninstall

install writes oscar-gateway.service: a system unit (/etc/systemd/system) when run as root, otherwise a user unit (~/.config/systemd/user, managed with systemctl --user); --system or --user choose. Configure a chat platform first (oscar setup gateways): without one the gateway runs the scheduled jobs only, and install says so. install writes and enables the unit; --start also starts it. The unit runs oscar gateway serve in your workspace with OSCAR_HOME and OSCAR_WORKSPACE set, restarts it when it fails (Restart=on-failure) but gives up after five starts in ten minutes (StartLimitBurst, StartLimitIntervalSec; see Operations), restarts a gateway that hangs (Type=notify, WatchdogSec=120: the gateway says when it is ready and pings while it is alive), and loads *.env files in $OSCAR_HOME (such as matrix.env) and any --env-file <path> with EnvironmentFile=. credentials.env is not loaded that way: Oscar reads it itself, which keeps its keys out of the processes Oscar starts. Stopping the service drains it (see above): the unit sends the stop signal to the gateway alone (KillMode=mixed) and waits drain_timeout plus 30 seconds (TimeoutStopSec) before anything is killed. The secrets themselves are never written into the unit. Environment files hold NAME=value lines (no export). Keys kept in 1Password or Bitwarden (op://…, bw://…, bws://… in credentials.env) need the manager's session or token in the service too: see keys from a password manager.

After changing settings: oscar gateway restart. Logs: oscar logs gateway -f (journald for the service, secrets masked; also logs/gateway.log in $OSCAR_HOME), or journalctl -u oscar-gateway -f (add --user for a user unit). A user service stops when you log out unless you run loginctl enable-linger $USER once. Each profile has its own unit (oscar-gateway-<name>.service, from oscar -p <name> gateway install), so several gateways can run side by side.

In a chat

Commands start with ! on Matrix and Discord and / on Telegram (which also shows them in its / menu):

Command Does
new [title] (or reset) a fresh conversation (the old one is kept), titled when you give a title
status model, conversation, usage, workspace, sandbox, how approvals work
model [target] [--global] [--reasoning level] alone: a list of models to pick from (buttons on Telegram and Discord, number reactions or a number reply on Matrix); with a target (a model id, provider:model, an alias, reset): switch this chat (admins; --global also saves it to config.toml); reset makes the chat follow config.toml's model again, which a running gateway picks up on the next message
model --once <target> the next turn in this chat only runs on that model, then the chat's own model again (admins; status shows it while it waits)
fast [on|off] priority processing for this chat where the provider offers it (changing it is for admins)
undo / retry remove your last message and the reply / ask it again
stop stop what Oscar is doing (also refuses a waiting approval)
approve, approve session, approve always, deny answer the waiting approval (always saves the allow rule the approval shows)
usage this conversation: duration, context fill, tokens and the cost split (input, output, cache reads); the provider account's limits where its API tells (OpenRouter credits, recent rate-limit headers)
compress [focus] summarise the older part of this conversation now; the rest of the line says what to keep
refine [focus] review this conversation now for memories and skills, and say what was kept; the focus says what to look for first (learning)
learn <url|path|text> [what you want] turn a source into a skill, written at once (so for admins), or a proposal anyone allowed may ask for with skill_review_apply = "propose"; a large one gets reference files; paths only inside the workspace (learning from a source)
review [focus] an independent reviewer (read-only, a background helper) checks the recent work and the changes since this conversation started; its findings come back here
bundle [name] [prompt] load a bundle of skills for this message, like typing them as commands; alone, the bundles (bundles)
proposals, accept <id>, reject <id> skills Oscar proposed from your work
memory [user], memory pending, memory approve|reject <id|all> what Oscar remembers, and memory changes waiting for a yes when memory_write_approval = "ask" (deciding is for admins) (memory)
rollback [n] list the files Oscar changed per turn, or put a turn's files back (asks first)
cron, cron status, cron run|pause|resume|cancel|remove <id> this chat's scheduled jobs; status and cancel act at once, even during a turn
blueprint [name [key=value…] | confirm | cancel] a ready-made scheduled job (daily digest, price watch, …): answer its questions, see the job, then blueprint confirm creates it, reporting to this chat
kanban [board | #card], kanban add|move|assign|comment|link|show|archive|next …, kanban watch [board|#card] [wake] the board: see it, change it, and be told when cards finish, block or fail; acts at once, even during a turn
title [text] show this conversation's title, or set it
sessions, sessions all, sessions search <text> this chat's conversations, numbered, newest first: the latest 20, every one (archived too), or those whose title, id or messages match
resume <n|id|title> go back to one of this chat's conversations (alone: the list)
branch [title] copy this conversation so far into a new one and continue there
rewind [n] take back the last n exchanges (default 1)
save [md|json|html] this conversation as a file, sent into the chat (Markdown by default)
insights [days] sessions, messages, tokens, cost, models, tools and approvals over the last 30 days (or 1-365), short
skills, skills search <words>, skills show <name> the skills this chat may use, read only (installing and removing stay on the command line)
reload-skills this conversation sees new, changed and removed skills from its next reply on, without new; Telegram's / menu and Discord's slash commands are published again when their commands changed
queue, queue <text>, queue clear (or q) the messages waiting for the current turn to end; add one; drop them
steer <text> (or s <text>) add to what Oscar is doing, after its next step
busy [interrupt|queue|steer] what a message typed while Oscar works does in this conversation (alone: how it is now; status shows it too)
btw <question> ask aside: answered from the conversation so far, while the turn goes on
bg <prompt>, bg, bg stop <n> run a prompt as a background session (its result is posted here); list; stop one
agents, agents <id>, agents stop <id>, agents steer <id> <text> Oscar's helpers and background processes in this conversation (running, and finished in the last 15 minutes); one's recent activity; stop one; add to a helper's instructions
approvals [ask|auto|smart|never] [save] show or change how this conversation asks before commands (smart: the reviewer model decides routine ones first; manual is ask, off is auto: dangerous commands still ask)
yolo [save] approvals auto for this conversation; dangerous commands are still asked here
goal <text>, goal status|pause|resume|clear a standing goal Oscar keeps working toward
personality [name|list|off] a tone preset for this conversation (concise, teacher, friendly, formal, skeptic or your own), layered after SOUL.md from the next reply and kept with the conversation (personalities)
loop <interval> <prompt> [--times n], loop status|pause|resume|stop repeat a prompt in this conversation every interval (setting one is for admins)
heartbeat every <interval> [prompt], heartbeat status|pause|resume|clear a check-in whenever this conversation is idle that long (setting one is for admins)
context what fills the context window, part by part
diff [--stat] [path…] the workspace's git changes since this conversation started
init [notes] write or refresh AGENTS.md from the repository (the write asks first)
plan <task>, plan go a plan only (read-only tools, nothing changed); carry it out
<skill> [prompt] use one of Oscar's skills for this message (!deploy-checklist v2)
verbose how much tool activity this chat sees: cycles off → new → all → verbose
footer [on|off] a last line under Oscar's replies here: model · tokens in/out · time · cost when known (default chat_footer, off)
discard drop the answer a restart cut off here instead of picking it up (send it right after the "back online" note)
mention in a group: whether Oscar answers only when mentioned here
whoami, help who Oscar thinks you are (and whether you are an admin or an approver); the list (help admin: the admin commands)

Other names the commands answer to: cancel and abort (stop), allow and yes (approve), no (deny), proposal (proposals), board (kanban), jobs (cron), compact (compress), helpers and tasks (agents), background (bg), rename (title), export (save), switch (resume), fork (branch), stats (insights), cost (usage), conversations (sessions), reloadskills and reload_skills (reload-skills), memories (memory), bundles (bundle), blueprints (blueprint), approval (approvals), progress (verbose), set-home (sethome), mentions (mention), ctx (context), hb (heartbeat), commands (help).

Admins also have these (who is an admin); they act at once, even while a turn runs:

Command Does
pair, pair <code>, pair deny <code>, pair revoke <user> pairing codes waiting; approve or refuse one; take an approval back
voice [off|voice|always] voice replies in this chat
platform, platform pause|resume <name> the platforms of this gateway; pause one or resume it
pause all, resume all the kill switch: no platform of this gateway starts a new turn (running turns finish, messages wait); resume all lets every one go on
restart restart the gateway service (it drains first: running turns finish)
update, update confirm whether a newer release exists; install it
sethome make this chat the platform's home channel
mention on|off|default in a group: answer only when mentioned (on), every message (off), or as configured
curator, curator run the skill curator: what it manages and protects, its thresholds and next run; or run it now
  • Conversations get a short title after the first reply, written in the background by a small model call (session_titles = "off" turns that off); title <text> sets your own, which is kept. new starts another conversation and keeps the old one; sessions lists this chat's conversations and resume 2 (or a title, or an id) switches the chat back to one. A chat sees and resumes only its own conversations, never another chat's or the terminal's. branch forks the current conversation (its messages so far are copied) and continues in the copy; resume goes back. rewind [n] removes the last exchanges from the conversation and from what the model is sent. save sends the conversation as a file: Markdown to read, save json with every message and tool call, save html as one page; secrets are redacted and tool outputs appear as stored.

  • Typing while Oscar works: a new message redirects the running turn (busy_input_mode = "interrupt", the default): a reply being written is stopped and the model is asked again with your message, told that you interrupted; finished tool work stays; a long shell command moves to the background instead of holding your message up. With "queue" the message waits and runs as the next turn; with "steer" it joins the running turn after its next tool result (or waits, when no tool has run yet). Pictures, voice notes and skill commands always wait for a turn of their own. The queue is kept in the gateway's delivery ledger, so it survives a restart; queue lists it and queue clear empties it. Several short messages sent in a row (within a second and a half of each other) are folded into one turn. A redirect refuses an approval that was still waiting (you moved on); approve, approve always, deny and answers to a question are never taken as a redirect. Each message sent during a turn is acknowledged — ⚡ redirected, ⏳ queued, ⏩ steered — as a reaction on Matrix and Discord and as a short silent note on Telegram (busy_ack = "off" turns that off).

  • A bare "yes" or "no" while an approval waits answers it: "yes", "y", "ok", "okay", "go", "sure", "approve" allow once; "no", "n", "nope", "deny" refuse (any case, trailing punctuation allowed). It counts from the person whose turn asked (allowing, only when they are an approver); in a conversation the whole room shares, an approver's word counts too — unless everyone may approve (*_ALLOW_ALL_USERS with no approvers listed). In a group where each person has their own conversation, only the person asked. Anything else still redirects as configured.

  • Streaming replies: a reply that takes a while is posted after about two seconds and edited as it is written (whole words only; … marks it as unfinished), then finished in place; a long one is split into several messages as usual. Quick replies arrive whole, as before. Edits are paced per platform (Matrix every 3 s, using m.replace and waiting out the homeserver's rate limits only for the final edit; Telegram every 1.5 s; Discord every 1.2 s). <PLATFORM>_STREAMING=off (matrix_streaming, telegram_streaming, discord_streaming) sends replies whole.

  • Background prompts (bg) use the same tools and approval mode as the conversation; approvals are asked here.

  • Background helpers: Oscar may hand work to helpers that keep going while it answers you (task with background: true, see tools; at most max_background_helpers, default 4, per conversation). A notice is posted here when one starts and when it ends (◆ helper h3 finished after 1m 12s: …); its report goes to Oscar with its next step, or — when the chat is quiet — in a short turn of its own, and Oscar posts what came back. agents lists them with background processes, agents h3 shows what one is doing, agents stop h3 stops it and agents steer h3 <text> adds to its instructions. Their approvals are asked here like any other, one at a time with the conversation's own (Approval needed for bash (helper h3)). Helpers belong to the conversation: new stops them, and so does stopping the gateway. They are kept in memory only.

  • Approval mode (approvals): changes apply at once to this conversation; save also makes it the default in config.toml. Only allowed users can send commands at all.

  • Goals (goal): after each turn a short judge request decides whether the goal is reached; if not, Oscar posts that turn's reply and carries on, within goal_max_turns (10) and goal_max_minutes (60). A message from you comes first; stop and goal pause pause it. Approvals still ask.

  • Loops and heartbeats (loop, heartbeat; setting one is for admins): !loop 10m check the deploy sends the prompt every ten minutes as your message in this conversation (at most 100 runs unless --times n says otherwise; the shortest interval is 30 seconds); !heartbeat every 30m sends a check-in whenever the conversation has been idle that long (Oscar says in a line whether anything needs you). A tick that finds the conversation busy is skipped. !loop alone shows it, pause, resume and stop (clear for a heartbeat) manage it; a chat command is never repeated. --until <text> ends a loop once a reply contains the text; a loop given no interval paces itself (each reply ends with next: 10m, kept between a minute and an hour). Loops, heartbeats and goals are kept in the state database and come back after a gateway restart, but only in rooms Oscar still knows and only when the person who set them is still an allowed user and an admin (the others are dropped and the log says so); a goal carries on after that conversation's next turn (goal resume at once). They run as before, approvals asked in the room: nothing that needs a person runs without one. For schedules that run whether anyone talks or not use !cron and scheduled jobs.

  • The chat's tools shared with the terminal chats: !context shows what fills the context window part by part (system prompt, context files, skills, tool definitions, the conversation) against the model's window; !diff [--stat] [path…] the workspace's git changes since this conversation started; !init [notes] has Oscar write or refresh AGENTS.md from the repository (the write asks in the room like any write); !plan <task> answers with a plan only, made with read-only tools and nothing approved, and !plan go carries out the plan just written. See chat-and-tui.

  • Long conversations are compressed on their own when they fill a share of the model's window: the first exchange and the recent messages stay, the middle becomes a summary the model writes, and every message is still in the conversation's history. The chat hears it once when the conversation passes about 85% of that size ("compacting soon", with how to compress now or start new), and once after a compaction ran (how many messages became a summary, what was kept); context_notices = "off" stops both. compress does it on demand, for example !compress keep the server names and the open questions; the reply says how much smaller the conversation got. The settings are in configuration.

  • Long tasks may take as many model calls as the work needs: no limit unless max_turns is set (the same as in the terminal); !stop ends a turn. The guards stop a model that repeats itself or whose calls keep failing to run. With a limit, Oscar stops at it and says what it did and what is left; reply "continue" to carry on.

  • !yolo (admins only, like !approvals) is !approvals auto for this conversation: calls that need approval run and are audited. Dangerous commands are still asked in the room, and refused ones stay refused.

  • Reasoning (reasoning_effort) applies here too, but the model's reasoning itself is never posted to a chat.

  • Approvals show the exact command. Telegram and Discord put buttons under it (✅ Allow once, 🔁 Allow for this session, 📌 Always allow, ❌ Deny); Matrix pre-seeds the same as reaction pills. "Always allow" names the exact rule it saves in the message before anyone presses it, and is never offered for dangerous commands. Only approvers count, for every answer including "always allow"; a press from anyone else is refused (and logged) and the buttons stay. Dangerous commands always ask, also with approve = "auto" or "smart". No answer within five minutes (or approval_timeout) is a deny.

  • Questions (clarify) come with numbered buttons (or 1️⃣ 2️⃣ pills); replying with a number or your own words answers too. They wait 10 minutes.

  • While Oscar works it shows "typing…" (paused while it waits for you), reacts 👀 to your message and ✅ or ❌ when done (on Matrix and Discord; Telegram leaves reactions off unless telegram_reactions = "on"), and keeps an activity message up to date with the tools it runs (📖 read_file: "src/main.rs" ✓ 0.2s). How much it shows is progress (per platform <platform>_progress; a chat changes its own with verbose): off, new (Telegram's default), all (the default elsewhere) or verbose — see tool activity. On a long turn the newest activity message says "⏳ still working — N min" every few minutes (still_working_minutes, default 3, 0 off). cleanup_progress = "on" removes the turn's activity messages once the reply is out. <PLATFORM>_REACTIONS=false turns the reactions off, <PLATFORM>_TYPING=false the typing indicator.

  • Group rooms: the model sees who wrote each message, as [Alice|@alice:example.org] … (display name and id; private chats are unchanged), and is told it is in a group room (and its name). It may stay silent: a reply that is exactly [SILENT] or NO_REPLY sends nothing there (allow_silence: groups by default, on everywhere, off never; where silence is not allowed the token becomes a short note). Who is answered in groups — mentions, free-response rooms, allowed rooms — is on each platform's page; mention off in a room makes Oscar answer every message there, mention on only when mentioned.

  • Bots are not answered unless <platform>_allow_bots lets them in (mentions: only when they mention Oscar; all) — and they must still be allowed users. After bot_loop_max (4) bot messages in a row in one room, the rest are ignored until a person writes, so two bots cannot talk forever. Not on Matrix, which has no bot flag: list the bot as a user, or ignore it with matrix_ignore_user_patterns.

  • Files in a reply: a line MEDIA: path/to/file in the model's reply, or a Markdown link to a workspace file ([report](out/report.pdf)), sends that file into the chat, through the same checks as send_file; the MEDIA: line is taken out of the text. A path to a document, picture, video, audio file, data file or archive (.pdf, .png, .mp4, .csv, .zip …) is sent too when it names an existing file and stands alone — on a line of its own (absolute or relative to the workspace), or as an absolute path in the text (deliver_named_files, on by default; at most 5 per reply). Paths written as code (in backticks or code blocks) and source files are never sent this way, so a reply that mentions the files it edited sends nothing; use a MEDIA: line for those. The checks are the same for all three: inside the workspace only, never Oscar's own home, credential folders (~/.ssh, ~/.aws …), .env files, protected_paths or files that look like keys or hold a token, and at most 50 MB. Two to ten pictures or videos in one reply go as one album on Telegram.

  • Platform hints: the system prompt ends with a short note on where Oscar is answering — what renders (Markdown, tables or not, code blocks), how long a message may be, and how to send a file with a MEDIA: line — for Matrix, Telegram, Discord and the terminal. It is the same for every conversation of a platform, so prompt caching holds. Change it with [platform_hints.<platform>] (matrix, telegram, discord, cli, tui): append = "..." adds to it, replace = "..." replaces it (an empty replace removes it):

    toml
    [platform_hints.telegram]
    append = "Answer in short paragraphs; the users read on their phones."
    ``` A reply that would take more than
    `long_reply_messages` messages (default 8, 0 never) goes as a
    `reply-<id>.md` file with a short preview message instead.
  • Voice, pictures and files work both ways: see Voice, pictures and files.

  • Restarts never answer a message twice or lose one that arrived while Oscar was down: a reply cut off mid-way is finished (marked "♻️ recovered reply"), a turn that was running gets one "back online" note offering to pick it up (see stopping and restarting).

  • Strangers (not on the allowed list) are told no in a private chat and ignored in groups; with pairing on they get a code instead.

  • Jobs and messages to other chats: a job made in a chat reports there. send_message can post into another chat only after you approve it, and only into chats where an allowed user has talked to Oscar, a home channel (<platform>_home_channel, or the chat an admin chose with sethome, which wins), or (Telegram) an allowed user's private chat. Oscar remembers which chats those are as messages from allowed users arrive.

Tool activity

While a turn runs, Oscar keeps an activity message (a notice on Matrix, a silent message on Telegram and Discord) up to date with the tools it calls, each with its status: … while it runs, then ✓ 0.3s, ✗ failed 1.2s or × refused. progress (per platform <platform>_progress, per chat verbose) decides how much it shows:

Mode Shows
off no activity message
all every call with a short preview (the default; Telegram's is new)
new like all, but one line per tool in each activity message: a tool run again counts on its line (💻 bash ×3) and shows its latest call
verbose every call in full: the whole command and every argument (detailed is the older name)

The preview of a command (bash, and any tool that takes a command; the code of execute_code) is its first line in a code block under a 💻 bash header, cut at tool_preview_length characters (default 40) with ... when it is cut or when more lines follow; commands in a row share the header. Any other call is one line with its main argument — the path, URL, query, pattern, skill name or memory action (never the entry's text): 🔍 web_search: "nginx 502 bad gateway", or 💾 checkpoint… when there is nothing to show. verbose shows the whole command, every line of it, and every argument of other calls (as JSON), cut only to fit a message.

The model's text before a call goes into the chat as a message of its own. When it, or anything else (a question, a notice, an approval prompt), is posted while the turn runs, the earlier activity message is left as it is and the next calls go into a new one under it, so text that ends in ":" is followed by the commands it introduces. Calls with nothing posted between them stay in one message, edited at most every three seconds. In all the chat shows, for example:

text
Let me check the nginx config:

💻 bash
```
nginx -t
```
✓ 0.3s
```
cat /etc/nginx/sites-enabled/default
```
✓ 0.1s

And the main file:

📖 read_file: "/etc/nginx/nginx.conf" ✓ 0.1s

In verbose the same turn shows each command whole, and 📖 read_file ✓ 0.1s with {"path":"/etc/nginx/nginx.conf"} in a code block under it; in new the first message reads 💻 bash ×2 with the second command only.

Previews are redacted like everything Oscar sends (API keys, tokens and registered secrets never show, also not half of one cut off), control characters are dropped, nothing in a command can close its code block, and a path or a query shows as written, never as formatting.

Conversations from the terminal (handoff)

/handoff telegram (or discord, matrix, with a chat id or the home channel) in the terminal chat moves that conversation here: in a new forum topic, Discord thread or Matrix thread where the chat has them, else in the chat itself. The session, its history and its approval mode stay the same; reply in the chat and the gateway carries on. Only chats Oscar may post to on its own are accepted (see above). See chat and the full-screen interface.

  • !handoff says which session this conversation is and where it came from.
  • !handoff cli hands it back: this chat starts a new conversation with the next message, and oscar -r <id> continues the session on the terminal with the approval mode it had here.

Rooms shared by several people

Conversations. A private chat is one conversation, as always. In a group room each person has a conversation of their own (group_sessions = "per_user", the default): Alice and Bob can both talk to Oscar in the same room without seeing each other's context, new starts over only for the person who typed it, queue, steer and stop act on your own turn, and a message from Bob never redirects Alice's turn. sessions, resume, branch, rewind, title and save work on your own conversations only (Bob can neither list nor resume Alice's), and housekeeping keeps each person's current conversation. group_sessions = "shared" gives the whole room one conversation (how group rooms behaved before this setting existed); <platform>_group_sessions or a room's own settings choose per platform or per room.

Upgrading: group rooms now get a conversation per person by default. Set group_sessions = "shared" to keep one conversation per group room. Private chats are unchanged.

Threads and topics. A Matrix thread, a Telegram forum topic and a Discord thread are rooms of their own: each gets its own conversation (per person, in a group), and replies go back into the thread. A thread or topic uses its room's settings unless it has a table of its own (a Discord thread is a channel: give it its own table).

Each conversation runs one turn at a time, and conversations run side by side (see several conversations at once): Alice's slow turn does not hold up Bob's. Approval prompts are posted in the room; anyone allowed may refuse what their own turn waits for (stop, a bare "no", or a new message that redirects it), but only an approver can allow it — a bare "yes" too.

Admins and approvers

Who May
allowed users (<platform>_allowed_users, and people approved by pairing) talk to Oscar, new, queue, steer, btw, stop on their own turns, bg for their own background prompts, see their own scheduled jobs (cron)
admins (<platform>_admins; default: the configured allowed users) also approvals (any mode, smart too), model <id>, accept / reject skill proposals, learn (unless skill_review_apply = "propose"), everyone's jobs in the chat (cron), everyone's background prompts (bg lists them; bg stop <user>#<n>), stop someone else's turn, and the admin commands (pair, voice, platform, restart, update, reload-mcp, sethome, mention on|off, curator)
approvers (approvers, or <platform>_approvers; default: the admins) answer approval prompts, including 📌 always allow (approve always), so only they can save an allow rule; a press or approve from anyone else is refused and logged

With the defaults every configured allowed user is an admin and an approver, so an existing setup behaves as before; people approved by pairing can chat but are neither, unless a list names them. whoami says what you are. Anyone allowed can use kanban in a chat (see and change the board, watch it); the board worker is switched in config.toml.

Pairing

With pairing = "on" (or <platform>_pairing; off by default), someone who is not allowed and writes to the bot in a private chat gets a short one-time code instead of a refusal. An admin approves it, from a chat with pair ABCD-EFGH or on the command line:

shell
oscar pairing list               # codes waiting, people approved
oscar pairing approve ABCD-EFGH  # or deny ABCD-EFGH
oscar pairing revoke <user> [--platform telegram]

The person is welcomed within a few seconds and from then on counts as an allowed user on that platform (a revocation applies at once). Codes expire after an hour; a person has one code at a time, shown again at most every ten minutes; at most ten codes wait at once (more strangers are told to try later). Codes never pair anyone in a group room. Everything is kept in $OSCAR_HOME/pairing.json (mode 0600). On Matrix, a stranger must first invite the bot to a private chat (an invite marked as direct); with pairing on Oscar accepts such invites. Approved people count only while pairing is on for their platform. With pairing on, a platform may start with no allowed users at all: then only people approved from the command line can talk.

Settings per room

config.toml can give a room its own settings:

toml
[rooms."telegram:-1001234567890"]
model = "glm-5.1"
system_prompt = "This is the ops team's room: answer briefly, in English."
tools = "web, read_file, -bash"
busy_input_mode = "queue"
require_mention = false
voice_replies = "off"
group_sessions = "shared"

[rooms."telegram:default"]   # every other Telegram chat
require_mention = true

[rooms.default]              # every chat on every platform
voice_replies = "voice"

The room is named as send_message names it: matrix:!room:server, telegram:<chat id> (telegram:<chat id>/<topic id> for one forum topic), discord:<channel id>. The most specific table wins: the room's, then (for a thread or topic) its room's, then <platform>:default, then default, then the flat settings. model is the room's model unless an admin switched it with model <id>; system_prompt is added to Oscar's own prompt; tools is a toolset list applied after tools and tools_<platform>; require_mention decides whether group chatter is answered without a mention (a room that wants a mention ignores the rest, a room that does not answers everything). status in the room shows what it runs with and where each setting comes from.

Voice replies

voice_replies = "voice" answers a voice note with a voice note (spoken with the configured text to speech) and the text; "always" speaks every reply; "off" (the default) never. Set it for every chat (voice_replies), per room ([rooms.*]), or from the chat: voice voice, voice always, voice off (admins; kept in gateway.db, winning over the file). When speech fails, the reply says why.

Control from the chat

  • restart restarts the gateway service when it is installed (systemctl restart); otherwise Oscar says how to restart it where it runs.
  • update runs oscar update --check and says whether a newer release exists; update confirm installs it, only from a signed release (the signature and checksum are checked first, and a build without the release key refuses). restart then runs the new version.
  • platform pause telegram stops answering on one platform of this gateway: messages sent meanwhile wait in the queue (each chat is told once), admin commands still work there, and platform resume telegram (from any chat) answers what waited. A restart resumes every platform.
  • reload-mcp reads mcp.json again, reconnects the MCP servers and says what was added, reconnected, turned off or removed; the next message has the new tools.
  • pause all is the operator's emergency stop: every platform of this gateway stops starting turns (running turns finish; new messages wait in the queue and each chat is told once), scheduled jobs do not start and the board worker picks up no card. Admin commands still work everywhere, and resume all (from any chat) answers what waited. It is the same switch as oscar pause / oscar pause --resume on the command line (a file in Oscar's home), so it holds across a restart; oscar status, oscar doctor and !status show it.
  • After a restart cut a turn off, the "back online" note offers to pick it up: "continue" does, discard drops it, and any other message moves on.

Topics

!topic [name] opens a new topic in the chat — a conversation of its own, with its own history, model and settings: a topic in a Telegram private chat with topics turned on or in a forum group, a thread in Discord (a post in a forum channel), a thread in Matrix. Typed in a topic, it opens the new one beside it. A topic's table [rooms."telegram:<chat>:<topic>"] (or <chat>/<topic>) holds its own settings, and skills = ["pdf", "maps"] in any room's or topic's table loads those skills into its conversations (a topic without a table uses its chat's). When a conversation in a private chat's topic gets its title, the topic is renamed to it.

Replies to scheduled results

A scheduled job's result can be answered with the platform's reply feature (Telegram's reply, a Matrix reply, a Discord reply): the reply goes into the chat's conversation with the result quoted before it, marked as context rather than your words, so the conversation picks up where the job left off. In a group room the reply counts as addressed to Oscar.

Board watches

kanban watch makes a chat hear when cards finish, block or fail, from whoever moved them; with wake, Oscar also takes a short turn there about it when the conversation is idle (on behalf of the person who set the watch). See kanban.

Webhook triggers

oscar gateway serve can start turns from webhooks: a forge's push or pull request, a CI result, a monitoring alert. It listens only when webhook_listen is set (a port means 127.0.0.1:<port>; an address such as 0.0.0.0:8644 reaches other machines, so put a TLS proxy in front), and only for paths a [[webhooks]] table names:

toml
webhook_listen = "8644"

[[webhooks]]
name = "github"                     # oscar webhooks test github
path = "/hooks/github"              # default /hooks/<name>
signature = "github"                # github, gitlab or hmac
secret_env = "GITHUB_WEBHOOK_SECRET"  # in credentials.env or the environment
events = ["push", "pull_request"]   # default: all
prompt = "Summarise this push to {{repository.full_name}} by {{pusher.name}}: {{head_commit.message}}"
deliver = "telegram:-1001234567890" # like send_message; "none" (default): stored only
approve = "never"                   # never | auto | smart; default: unattended_approve

A request must be a POST to that path of at most 1 MB, signed with the secret (GitHub X-Hub-Signature-256; GitLab X-Gitlab-Token; hmac: a hex HMAC-SHA256 of the body in the header named by header, optionally sha256=-prefixed), JSON, with an accepted event (X-GitHub-Event, GitLab's object_kind or X-Gitlab-Event, else X-Event-Type or event in the payload). Signatures are compared in constant time. A delivery id seen before (X-GitHub-Delivery, X-Gitlab-Event-UUID, X-Delivery-Id, Idempotency-Key, else the body's hash) is answered but not run again. Answers: 202 accepted, 200 ignored or duplicate, 401 bad signature, 404, 413, 429 when too many runs wait.

{{path.to.field}} in the prompt is filled from the payload ({{commits.0.message}} for lists; {{event}}, {{delivery}} and {{payload}} too). Every value reaches the model inside <untrusted>…</untrusted> markers it cannot close, without control characters, at most 2000 characters each, and the model is told that this is data from the sender, never instructions. The run is unattended, like a scheduled job: nobody can answer a question or approve anything. Its approval mode is the webhook's own approve, else unattended_approve (unset: auto only with approve = "auto", otherwise never; see approvals). With "never" everything that needs approval is refused; with "auto" what is not dangerous runs and is written to the audit log; with "smart" what the reviewer model approves runs and the rest is refused; dangerous commands are always refused. The result goes to deliver (the chat must be one Oscar may post to), with what was refused listed under it; every run is also kept as a conversation (webhook-<name>-<time>).

shell
oscar webhooks list                         # paths, events, whether each secret is set
oscar webhooks test github                  # the prompt a sample payload makes
oscar webhooks test github --payload p.json --event push --send  # signed, to the running gateway

Settings

Variable (config key) Meaning
MATRIX_ALLOWED_USERS (matrix_allowed_users), TELEGRAM_ALLOWED_USERS, DISCORD_ALLOWED_USERS who may talk to Oscar, comma-separated
MATRIX_ALLOW_ALL_USERS, TELEGRAM_ALLOW_ALL_USERS, DISCORD_ALLOW_ALL_USERS true: everyone (careful)
MATRIX_REQUIRE_MENTION (matrix_require_mention), TELEGRAM_REQUIRE_MENTION, DISCORD_REQUIRE_MENTION group rooms and server channels: answer only when addressed (default on; private chats never need it)
MATRIX_REACTIONS (matrix_reactions), TELEGRAM_REACTIONS, DISCORD_REACTIONS the 👀/✅ marks (default on; Telegram off)
MATRIX_TYPING (matrix_typing), TELEGRAM_TYPING, DISCORD_TYPING false: no typing indicator
OSCAR_PROGRESS (progress), MATRIX_PROGRESS (matrix_progress), TELEGRAM_PROGRESS, DISCORD_PROGRESS off, new, all, verbose (default all; Telegram new)
OSCAR_MAX_CONCURRENT_TURNS (max_concurrent_turns) conversations answered at once per platform (default 8)
OSCAR_STILL_WORKING_MINUTES (still_working_minutes) "still working" on long turns every N minutes (default 3, 0 off)
OSCAR_CLEANUP_PROGRESS (cleanup_progress) on: remove the turn's activity messages after the reply
OSCAR_TOOL_PREVIEW_LENGTH (tool_preview_length) characters of a call's preview in the activity message, all and new (default 40; 0 the default) (tool activity)
OSCAR_ALLOW_SILENCE (allow_silence) where [SILENT] / NO_REPLY sends nothing: groups (default), on, off
OSCAR_LONG_REPLY_MESSAGES (long_reply_messages) longer replies go as a file (default 8 messages, 0 never)
OSCAR_BUSY_ACK (busy_ack) off: no ⚡/⏳/⏩ for messages sent during a turn
OSCAR_BOT_LOOP_MAX (bot_loop_max) bot messages answered in a row in one room (default 4)
OSCAR_DRAIN_TIMEOUT (drain_timeout) seconds a stop or restart lets running turns finish (default 60)
MATRIX_STREAMING (matrix_streaming), TELEGRAM_STREAMING, DISCORD_STREAMING off: send replies whole instead of streaming them (default on)
OSCAR_BUSY_INPUT_MODE (busy_input_mode) what a message sent while Oscar works does: interrupt (default), queue, steer
OSCAR_GOAL_MAX_TURNS (goal_max_turns), OSCAR_GOAL_MAX_MINUTES (goal_max_minutes) how far a goal may go on its own (20 turns, 60 minutes)
MATRIX_HOME_CHANNEL (matrix_home_channel), TELEGRAM_HOME_CHANNEL, DISCORD_HOME_CHANNEL the chat a job or message goes to when only the platform is named
OSCAR_GROUP_SESSIONS (group_sessions), MATRIX_GROUP_SESSIONS (matrix_group_sessions), TELEGRAM_…, DISCORD_… group rooms: per_user (default) or shared
MATRIX_ADMINS (matrix_admins), TELEGRAM_ADMINS, DISCORD_ADMINS who may use the admin commands (default: the allowed users)
OSCAR_APPROVERS (approvers), MATRIX_APPROVERS (matrix_approvers), TELEGRAM_…, DISCORD_… who may answer approval prompts (default: the admins)
OSCAR_PAIRING (pairing), MATRIX_PAIRING (matrix_pairing), TELEGRAM_…, DISCORD_… on: strangers get a pairing code (default off)
OSCAR_VOICE_REPLIES (voice_replies) off (default), voice, always
OSCAR_WEBHOOK_LISTEN (webhook_listen) where oscar gateway serve listens for webhooks (default off)
OSCAR_CHAT_FOOTER (chat_footer) on: replies end with a line on model, tokens, time and cost (default off; footer on|off per chat)
OSCAR_CONTEXT_NOTICES (context_notices) off: no notice when a conversation nears compaction or after it (default on)
OSCAR_DELIVER_NAMED_FILES (deliver_named_files) off: only MEDIA: lines and Markdown links send files, not paths standing alone (default on)
TELEGRAM_PROXY, DISCORD_PROXY, MATRIX_PROXY that platform's connections through a proxy (see proxies); environment or credentials.env only
[platform_hints.<platform>] append or replace the platform hint in the system prompt
OSCAR_UNATTENDED_APPROVE (unattended_approve) what runs with nobody to ask, also webhook runs without their own approve: never, auto or smart (unset: auto only with approve = "auto")
[rooms."<platform>:<room>"] settings per room

Every OSCAR_<NAME> chat setting above can be set for one platform with <PLATFORM>_<NAME> (for example TELEGRAM_MAX_CONCURRENT_TURNS=2). Platform-specific settings are on each platform's page.

Proxies

Each platform can reach its servers through a proxy of its own: TELEGRAM_PROXY, DISCORD_PROXY, MATRIX_PROXY (in the environment or credentials.env, since a proxy URL may carry a password; never in config.toml). The URL is http://, https://, socks5:// or socks5h:// (the proxy resolves the name), with user:password@ when the proxy needs it:

shell
TELEGRAM_PROXY=socks5h://127.0.0.1:1080
DISCORD_PROXY=http://user:secret@proxy.lan:3128

The proxy carries every request of that platform: Telegram's Bot API calls and file downloads; Discord's REST calls and its gateway websocket (through an http:// proxy with CONNECT, or socks5:///socks5h://; an https:// proxy works for the REST calls only); every Matrix request, encryption included. Without one, the usual HTTPS_PROXY / ALL_PROXY variables still apply to the HTTP calls. Model providers and tools do not use these. A proxy URL that is not one of these stops the platform at start with the reason; the URL itself is never printed.

Upgrading

What changed for an existing gateway, and how to keep the old behaviour:

  • Chats are answered side by side (up to 8 per platform) instead of one at a time across all chats: max_concurrent_turns = "1".
  • Matrix answers in group rooms (more than two members) only when mentioned or replied to; before, every message (and MATRIX_REQUIRE_MENTION applied to private chats too, which now never need a mention): matrix_require_mention = "false", or mention off in a room. Edits (m.replace) are no longer answered as new messages. Files and videos are taken (they were dropped), up to 100 MB (was 50; matrix_max_media_mb).
  • Telegram shows a line only for each new tool (telegram_progress = "all") and no 👀/👍 reactions (telegram_reactions = "on"); typing stays.
  • Discord starts a thread for each mention in a server channel (discord_auto_thread = "false"), sends the channel's earlier messages as context with a mention (discord_history_backfill = "false"), and points the first message of a reply at yours (discord_reply_to_mode = "off"). Threads need the Create Public Threads permission: oscar discord probe prints an invite link that has it.
  • Group messages reach the model with their sender in front, and in group rooms [SILENT] sends nothing.
  • A bare "yes" / "no" during an approval answers it instead of redirecting the turn and refusing the approval.
  • Messages sent during a turn get ⚡/⏳/⏩ (busy_ack = "off"); long turns say "still working" (still_working_minutes = "0").
  • Replies longer than 8 messages come as a file with a preview (long_reply_messages = "0"); a MEDIA: path line in a reply sends the file and is removed from the text.
  • Link previews (Telegram) and link embeds (Discord) are off for everything Oscar posts or edits: the platform would fetch any URL a reply names with nobody clicking it, and a page the model read could have it write an address that carries data away. Links stay clickable.
  • The note after a restart changed (it offers to continue), late replies are labelled "♻️ recovered reply", and replies the platform refused for now are retried.
  • The service unit drains on stop: run oscar gateway install again to get KillMode=mixed and TimeoutStopSec.
  • A home channel set with sethome wins over <platform>_home_channel.
  • A document, picture, media or archive path standing alone in a reply (its own line, or an absolute path in the text; never in code) sends that file like a MEDIA: line (deliver_named_files = "off").
  • Chats hear when a conversation nears compaction and after it ran (context_notices = "off").
  • send_file, MEDIA: lines and named files also refuse what the read guard keeps from the file tools inside the workspace: Oscar's own home (a workspace that contains it), credential folders, .env files and protected_paths.
  • The system prompt of a chat ends with a short platform hint ([platform_hints.<platform>] replace = "" removes it).
  • Approval mode names manual (= ask) and off (= auto, dangerous commands still ask) are accepted everywhere a mode is read.