

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# src/features/background-agent/ — Core Orchestration Engine23**Generated:** 2026-05-2045## OVERVIEW6745 non-test files. Manages async task lifecycle: launch → queue → run → poll → complete/error. Concurrency limited per model/provider (default 5). Central to multi-agent orchestration.89## TASK LIFECYCLE1011```12LaunchInput → pending → [ConcurrencyManager queue] → running → polling → completed/error/cancelled/interrupt13```1415## KEY FILES1617| File | Purpose |18|------|---------|19| `manager.ts` | `BackgroundManager` — main class: launch, cancel, getTask, listTasks |20| `spawner.ts` | Task spawning: create session → inject prompt → start polling |21| `concurrency.ts` | `ConcurrencyManager` — FIFO queue per concurrency key, slot acquisition/release |22| `task-poller.ts` | 3s interval polling, completion via idle events + stability detection (10s unchanged) |23| `types.ts` | `BackgroundTask`, `LaunchInput`, `ResumeInput`, `BackgroundTaskStatus` |24| `parent-wake-notifier.ts` | 587 LOC. Dependency-injected client + enqueue callback. Notifies parent session when a background task wants attention. |25| `loop-detector.ts` | Detects polling/event loops that would otherwise burn budget. |26| `error-classifier.ts` | Maps raw provider errors → `BackgroundTaskError` categories. |27| `fallback-retry-handler.ts` | Coordinates retries with the runtime-fallback system. |28| `process-cleanup.ts` | Best-effort cleanup on parent exit. `OMO_DISABLE_PROCESS_CLEANUP=1` opts out entirely. |29| `subagent-spawn-limits.ts` | Enforces per-parent subagent spawn caps. |30| `session-status-classifier.ts` | Normalizes OpenCode session status across versions. |31| `compaction-aware-message-resolver.ts` | Resolves task result content even across mid-task compaction. |32| `attempt-lifecycle.ts` | Tracks retry attempts on a single task. |33| `task-history.ts` | Append-only history for completed tasks. |34| `session-idle-event-handler.ts` | Bridges OpenCode `session.idle` → task-poller completion signal. |35| `session-existence.ts` | Cheap existence check used by recovery code. |36| `abort-with-timeout.ts` | Force-abort tasks past `syncPollTimeoutMs`. |37| `remove-task-toast-tracking.ts` | Strips lingering toast tracker entries on task end. |38| `background-task-notification-template.ts` | Template for parent-session result injection. |3940## SPAWNER SUBDIRECTORY4142| File | Purpose |43|------|---------|44| `spawner-context.ts` | `SpawnerContext` interface composing all spawner deps |45| `background-session-creator.ts` | Create OpenCode session for background task |46| `concurrency-key-from-launch-input.ts` | Derive concurrency key from model/provider |47| `tmux-callback-invoker.ts` | Notify TmuxSessionManager on session creation |4849## COMPLETION DETECTION5051Two signals combined:521. **Session idle event** — OpenCode reports session became idle532. **Stability detection** — message count unchanged for 10s (3+ stable polls at 3s interval)5455Both must agree before marking a task complete. Prevents premature completion on brief pauses.5657## CONCURRENCY MODEL5859- Key format: `{providerID}/{modelID}` (e.g., `anthropic/claude-opus-4-7`)60- Default limit: 5 concurrent per key (configurable via `background_task` config)61- FIFO queue: tasks wait in order when slots full62- Slot released on: completion, error, cancellation6364## NOTIFICATION FLOW6566```67task completed → result-handler → parent-session-notifier → inject system message into parent session68```69
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/tools/look-at/AGENTS.md · 68k | AGENTS.md | arch | 68/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentassets/AGENTS.md · 68k | AGENTS.md | buildteststylearch | 88/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/AGENTS.md · 68k | AGENTS.md | buildtestlint-formatstyle+3 | 83/100 | today | |
| code-yeongyu/oh-my-openagentpackages/omo-codex/plugin/components/ultrawork/AGENTS.md · 68k | AGENTS.md | buildteststylearch+1 | 77/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/tools/background-task/AGENTS.md · 68k | AGENTS.md | arch | 70/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/agents/sisyphus/AGENTS.md · 68k | AGENTS.md | arch | 56/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/hooks/ralph-loop/AGENTS.md · 68k | AGENTS.md | arch | 62/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/hooks/rules-injector/AGENTS.md · 68k | AGENTS.md | archdo-not | 69/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/hooks/runtime-fallback/AGENTS.md · 68k | AGENTS.md | stylearchtypes | 70/100 | 13 days ago | |
| code-yeongyu/oh-my-openagent.agents/AGENTS.md · 68k | AGENTS.md | stylearchtesting-strategydatabase | 64/100 | 13 days ago | |
| code-yeongyu/oh-my-openagent.opencode/AGENTS.md · 68k | AGENTS.md | stylearchdo-not | 71/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentAGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+11 | 84/100 | today | |
| code-yeongyu/oh-my-openagentpackages/agents-md-core/AGENTS.md · 68k | AGENTS.md | archdependenciesapi | 48/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/ast-grep-mcp/AGENTS.md · 68k | AGENTS.md | buildstylearchdependencies+1 | 78/100 | 7 days ago | |
| code-yeongyu/oh-my-openagentpackages/boulder-state/AGENTS.md · 68k | AGENTS.md | archapi | 48/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/claude-code-compat-core/AGENTS.md · 68k | AGENTS.md | archagent-behaviour | 56/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/comment-checker-core/AGENTS.md · 68k | AGENTS.md | archdependenciesapi | 48/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/delegate-core/AGENTS.md · 68k | AGENTS.md | stylearchdependenciesapi | 60/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/git-bash-mcp/AGENTS.md · 68k | AGENTS.md | buildtestlint-formatarch+1 | 82/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/hashline-core/AGENTS.md · 68k | AGENTS.md | archtypesdependenciesapi | 48/100 | 13 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| aaif-goose/gooseAGENTS.md · 53k | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 8 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/code-yeongyu-oh-my-openagent-packages-omo-opencode-src-features-background-agent-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.