diff --git a/docs/configurations.md b/docs/configurations.md index f5961631..1c7f8212 100644 --- a/docs/configurations.md +++ b/docs/configurations.md @@ -981,6 +981,34 @@ Available hooks: `todo-continuation-enforcer`, `context-window-monitor`, `sessio **Note on `auto-update-checker` and `startup-toast`**: The `startup-toast` hook is a sub-feature of `auto-update-checker`. To disable only the startup toast notification while keeping update checking enabled, add `"startup-toast"` to `disabled_hooks`. To disable all update checking features (including the toast), add `"auto-update-checker"` to `disabled_hooks`. +## Hashline Edit + +Oh My OpenCode replaces OpenCode's built-in `Edit` tool with a hash-anchored version that uses `LINE#ID` references (e.g. `5#VK`) instead of bare line numbers. This prevents stale-line edits by validating content hash before applying each change. + +Enabled by default. Set `hashline_edit: false` to opt out and restore standard file editing. + +```json +{ + "hashline_edit": false +} +``` + +| Option | Default | Description | +|--------|---------|-------------| +| `hashline_edit` | `true` | Enable hash-anchored `Edit` tool and companion hooks. When `false`, falls back to standard editing without hash validation. | + +When enabled, two companion hooks are also active: + +- **`hashline-read-enhancer`** — Appends `LINE#ID:content` annotations to `Read` output so agents always have fresh anchors. +- **`hashline-edit-diff-enhancer`** — Shows a unified diff in `Edit` / `Write` output for immediate change visibility. + +To disable only the hooks while keeping the hash-anchored Edit tool: + +```json +{ + "disabled_hooks": ["hashline-read-enhancer", "hashline-edit-diff-enhancer"] +} + ## Disabled Commands Disable specific built-in commands via `disabled_commands` in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`: diff --git a/src/config/AGENTS.md b/src/config/AGENTS.md index 48ce3301..7fd8ec58 100644 --- a/src/config/AGENTS.md +++ b/src/config/AGENTS.md @@ -17,7 +17,7 @@ config/schema/ ├── hooks.ts # HookNameSchema (46 hooks) ├── skills.ts # SkillsConfigSchema (sources, paths, recursive) ├── commands.ts # BuiltinCommandNameSchema -├── experimental.ts # Feature flags (plugin_load_timeout_ms min 1000, hashline_edit) +├── experimental.ts # Feature flags (plugin_load_timeout_ms min 1000) ├── sisyphus.ts # SisyphusConfigSchema (task system) ├── sisyphus-agent.ts # SisyphusAgentConfigSchema ├── ralph-loop.ts # RalphLoopConfigSchema @@ -34,9 +34,9 @@ config/schema/ └── internal/permission.ts # AgentPermissionSchema ``` -## ROOT SCHEMA FIELDS (26) +## ROOT SCHEMA FIELDS (27) -`$schema`, `new_task_system_enabled`, `default_run_agent`, `disabled_mcps`, `disabled_agents`, `disabled_skills`, `disabled_hooks`, `disabled_commands`, `disabled_tools`, `agents`, `categories`, `claude_code`, `sisyphus_agent`, `comment_checker`, `experimental`, `auto_update`, `skills`, `ralph_loop`, `background_task`, `notification`, `babysitting`, `git_master`, `browser_automation_engine`, `websearch`, `tmux`, `sisyphus`, `_migrations` +`$schema`, `new_task_system_enabled`, `default_run_agent`, `disabled_mcps`, `disabled_agents`, `disabled_skills`, `disabled_hooks`, `disabled_commands`, `disabled_tools`, `hashline_edit`, `agents`, `categories`, `claude_code`, `sisyphus_agent`, `comment_checker`, `experimental`, `auto_update`, `skills`, `ralph_loop`, `background_task`, `notification`, `babysitting`, `git_master`, `browser_automation_engine`, `websearch`, `tmux`, `sisyphus`, `_migrations` ## AGENT OVERRIDE FIELDS (21)