Skip to main content
Guides Last updated: 6 March 2026

Module map

This page is a high-level map of Untether’s internal modules: what they do and how they fit together.

This page is a high-level map of Untether’s internal modules: what they do and how they fit together.

Entry points

ModuleResponsibility
cli.pyTyper CLI entry point; loads settings, selects engine/transport, runs the transport backend.
telegram/backend.pyTelegram transport backend: validates config, runs onboarding, builds and runs the Telegram bridge.

Orchestration and routing

ModuleResponsibility
runner_bridge.pyTransport-agnostic orchestration: per-message handler, progress updates, final render, cancellation, resume coordination.
router.pyAuto-router: resolves resume tokens by polling runners; selects a runner for a message.
scheduler.pyPer-thread FIFO job queueing with serialization.
transport_runtime.pyFacade used by transports and commands to resolve messages and runners without importing internal router/project types.

Domain model and events

ModuleResponsibility
model.pyDomain types: resume tokens, events, actions, run results.
runner.pyRunner protocol and event queue utilities.
events.pyEvent factory helpers for building Untether events consistently.

Rendering and progress

ModuleResponsibility
progress.pyProgress tracking: reduces untether events into progress snapshots.
markdown.pyMarkdown formatting for progress/final messages; includes helpers like elapsed formatting.
presenter.pyPresenter protocol: converts ProgressState into transport-specific messages.
transport.pyTransport protocol: send/edit/delete abstractions and message reference types.

Telegram implementation

ModuleResponsibility
telegram/bridge.pyTelegram bridge loop: polls updates, filters messages, dispatches handlers, coordinates cancellation.
telegram/client.pyTelegram API wrapper with retry/outbox semantics.
telegram/render.pyTelegram markdown rendering and trimming.
telegram/onboarding.pyInteractive setup and setup validation UX.
telegram/commands/*In-chat command handlers (/agent, /file, /topic, /ctx, /new, …).

Plugins

ModuleResponsibility
plugins.pyEntrypoint discovery and lazy loading (capture load errors, filter by enabled list).
engines.pyEngine backend discovery and loading via entrypoints.
transports.pyTransport backend discovery and loading via entrypoints.
commands.pyCommand backend discovery and loading via entrypoints; command execution helpers.
ids.pyShared ID regex and collision checks for plugin ids and Telegram command names.
api.pyPublic plugin API boundary (untether.api re-exports).

Runners and schemas

ModuleResponsibility
runners/*Engine runner implementations (Codex, Claude Code, OpenCode, Pi).
schemas/*msgspec schemas / decoders for engine JSONL streams.

Configuration and persistence

ModuleResponsibility
settings.pyLoads untether.toml (TOML + env), validates with pydantic-settings.
config_store.pyRaw TOML read/write (merge/update without clobbering extra sections).
config_migrations.pyOne-time edits to on-disk config (e.g. legacy Telegram key migration).

Utilities

ModuleResponsibility
utils/paths.pyPath/command relativization helpers.
utils/streams.pyAsync stream helpers (iter_bytes_lines, stderr draining).
utils/subprocess.pySubprocess management helpers (terminate/kill best-effort).
Was this helpful?

Related Articles