{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://raw.githubusercontent.com/cortexkit/magic-context/master/assets/magic-context.schema.json", "title": "Magic Context Configuration", "description": "Configuration schema for the @cortexkit/opencode-magic-context plugin. Place as magic-context.jsonc in your project root or ~/.config/opencode/.", "type": "object", "properties": { "enabled": { "default": true, "description": "Enable magic context (default: true)", "type": "boolean" }, "auto_update": { "description": "Enable automatic npm self-update checks for the OpenCode plugin. Security: USER-only in config loader, so hostile project configs cannot suppress updates.", "type": "boolean" }, "language": { "description": "Output language for Magic Context's generated content and guidance, as a 2-letter ISO 639-1 code (e.g. \"tr\", \"es\", \"de\", \"ja\", \"pt\"). When set, the historian, dreamer, sidekick, and the agent-guidance block instruct the model to write its PROSE in this language while keeping all structural tokens (XML tags, the five memory category names, code identifiers, file paths) in English. USER-LEVEL ONLY (ignored in project config for security). Unset = today's behavior (model mirrors the conversation; English scaffolding). Changing it triggers one cache re-materialization; existing compartments/memories keep their original language until naturally rewritten.", "type": "string" }, "ctx_reduce_enabled": { "default": true, "description": "When false, ctx_reduce tool is hidden, all nudges disabled, and prompt guidance about ctx_reduce stripped. Heuristic cleanup, compartments, memory, and other features still work. (default: true)", "type": "boolean" }, "historian": { "description": "Historian agent configuration (model, fallback_models, variant, temperature, maxTokens, permission, two_pass, etc.)", "type": "object", "properties": { "model": { "description": "Primary model ID (e.g. 'claude-sonnet-4-6')", "type": "string" }, "temperature": { "description": "Sampling temperature (0-2)", "type": "number", "minimum": 0, "maximum": 2 }, "top_p": { "description": "Nucleus sampling top_p (0-1)", "type": "number", "minimum": 0, "maximum": 1 }, "prompt": { "description": "Additional system prompt text", "type": "string" }, "tools": { "description": "Tool enable/disable overrides", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "boolean" } }, "disable": { "description": "Disable this agent", "type": "boolean" }, "description": { "description": "Agent description", "type": "string" }, "mode": { "description": "Agent mode (subagent, primary, or all)", "type": "string", "enum": [ "subagent", "primary", "all" ] }, "color": { "description": "Hex color for the agent (e.g. '#a1b2c3')", "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, "maxSteps": { "description": "Maximum tool-call steps per invocation", "type": "number" }, "permission": { "description": "Per-tool permission overrides", "type": "object", "properties": { "edit": { "type": "string", "enum": [ "ask", "allow", "deny" ] }, "bash": { "anyOf": [ { "type": "string", "enum": [ "ask", "allow", "deny" ] }, { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string", "enum": [ "ask", "allow", "deny" ] } } ] }, "webfetch": { "type": "string", "enum": [ "ask", "allow", "deny" ] }, "doom_loop": { "type": "string", "enum": [ "ask", "allow", "deny" ] }, "external_directory": { "type": "string", "enum": [ "ask", "allow", "deny" ] } } }, "maxTokens": { "description": "Maximum output tokens", "type": "number" }, "variant": { "description": "OpenCode reasoning variant (e.g. for extended thinking)", "type": "string" }, "fallback_models": { "description": "Fallback model IDs if primary is unavailable", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "two_pass": { "default": false, "description": "Run a second editor pass over historian output to clean low-signal U: lines and cross-compartment duplicates. Adds ~1 extra API call and ~1.3x cost per historian run. Useful for models without extended thinking support. (default: false)", "type": "boolean" }, "thinking_level": { "description": "Pi only: explicit thinking level passed as --thinking to Pi historian subagent invocations. Required when using reasoning models (e.g. github-copilot/gpt-5.4) because Pi's default thinking-level resolution can pick a value the provider rejects. OpenCode users set variant instead. Valid: off | minimal | low | medium | high | xhigh", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "disallowed_tools": { "default": [], "description": "OpenCode only. Tools to REMOVE from the historian's default allow-list [read, aft_outline, aft_zoom, aft_search]. Applies to both historian and historian-editor agents. Use [\"*\"] to strip all tool definitions from the model request — this prevents weak instruction-following models (e.g. mistral-small-latest) from entering tool-calling loops. Individual tool names remove just that tool. Note: a user-supplied historian.permission override can re-allow a tool that disallowed_tools removed — disallowed_tools sets the baseline, permission overrides take precedence. (default: [])", "type": "array", "items": { "type": "string", "enum": [ "*", "read", "aft_outline", "aft_zoom", "aft_search" ] } } } }, "dreamer": { "description": "Dreamer agent + scheduling configuration (model, fallback_models, disable, schedule, tasks, etc.)", "type": "object", "properties": { "model": { "description": "Primary model ID (e.g. 'claude-sonnet-4-6')", "type": "string" }, "temperature": { "description": "Sampling temperature (0-2)", "type": "number", "minimum": 0, "maximum": 2 }, "top_p": { "description": "Nucleus sampling top_p (0-1)", "type": "number", "minimum": 0, "maximum": 1 }, "prompt": { "description": "Additional system prompt text", "type": "string" }, "tools": { "description": "Tool enable/disable overrides", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "boolean" } }, "disable": { "description": "Disable this agent", "type": "boolean" }, "description": { "description": "Agent description", "type": "string" }, "mode": { "description": "Agent mode (subagent, primary, or all)", "type": "string", "enum": [ "subagent", "primary", "all" ] }, "color": { "description": "Hex color for the agent (e.g. '#a1b2c3')", "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, "maxSteps": { "description": "Maximum tool-call steps per invocation", "type": "number" }, "permission": { "description": "Per-tool permission overrides", "type": "object", "properties": { "edit": { "type": "string", "enum": [ "ask", "allow", "deny" ] }, "bash": { "anyOf": [ { "type": "string", "enum": [ "ask", "allow", "deny" ] }, { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string", "enum": [ "ask", "allow", "deny" ] } } ] }, "webfetch": { "type": "string", "enum": [ "ask", "allow", "deny" ] }, "doom_loop": { "type": "string", "enum": [ "ask", "allow", "deny" ] }, "external_directory": { "type": "string", "enum": [ "ask", "allow", "deny" ] } } }, "maxTokens": { "description": "Maximum output tokens", "type": "number" }, "variant": { "description": "OpenCode reasoning variant (e.g. for extended thinking)", "type": "string" }, "fallback_models": { "description": "Fallback model IDs if primary is unavailable", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "tasks": { "default": { "map-memories": { "schedule": "0 2 * * *", "timeout_minutes": 20 }, "verify": { "schedule": "0 3 * * *", "timeout_minutes": 20 }, "verify-broad": { "schedule": "0 4 * * 0", "timeout_minutes": 20 }, "curate": { "schedule": "0 4 * * 0", "timeout_minutes": 20 }, "classify-memories": { "schedule": "0 6 * * *", "timeout_minutes": 20 }, "retrospective": { "schedule": "0 5 * * *", "timeout_minutes": 20 }, "maintain-docs": { "schedule": "", "timeout_minutes": 20 }, "evaluate-smart-notes": { "schedule": "0 3 * * *", "timeout_minutes": 20 }, "review-user-memories": { "schedule": "0 3 * * *", "timeout_minutes": 20, "promotion_threshold": 3 }, "promote-primers": { "schedule": "0 3 * * *", "timeout_minutes": 20, "promotion_threshold": 2 }, "refresh-primers": { "schedule": "0 3 * * *", "timeout_minutes": 20 } }, "type": "object", "properties": { "map-memories": { "default": { "schedule": "0 2 * * *", "timeout_minutes": 20 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 } } }, "verify": { "default": { "schedule": "0 3 * * *", "timeout_minutes": 20 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 } } }, "verify-broad": { "default": { "schedule": "0 4 * * 0", "timeout_minutes": 20 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 } } }, "curate": { "default": { "schedule": "0 4 * * 0", "timeout_minutes": 20 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 } } }, "classify-memories": { "default": { "schedule": "0 6 * * *", "timeout_minutes": 20 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 } } }, "retrospective": { "default": { "schedule": "0 5 * * *", "timeout_minutes": 20 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 } } }, "maintain-docs": { "default": { "schedule": "", "timeout_minutes": 20 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 } } }, "evaluate-smart-notes": { "default": { "schedule": "0 3 * * *", "timeout_minutes": 20 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 } } }, "review-user-memories": { "default": { "schedule": "0 3 * * *", "timeout_minutes": 20, "promotion_threshold": 3 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 }, "promotion_threshold": { "description": "review-user-memories: min candidate observations before promotion is considered (default: 3)", "type": "number", "minimum": 2, "maximum": 20 } } }, "promote-primers": { "default": { "schedule": "0 3 * * *", "timeout_minutes": 20, "promotion_threshold": 2 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 }, "promotion_threshold": { "description": "promote-primers: min recurring source days before promotion is considered (default: 2)", "type": "number", "minimum": 2, "maximum": 20 } } }, "refresh-primers": { "default": { "schedule": "0 3 * * *", "timeout_minutes": 20 }, "type": "object", "properties": { "schedule": { "default": "", "type": "string", "description": "5-field cron schedule (e.g. \"0 3 * * *\"), or \"\" to disable this task." }, "model": { "description": "Per-task model override (inherits dreamer.model)", "type": "string" }, "fallback_models": { "description": "Per-task fallback chain (inherits dreamer.fallback_models)", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "thinking_level": { "description": "Pi only: per-task thinking level", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] }, "timeout_minutes": { "default": 20, "description": "Minutes allowed for this task before it is aborted", "type": "number", "minimum": 5 } } } }, "description": "Per-task scheduling + model config. Each task has its own cron schedule and may override the dreamer-level model." }, "inject_docs": { "default": true, "description": "Inject ARCHITECTURE.md and STRUCTURE.md into system prompt", "type": "boolean" }, "thinking_level": { "description": "Pi only: default thinking level for dreamer subagent invocations. See historian.thinking_level.", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] } } }, "cache_ttl": { "default": "5m", "description": "Cache TTL: string (e.g. \"5m\") or per-model object ({ default: \"5m\", \"model-id\": \"10m\" })", "anyOf": [ { "type": "string" }, { "type": "object", "properties": { "default": { "type": "string" } }, "required": [ "default" ], "additionalProperties": { "type": "string" } } ] }, "toast_duration_ms": { "default": 5000, "description": "TUI toast lifetime in milliseconds for Magic Context notifications. Set to 0 to disable Magic Context toasts entirely (min: 0, max: 60000, default: 5000)", "type": "number", "minimum": 0, "maximum": 60000 }, "execute_threshold_percentage": { "default": 65, "description": "Context percentage that forces queued operations to execute. Number or per-model object ({ default: 65, \"provider/model\": 45 }). Values above 80 are rejected because the runtime caps at 80% for cache safety (MAX_EXECUTE_THRESHOLD). Default: DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE", "anyOf": [ { "type": "number", "minimum": 20, "maximum": 80 }, { "type": "object", "properties": { "default": { "type": "number", "minimum": 20, "maximum": 80 } }, "required": [ "default" ], "additionalProperties": { "type": "number", "minimum": 20, "maximum": 80 } } ] }, "execute_threshold_tokens": { "description": "Absolute token thresholds per model. When matched, overrides execute_threshold_percentage for that model. Accepts `default` for all models or per-model keys. Values above 80% × context_limit are clamped with a warning log. Min 5_000, max 2_000_000.", "type": "object", "properties": { "default": { "type": "number", "minimum": 5000, "maximum": 2000000 } }, "additionalProperties": { "type": "number", "minimum": 5000, "maximum": 2000000 } }, "protected_tags": { "description": "Number of recent tags to protect from dropping (min: 1, max: 100, default: 20)", "type": "number", "minimum": 1, "maximum": 100 }, "clear_reasoning_age": { "default": 50, "description": "Clear reasoning/thinking blocks older than N tags (default: 50)", "type": "number", "minimum": 10 }, "history_budget_percentage": { "default": 0.15, "description": "Fraction of usable context (context_limit × execute_threshold) reserved for the session history block (default: 0.15)", "type": "number", "minimum": 0.05, "maximum": 0.5 }, "historian_timeout_ms": { "default": 300000, "description": "Timeout for each historian prompt call in milliseconds (default: 300000)", "type": "number", "minimum": 60000 }, "commit_cluster_trigger": { "default": { "enabled": true, "min_clusters": 3 }, "description": "Commit-cluster trigger: fire historian when enough commit clusters accumulate in the unsummarized tail", "type": "object", "properties": { "enabled": { "default": true, "description": "Enable commit-cluster based historian triggering (default: true)", "type": "boolean" }, "min_clusters": { "default": 3, "description": "Minimum commit clusters required to trigger historian (min: 1, default: 3)", "type": "number", "minimum": 1 } } }, "system_prompt_injection": { "default": { "enabled": true, "skip_signatures": [ "" ] }, "description": "Controls whether and where Magic Context augments the system prompt. Lets users opt specific agents out of the Magic Context guidance and the surrounding project-docs / user-profile blocks. OpenCode's internal hidden agents — title, summary, and compaction — are always skipped automatically.", "type": "object", "properties": { "enabled": { "default": true, "description": "When false, NO injection happens for ANY agent — global escape hatch. (default: true)", "type": "boolean" }, "skip_signatures": { "default": [ "" ], "description": "Substring opt-out list. If the agent's system prompt contains any of these strings, skip ALL Magic Context injection for that call. Default \"\" is meant to be added inside a user's custom agent prompt to opt that agent out.", "type": "array", "items": { "type": "string" } } } }, "sqlite": { "default": { "cache_size_mb": 64, "mmap_size_mb": 0 }, "description": "SQLite connection tuning for Magic Context's own context.db. These are per-connection PRAGMAs applied at open; they do not change the schema or what is stored.", "type": "object", "properties": { "cache_size_mb": { "default": 64, "description": "Page-cache size in MiB per connection (PRAGMA cache_size). Larger keeps more hot pages resident, cutting re-reads on repeated full-table scans. (min 2, max 2048, default 64)", "type": "number", "minimum": 2, "maximum": 2048 }, "mmap_size_mb": { "default": 0, "description": "Memory-mapped I/O size in MiB (PRAGMA mmap_size). 0 disables mmap (SQLite default). Raising it can cut read overhead on large DBs at the cost of address space. (min 0, max 8192, default 0)", "type": "number", "minimum": 0, "maximum": 8192 } } }, "embedding": { "description": "Embedding provider configuration", "type": "object", "properties": { "provider": { "default": "local", "description": "Embedding provider. 'local' uses Xenova/all-MiniLM-L6-v2, 'openai-compatible' requires endpoint and model, 'off' disables embeddings.", "type": "string", "enum": [ "local", "openai-compatible", "off" ] }, "model": { "description": "Embedding model name. Required for openai-compatible, ignored for local.", "type": "string" }, "endpoint": { "description": "API endpoint URL. Required when provider is openai-compatible.", "type": "string" }, "api_key": { "description": "API key for remote embedding provider (optional)", "type": "string" }, "input_type": { "description": "Default input_type for stored/indexed (passage) embeddings in the request body. Required by some openai-compatible providers (e.g. NVIDIA NIM). Omitted from the request when unset.", "type": "string" }, "query_input_type": { "description": "Optional input_type for query (search) embeddings on asymmetric models (e.g. NVIDIA NIM 'query'). When unset, query embeddings use embedding.input_type. Passage/stored content always uses embedding.input_type.", "type": "string" }, "truncate": { "description": "Optional truncate mode sent in the embedding request body (e.g. NVIDIA NIM accepts 'NONE' | 'START' | 'END'). Omitted from the request when unset.", "type": "string" }, "max_input_tokens": { "description": "Optional maximum input tokens for chunk embeddings. Defaults conservatively to 512 when omitted.", "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 } } }, "temporal_awareness": { "default": true, "description": "Inject wall-clock gap markers () between user messages where > 5 min elapsed since the previous message, and add start/end date attributes on compartments. Gives the agent a sense of session pacing and \"how long ago\" across multi-day sessions. Graduated from experimental.temporal_awareness; default: true (set false to opt out).", "type": "boolean" }, "keep_subagents": { "default": false, "description": "Debug: keep the child sessions Magic Context spawns for its own subagents (historian, dreamer, sidekick, memory-migration) instead of deleting them on success. Useful for short-term inspection/data collection — their full transcript (prompt, tool calls, token usage, output) stays in the host session store. Kept sessions accumulate until manually cleared; leave false for normal use. Requires a restart to take effect.", "type": "boolean" }, "smart_drops": { "default": false, "description": "Content-aware reclaim of provably-superseded tool output, layered on the existing execute-pass auto-drop. When on: superseded todowrite (keep newest 1), spent ctx_reduce (keep newest 5), and zero-value meta (bash_status, bash_kill, ctx_note read/dismiss) outputs are dropped; older edits to a file are compressed to a filePath-preserving marker while the newest edit per file stays full. Only acts on passes already busting the cache, so it never originates a cache bust. Honors the protected-tag reserve. Experimental: opt-in, default off until cache stability is proven; when off the wire is byte-identical to the positional-only reclaim. Requires a restart.", "type": "boolean" }, "caveman_text_compression": { "default": { "enabled": false, "min_chars": 500 }, "description": "Age-tier caveman compression for long user/assistant text parts. Only active when ctx_reduce_enabled is false. Oldest 20% of eligible tags (outside protected tail) go to ultra, next 20% to full, next 20% to lite, newest 40% untouched. Graduated from experimental.caveman_text_compression; opt-in, default off (lossy).", "type": "object", "properties": { "enabled": { "default": false, "description": "Apply deterministic caveman-style text compression to old conversation text. Only active when ctx_reduce_enabled=false. Compresses user/assistant text in oldest-first tiers: ultra (oldest 20%), full, lite, untouched (newest 40%).", "type": "boolean" }, "min_chars": { "default": 500, "description": "Text parts shorter than this (characters) stay untouched. Min 100, max 10000. Default: 500.", "type": "number", "minimum": 100, "maximum": 10000 } } }, "memory": { "default": { "enabled": true, "injection_budget_tokens": 4000, "auto_promote": true, "retrieval_count_promotion_threshold": 3, "auto_search": { "enabled": true, "score_threshold": 0.6, "min_prompt_chars": 20 }, "git_commit_indexing": { "enabled": false, "since_days": 365, "max_commits": 2000 } }, "description": "Cross-session memory configuration", "type": "object", "properties": { "enabled": { "default": true, "description": "Enable cross-session memory (default: true)", "type": "boolean" }, "injection_budget_tokens": { "default": 4000, "description": "Token budget for memory injection on session start (min: 500, max: 20000, default: 4000)", "type": "number", "minimum": 500, "maximum": 20000 }, "auto_promote": { "default": true, "description": "Automatically promote eligible session facts into memory (default: true)", "type": "boolean" }, "retrieval_count_promotion_threshold": { "default": 3, "description": "retrieval_count threshold for promoting memory to permanent status (min: 1, default: 3)", "type": "number", "minimum": 1 }, "auto_search": { "default": { "enabled": true, "score_threshold": 0.6, "min_prompt_chars": 20 }, "description": "Auto-search hint: transform-time ctx_search on each new user message; when the top hit clears the threshold, append a compact block of vague fragments to that user message. Does NOT inject full content. Graduated from experimental.auto_search; enabled by default (set enabled: false to opt out). Independent of memory.enabled.", "type": "object", "properties": { "enabled": { "default": true, "description": "Automatically append a compact to eligible user messages when relevant memories, conversation, or commits are found. Graduated from experimental.auto_search; on by default (set false to opt out). Independent of memory.enabled.", "type": "boolean" }, "score_threshold": { "default": 0.6, "description": "Top hit score must exceed this threshold for the hint to fire (min: 0.3, max: 0.95, default: 0.60)", "type": "number", "minimum": 0.3, "maximum": 0.95 }, "min_prompt_chars": { "default": 20, "description": "Skip hint when user message is shorter than this (min: 5, max: 500, default: 20)", "type": "number", "minimum": 5, "maximum": 500 } } }, "git_commit_indexing": { "default": { "enabled": false, "since_days": 365, "max_commits": 2000 }, "description": "Index git commit messages from HEAD into ctx_search. Commits become a 4th searchable source alongside memories and session history. Graduated from experimental.git_commit_indexing; opt-in, default off (per-project embedding cost). Independent of memory.enabled.", "type": "object", "properties": { "enabled": { "default": false, "description": "Index HEAD git commits for ctx_search (git_commit source). Graduated from experimental.git_commit_indexing; opt-in, default off. Independent of memory.enabled.", "type": "boolean" }, "since_days": { "default": 365, "description": "Days of HEAD history to index (min: 7, max: 3650, default: 365)", "type": "number", "minimum": 7, "maximum": 3650 }, "max_commits": { "default": 2000, "description": "Max commits kept per project; oldest evicted (min: 100, max: 20000, default: 2000)", "type": "number", "minimum": 100, "maximum": 20000 } } } } }, "sidekick": { "description": "Optional sidekick agent configuration for session-start memory retrieval", "type": "object", "properties": { "model": { "description": "Primary model ID (e.g. 'claude-sonnet-4-6')", "type": "string" }, "temperature": { "description": "Sampling temperature (0-2)", "type": "number", "minimum": 0, "maximum": 2 }, "top_p": { "description": "Nucleus sampling top_p (0-1)", "type": "number", "minimum": 0, "maximum": 1 }, "prompt": { "description": "Additional system prompt text", "type": "string" }, "tools": { "description": "Tool enable/disable overrides", "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "boolean" } }, "disable": { "description": "Disable this agent", "type": "boolean" }, "description": { "description": "Agent description", "type": "string" }, "mode": { "description": "Agent mode (subagent, primary, or all)", "type": "string", "enum": [ "subagent", "primary", "all" ] }, "color": { "description": "Hex color for the agent (e.g. '#a1b2c3')", "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, "maxSteps": { "description": "Maximum tool-call steps per invocation", "type": "number" }, "permission": { "description": "Per-tool permission overrides", "type": "object", "properties": { "edit": { "type": "string", "enum": [ "ask", "allow", "deny" ] }, "bash": { "anyOf": [ { "type": "string", "enum": [ "ask", "allow", "deny" ] }, { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string", "enum": [ "ask", "allow", "deny" ] } } ] }, "webfetch": { "type": "string", "enum": [ "ask", "allow", "deny" ] }, "doom_loop": { "type": "string", "enum": [ "ask", "allow", "deny" ] }, "external_directory": { "type": "string", "enum": [ "ask", "allow", "deny" ] } } }, "maxTokens": { "description": "Maximum output tokens", "type": "number" }, "variant": { "description": "OpenCode reasoning variant (e.g. for extended thinking)", "type": "string" }, "fallback_models": { "description": "Fallback model IDs if primary is unavailable", "anyOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "timeout_ms": { "default": 30000, "description": "Timeout for sidekick calls in milliseconds", "type": "number" }, "system_prompt": { "description": "Custom system prompt for sidekick", "type": "string" }, "thinking_level": { "description": "Pi only: explicit thinking level for sidekick subagent invocations. See historian.thinking_level.", "type": "string", "enum": [ "off", "minimal", "low", "medium", "high", "xhigh" ] } } }, "$schema": { "type": "string", "description": "JSON Schema reference for editor validation and autocomplete." } }, "additionalProperties": false }