Imported from quantmind-br/omo-profiler (
internal/config/AGENTS.md). Install upstream withnpx skills add quantmind-br/omo-profiler --skill config. Copyright stays with the author.
INTERNAL/CONFIG
OVERVIEW
Omo document helpers, [opencode] type authority, and path resolution. Source of Truth for the flat config.Config shape (the [opencode] harness block) and for reading/writing the unified ~/.omo/omo.json / omo.jsonc document via Document.
FILES
| File | Role |
|---|---|
types.go |
Config struct + nested structs (46 top-level fields = the [opencode] block) |
document.go |
Document — load/save omo.json(c), profile block CRUD, Mutate/MutateWithPreSave transactions, WriteFileAtomic |
jsonc.go |
StripJSONC — JSONC → JSON (comments/trailing commas blanked) |
paths.go |
OmoDir, OmoFile, ModelsFile, legacy migration helpers, EnsureDirs |
paths_test.go |
Path resolution + SetBaseDir isolation tests |
types_test.go |
Schema compliance + round-trip serialization tests |
SCHEMA SAFETY
types.go is CRITICAL:
- JSON Tags: Must match the
[opencode]sub-schema keys exactly - Pointers: Use
*boolto distinguishfalsefrom "missing" - No Logic: Structs must remain pure data containers; no methods
- Synchronization: Fields must stay in sync with upstream
[opencode]schema - omitempty: All JSON tags require
omitemptyto avoid dirty config files
Config is not the whole omo file — it models only the [opencode] block (and each profile's profiles.<name>.[opencode] override).
KEY TYPES
Config: Flat[opencode]container. 46 top-level fields includingAgents map[string]*AgentConfig,Categories map[string]*CategoryConfig,AgentOrder []stringDocument: Parsed omo.json/omo.jsonc; keeps every top-level key as raw JSON so harness blocks ([senpi],[codex]), shared typed keys, and future schema additions round-trip. Comments in.jsoncare not preserved across write (re-serialized as canonical JSON).AgentConfig: 25 fields — model, reasoning (canonical), variant/reasoningEffort (deprecated), prompt, tools, permissions, thinking config, displayNameCategoryConfig: 20 fields — model, models (canonical chain), reasoning, max_tokens, provider_options, warn_unavailable; legacy maxTokens/variant/reasoningEffort/fallback_models retainedThinkingConfig: Nested in agents/categories for reasoning budget controlExperimentalConfig: 12 fields — feature flags with deeply nestedDynamicContextPruningConfigBackgroundTaskConfig: 12 fields — circuit breaker, tool limits, depth controls, cleanup delayTeamModeConfig: 11 fields — multi-agent team mode (parallelism, message/wall-clock limits, mailbox)GitMasterConfig: 3 fields — commit footer, co-authored-by, env prefix (required at root level)TmuxConfig: 6 fields — layout, isolation, pane sizingSisyphusAgentConfig: 5 fields — TDD mode, replace plan, staleness controlKeywordDetectorConfig: 2 fields —enabled_expansionsallowlist +disabled_keywordsfor the keyword-detector hookClaudeCodeConfig: 8 fields — mcp, commands, skills, agents, hooks, plugins, plugins_override, anthropic_providerWebsearchConfig: 1 field — provider selectionMonitorConfig: 11 fields — output/log monitor subsystem (live mode, batch/ring buffers, runtime limits) — added v4.11.0CodegraphConfig: 8 fields — code-graph indexing subsystem (auto-init, auto-provision, daemon, excluded roots, install dir, telemetry, watch debounce) — daemon/excluded_roots added v4.19.2TuiConfig: 1 nested field — oh-my-openagent TUI sidebar toggle (TuiSidebarConfig.Enabled) — added v4.11.0GoalConfig: 3 fields — goal subsystem (enabled,auto_start,default_max_iterations) — added v4.19.0, replaces the old typedralph_loopConfig.RalphLoop:json.RawMessage— deprecated upstream compatibility shim (free-form record, migrated togoalby the plugin); preserved verbatim, not editable in the wizard
DOCUMENT KEYS
SchemaKey = "$schema"
ProfilesKey = "profiles"
OpenCodeKey = "[opencode]"
SenpiKey = "[senpi]"
CodexKey = "[codex]"
PATH RESOLUTION
OmoDir() → ~/.omo/
OmoFile() → ~/.omo/omo.jsonc if present, else ~/.omo/omo.json
ModelsFile() → ~/.omo/models.json // omo-profiler local state
EnsureDirs() → mkdir -p ~/.omo
LegacyConfigDir() → pre-unification OpenCode config dir // migration detection only
LegacyConfigFile() → legacy flat file if present, else ""
LegacyProfilesDir() → pre-unification profiles dir // migration detection only
DefaultSchema // assets/omo.schema.json on the upstream monorepo
Removed (do not reference): ConfigDir, ConfigFile, ProfilesDir, ConfigBasename, LegacyConfigBasename.
SetBaseDir(dir) / ResetBaseDir() — test-only hooks that redirect ALL paths under <tmp>/.omo/.
ANTI-PATTERNS
- Hardcoded Paths:
"/home/user/..."→ useOmoDir()/OmoFile()/ModelsFile() - Treating Config as the whole file:
Configis the[opencode]block only; useDocumentfor the omo file - File-per-profile: Profiles live at
profiles.<name>inside the document — there is no profiles directory - Direct Struct Access: Mutating
Configfields outsideprofilepackage - Missing Tags: Omitting
json:"...,omitempty"creates dirty config files - Logic in Types: Adding validation methods to
Config(keep it pure data) - Schema Drift: Adding fields that don't exist in upstream
[opencode]schema