04-worker-mode

04-worker-mode is an agent for coding agents from SmythOS/sre. It costs 0 tokens per session (2,561 once invoked), scanned A, original, MIT.

A way for an agent to send complex tasks to background copies of itself while staying available for other requests.

In plain words
What is it for?
Use it for lengthy research, code generation, or multi-step analysis that can run in the background.
Why use it?
Long research, analysis, or code-generation tasks do not have to hold up the main conversation. Simple tasks can still be handled directly.

Agent

About the project

SmythOS Runtime Environment is an open-source runtime and software development kit for building and running AI agents. Developers use it to create, orchestrate, and manage agents across local, cloud, and edge environments, with abstractions for language models, vector databases, storage, and caching. The catalogue add-ons support work with this runtime.

SmythOS/sre · 1,289 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/smythos/sre/04-worker-mode
Clone the repo
git clone --depth 1 https://github.com/SmythOS/sre

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 04-worker-mode

README.md
[![agentmods](https://agentmods.dev/badge/agents/smythos/sre/04-worker-mode.svg)](https://agentmods.dev/agents/smythos/sre/04-worker-mode)
Your own site
<a href="https://agentmods.dev/agents/smythos/sre/04-worker-mode"><img src="https://agentmods.dev/badge/agents/smythos/sre/04-worker-mode.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,561 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02561
Opus 5 $0.00000 $0.01281
Sonnet 5 $0.00000 $0.00512
Haiku 4.5 $0.00000 $0.00256

Measured 5d ago against content hash a448d79dea98, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

04-worker-mode scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/sdk/docs/agents/04-worker-mode.md · 317 lines

How it starts

The opening of the file, as written. The whole thing — 317 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Worker Mode

Worker mode allows an agent to dispatch complex, long-running tasks to background "copy" agents while the main agent stays fully interactive. When a worker finishes, its result is automatically surfaced back to the user through the main agent's conversation.

This mode is ideal when users submit tasks that take a while (research, code generation, multi-step analysis) and you want them to continue chatting or submit more tasks without blocking.

See the Worker Mode Example for a complete, runnable implementation.

Enabling Worker Mode

import { Agent, TAgentMode } from '@smythos/sdk';

const agent = new Agent({
    name: 'Research Assistant',
    behavior: 'You are a research assistant capable of handling complex tasks.',
    model: 'gpt-4o',
    mode: TAgentMode.WORKER,
});

How It Works

Task Dispatching

When the user asks for something complex, the main agent's LLM evaluates the request:

  • Simple tasks (quick questions, math, lookups): The agent answers directly — no worker needed.
  • Complex tasks (research, analysis, code generation): The agent dispatches the task to a background worker via the internal _sre_Worker_Dispatch skill.

The main agent immediately confirms the dispatch and remains available for new prompts.

Copy Agents

Each worker is a "copy" of the main agent — it shares the same skills and model but runs independently in its own chat session. The copy agent:

  • Preserves the original agent behavior (system prompt) defined by the developer
  • Gets all of the main agent's skills (except internal _sre_* skills)
  • Receives additional instructions appended to the behavior, telling it to use <worker_result> and <worker_question> tags for communication
  • Has no awareness of the main conversation — it only knows its assigned task

Worker Communication

Workers communicate back to the main agent through two tag-based protocols:

Read the full file on GitHub · 317 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 317 lines · 0 tokens per session scan A a448d79dea98

Subscribe to this mod's changes

04-worker-mode is an agent published in the GitHub repository SmythOS/sre (1,289 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,561 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.