Skip to main content
Forks let you branch your conversation into an isolated context. Explore a tangent, research something, or do focused work — then choose whether to keep the results, report a summary, or discard everything. Your main session stays clean either way.

Overview

ollim-bot has two fork types:
  • Interactive forks — you enter a branched conversation, talk to the agent, and choose how to exit. All messages route to the fork until you end it.
  • Background forks — the scheduler runs a task on a disposable forked session. Output is discarded by default; the agent uses ping_user, discord_embed, or report_updates to surface results.
Forks cannot be nested. You can only have one interactive fork at a time, though background forks run concurrently without blocking anything.

Interactive forks

Use /fork to start an interactive fork with an optional topic:
/fork topic:research meal prep options
If no topic is given, the agent waits for you to lead.
Interactive forks always enable extended thinking, regardless of the main session’s thinking setting. This gives the agent deeper reasoning for research and problem-solving in forks. When a fork starts, the bot sends a purple embed showing the topic (or “Open session”) along with three buttons for exiting:
ButtonStyleAction
Save ContextGreenPromotes fork to main session
ReportBlurpleReports summary, discards fork
Exit ForkRedDiscards fork, returns to main
While inside a fork, all your messages route to the forked session. Pending updates from background tasks are peeked (read-only) rather than cleared, so the main session still receives them when the fork ends.
Replying to a message sent by a background fork starts an interactive fork that resumes from that background fork’s session. This lets you pick up where a background task left off and continue the conversation interactively.

Exit strategies

Every interactive fork ends with one of three actions. You can trigger them via the buttons on the fork embed, or the agent can call the corresponding MCP tools directly.
Promotes the fork to the main session. The forked client replaces the main client, and the old main session is disconnected. All conversation history from the fork becomes the new main session.
  • Button: Save Context
  • MCP tool: save_context (no parameters)
Appends a short summary to ~/.ollim-bot/state/pending_updates.json and discards the fork. The summary is injected into the next main-session message, so you get the findings without the full context.
  • Button: Report (agent is prompted to call report_updates before exit)
  • MCP tool: report_updates(message)message is required
Clean discard. The fork is disconnected and the main session resumes as if the fork never happened. No context is preserved.
  • Button: Exit Fork
  • MCP tool: exit_fork (no parameters)
Use save when the fork produced context worth keeping (e.g., a plan, research results). Use report for lightweight findings. Use exit for throwaway exploration.

Idle timeout

Interactive forks have an idle timeout to prevent abandoned forks from blocking normal conversation. The default is 10 minutes, configurable via the idle_timeout parameter on enter_fork. The timeout works in two stages:
  1. First timeout — after idle_timeout minutes of inactivity, the scheduler prompts the agent to decide on an exit strategy. The agent may choose to save, report, or exit.
  2. Second timeout — if another idle_timeout period passes with no activity after the prompt, the agent receives a “you MUST exit” message. The agent always decides the final exit strategy; there is no forced auto-exit.
Activity is tracked by touch_activity(), which is called after each user interaction in the fork.

Background forks

Background forks run scheduled tasks (routines, reminders) on disposable forked sessions. They differ from interactive forks in several ways:
AspectInteractiveBackground
Started byUser (/fork) or agent (enter_fork)Scheduler (routines/reminders)
LockRequires agent.lock()Runs without lock
OutputStreamed to DiscordDiscarded (use ping_user/discord_embed to alert)
TimeoutIdle timeout (default 10 min)Hard timeout (30 minutes)
save_contextAvailableBlocked
report_updatesAvailableAvailable (controlled by update_main_session mode)
ConcurrencyOne at a timeMultiple can run concurrently
When the main session is busy at the time a background fork starts (lock held at launch), the fork runs in quiet mode — non-critical ping_user and discord_embed calls return errors, and the agent uses report_updates instead. For full background fork configuration (isolated mode, model overrides, tool restrictions, update_main_session modes, allow_ping), see Background forks.

Pending updates

Pending updates are the bridge between forks and the main session — when a fork calls report_updates(message), the summary gets prepended to the next main session interaction. See Context flow for the full pending updates cycle and update_main_session modes.

Next steps