AGENT_PATTERNS

A reference guide of design patterns learned from several OmniSim agent demonstrations, covering choices that helped those agents work reliably.

In plain words
What is it for?
Use it when designing a new OmniLink agent or demo, especially to choose how perception and other agent components should be structured.
Why use it?
It records lessons from documented failure cases so new agent projects can start with established implementation guidance.

Agent

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/omnilink-tech/omnisim/agent_patterns
Clone the repo
git clone --depth 1 https://github.com/omnilink-tech/omnisim
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 4,964 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.04964
Opus 5 $0.00000 $0.02482
Sonnet 5 $0.00000 $0.00993
Haiku 4.5 $0.00000 $0.00496

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

Security

Grade A, and why

AGENT_PATTERNS 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 3d 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.

agents/AGENT_PATTERNS.md · 248 lines

How it starts

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

Cross-demo design patterns extracted from the OmniSim agent builds (husky_maze, mission_captain, warehouse_foreman, warehouse_patrol). These are the choices that paid off — each one earned its place by being the lesson learned from a specific failure mode documented in that demo's docs/RESULTS.md.

On the warehouse_* citations below. The Warehouse Foreman, Warehouse Picker and Patrol Squad demos were removed from the tree on 2026-07-19 (their results predated the b18bd7a3 teleport-recovery removal and were never re-measured). The citations are kept because they are the provenance of these patterns — each names the run that produced the lesson. They are historical references, not paths you can open; recover them from git history if you need the detail. The patterns themselves are live and apply to every new agent.

This is the doc to read before starting a new agent. The default for every new demo should be: do the thing this doc recommends; if you need to deviate, write down why in the demo's docs.


1. Perception-as-tool, not pixels-to-LLM

Pattern. Vision belongs in a sidecar process that runs deterministic image analysis and exposes a structured-tag API. The agent calls a tool, gets back JSON like {tag_color: "green", marker_fraction: 0.0038, marker_centroid: {x_norm: 0.49, y_norm: 0.62}}. The agent NEVER sees pixels in the steady-state path.

Why. A 320×240 PNG attached as image_url part costs ~12 k input tokens. A structured tag digest is ~80 tokens. 150× per-query difference. Plus: deterministic across runs (the LLM may misread on any given snap), preserves cacheability (the per-turn input doesn't drown out the cacheable system prefix), and faster (no LLM-pixel-decoding latency).

How.

  • Eye sidecar process (e.g. husky_eye) owns the OmniSim Camera. Pure-Python BGRA classifier returns {tag_color, marker_pixels, marker_fraction, marker_centroid, color_fractions, ...} per camera view.
  • Bridge proxies sidecar /scan so the agent only knows about one HTTP target.
  • Agent gets a scan_for_tag (or scan_surroundings etc.) tool with description like "PREFERRED tag-identification tool — never sends pixels to you. ~150× cheaper than read_camera."
  • Keep read_camera as an explicit FALLBACK tool for genuinely ambiguous frames. Discriminator argument still holds (the agent CAN read pixels when the structured digest is uncertain), the cost story still holds (agents prefer the cheap path).

Read the full file on GitHub · 248 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. 3d ago First seen · 248 lines · 0 tokens per session scan A ae18874198db

Subscribe to this mod's changes

AGENT_PATTERNS is an agent published in the GitHub repository omnilink-tech/omnisim (82 stars, last pushed 3d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 4,964 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.