Skip to main content
In the interactive shell, background mode runs investigations asynchronously so you can keep asking questions while an RCA finishes. When background mode is on:
  • New investigations start in the background
  • The shell stays free for follow-up questions
  • Completed RCAs are kept and can be looked up later from the shell or chat
  • Completion notifications can go to email (SMTP), Telegram (Telegram), Rocket.Chat (Rocket.Chat), Buzz (Buzz), or any combination of those
In-flight jobs stop if the shell exits. Completed RCAs are kept, and you can look them up later from the shell or from a chat channel.
This is not the hosted async HTTP API (POST /api/investigations and OPENSRE_INVESTIGATION_WORKER). For that path, see the HTTP API.

Commands

From Telegram, Slack, or Discord, use /background status, /background list, /background show <task_id>, or /background notify list to look up a finished RCA. Starting investigations, promoting an RCA with /background use, and changing channels remain shell-only. The completion notification includes the task ID needed for /background show. There is no opensre background … CLI command. Background mode is interactive shell only.

Typical flow

  1. Start the interactive shell (opensre).
  2. Turn on background mode:
  1. Choose where the finished RCA is delivered. Channels start empty — if you skip this step, no notification is sent:
Channels are remembered, so you only set them once.
  1. Start an investigation:
or paste a fresh alert in free text.
  1. Keep using the shell while the RCA runs. You can check progress with /background list or /tasks, and stop a run with /cancel <task_id>.
  2. When it completes:
    • Inspect it with /background show <task_id>
    • Adopt it as active follow-up context with /background use <task_id>

What a completed job stores

Each finished background job keeps:
  • Root cause
  • Top analysis items
  • Recommended next steps
  • Internal stats:
    • Tool call count
    • Investigation loop count
    • Validity score
/background show <task_id> prints status, command, root cause, top analysis, next steps, and notify results. It does not print the internal stats table. Those stats are included in notification messages (email, Telegram, Rocket.Chat, Buzz) when a channel is configured.

Completion notifications

Notifications are off by default. Set channels with /background notify set. All channels send the same summary structure: Root cause, Top analysis, What to do next, plus a short internal stats section. Telegram, Rocket.Chat, and Buzz messages are plain text and are capped at the 4,096-character limit (sections may be shortened to fit). Email can carry a fuller version of the same content. Check what was delivered with /background show <task_id>. The notify row shows one result per channel — sent, failed: <error>, or a setup hint such as missing telegram integration: TELEGRAM_BOT_TOKEN is not set.
A notification problem never fails the investigation. If a channel is missing or delivery errors, the RCA still completes, stays in /background list, and can still be promoted with /background use.
Slack and Discord are not supported as background notification channels. If you set them, the notification result will show unsupported.

Scheduled Tasks (Cron)

Recurring scheduled tasks created with opensre cron add execute automatically in the background while the scheduler daemon (opensre cron start) or gateway is running.
If no scheduler process is running, configured tasks will never fire and no execution history or delivery will appear. Start the daemon with opensre cron start or run opensre gateway start to ensure your tasks execute.
Cron delivery supports a different set of providers than background notifications:
  • List active cron tasks: Run opensre cron list to view all configured tasks and their next fire times.
  • View execution history: Use opensre cron logs <task_id> to see the execution history, statuses, and any errors for a specific task.
  • Interactive shell loops: If you use /loops add, you can check their status using /loops and view recent messages with /loops messages.
For a deep dive into the scheduling system, refer to the Scheduled Deliveries (Cron) documentation.
Product Gaps & Proactive DeliveryProactive Slack delivery and further enhancements to chat-based monitoring are currently tracked in product task T-SR-12. These gaps will be addressed as part of that upstream work.

Session lifecycle

  • Jobs are not saved across REPL restarts. Exiting the process stops in-flight work and clears tracked jobs.
  • /new clears tracked jobs and turns background mode off. Notification channel preferences are kept (like trust mode), until you change them with /background notify set.
  • Completing a job does not automatically replace your active follow-up context. Run /background use <task_id> to promote a finished RCA.

Current limits

  • investigations can only be started from the interactive shell; chat can look them up but not launch one, and there is no opensre background … CLI command
  • in-flight jobs stop if the shell exits; only completed RCAs are kept
  • /background use needs the shell, because the full investigation state it promotes is not part of what gets kept
  • completion does not automatically replace your active follow-up context
  • you must run /background use <task_id> to promote a finished RCA

Who can see a completed RCA

Completed RCAs belong to your organization, not to you personally: anyone who can message the bot for the same organization can list them and read them. Keep that in mind if an investigation touches something you would not post in a team channel.