diff options
| author | Adam Malczewski <[email protected]> | 2026-03-28 05:15:49 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-03-28 05:15:49 +0900 |
| commit | ff4fd494811d326986cfe0305f35b89e37dd493c (patch) | |
| tree | 947209f20098279b1b334db653300f1e3bb43aa6 /.rules/changelog | |
| parent | be2dee39e5bf907dfdd3462817203a08cf3c345f (diff) | |
| download | ai-pulse-obsidian-plugin-ff4fd494811d326986cfe0305f35b89e37dd493c.tar.gz ai-pulse-obsidian-plugin-ff4fd494811d326986cfe0305f35b89e37dd493c.zip | |
no=op validation, and red tool error messages
Diffstat (limited to '.rules/changelog')
| -rw-r--r-- | .rules/changelog/2026-03/28/05.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/.rules/changelog/2026-03/28/05.md b/.rules/changelog/2026-03/28/05.md new file mode 100644 index 0000000..e0cdf17 --- /dev/null +++ b/.rules/changelog/2026-03/28/05.md @@ -0,0 +1,22 @@ +# Changelog — 2026-03-28 / 05 + +## No-op edit validation and tool error styling + +### No-op edit detection (`src/tools.ts`, `src/ollama-client.ts`) + +- `executeEditFile` now rejects calls where `old_text === new_text` immediately with an error, preventing unnecessary file operations. +- Added `isNoOpEdit()` helper in `ollama-client.ts` that detects identical `old_text`/`new_text` for both `edit_file` and `batch_edit_file`. +- The agent loop skips the user approval prompt for no-op edits — the tool executes directly and returns the error without interrupting the user. + +### Red accents for tool errors (`src/chat-view.ts`, `styles.css`) + +- `appendToolCall` now detects when `event.result` starts with `"Error"` and adds the `ai-pulse-tool-call-error` CSS class to the tool call container. +- Added CSS rules for `.ai-pulse-tool-call-error` that change the border-left, header text, and result summary text from the default purple accent to red (`--text-error`). +- Applies universally to all tool errors across every tool type. + +### Files changed + +- `src/tools.ts` — Added `oldText === newText` guard in `executeEditFile`. +- `src/ollama-client.ts` — Added `isNoOpEdit()` function; updated approval condition in `chatAgentLoop`. +- `src/chat-view.ts` — Added error class detection in `appendToolCall`. +- `styles.css` — Added `.ai-pulse-tool-call-error` styling rules. |
