Repository navigation
feat(tools): indentation-tolerant matching and stale-read detection for Edit/MultiEdit - #608
Merged
Merged
Conversation
… finish (#609) ## Summary This PR fixes the overlap between tool approval and execution - previously, tools only started executing *after* all approvals were collected, wasting time. Now each approved tool runs immediately as the user approves it, and tools run concurrently. ### Changes 1. **fix(agent): execute approved tools concurrently while approving the rest** (d5598e2) - Approval prompts stay sequential, but each approved tool"'s execution is spawned immediately - Tools run in parallel (bounded by `agent.max_concurrent_tools`) - Results are recorded in index-keyed slots and flushed to the conversation in tool-call order 2. **fix(agent): freeze per-tool ticker when an approved tool finishes** (5caa035) - `executeToolInternal` publishes its own terminal completed/failed status via a `defer` - The per-tool elapsed-time ticker freezes the moment the tool finishes - Removes redundant external publishes from `executeToolCallsParallel` to avoid double-publish flickering 3. **fix(tui): refresh conversation history when a tool finishes executing** (0906249) - Tool coordinator now emits an `UpdateHistoryEvent` on completed/failed tool execution - Freshly flushed tool results replace their "Approved" placeholder immediately 4. **refactor: inject agent config directly into EventDrivenAgent** (44986f0) - Clean up how config is passed to the agent
inference-gateway-releaser Bot
pushed a commit
that referenced
this pull request
Jun 6, 2026
## [0.119.0](v0.118.0...v0.119.0) (2026-06-06) ### 🚀 Features * add npm wrapper to install and run the CLI via npx ([#610](#610)) ([8f24fd5](8f24fd5)), closes [inference-gateway/docs#182](inference-gateway/docs#182) * **tools:** indentation-tolerant matching and stale-read detection for Edit/MultiEdit ([#608](#608)) ([14d7e98](14d7e98)) ### 🐛 Bug Fixes * **agent:** execute approved tools concurrently and freeze tickers on finish ([#609](#609)) ([a713306](a713306)) ### 💄 Styles * replace em dashes with hyphens ([91a3746](91a3746)) ### 🧹 Maintenance * **deps:** bump codex 0.133.0 -> 0.135.0 ([#607](#607)) ([86af5fb](86af5fb)) * enable skills by default ([9440593](9440593)) * regenerate config ([991cd77](991cd77))
Contributor
|
🎉 This PR is included in version 0.119.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the
EditandMultiEdittools more robust for agent-driven editing. Two related changes:1. Indentation-tolerant matching
When an exact
old_stringmatch fails, the tools fall back to a whitespace-tolerant match instead of erroring. The fallback:new_stringto the file's actual indentation via a per-indent-level map.This fixes the common cases that made weaker models thrash on tab-indented Go: off-by-N tabs, tabs↔spaces, and column-0 header blocks (
type X struct {,func,import () with an indented body. The exact-match path, uniqueness guard, and MultiEdit atomicity are unchanged. A newtools.edit.strict_whitespaceoption (defaultfalse) disables the fallback for byte-exact-only matching. Normalized edits are surfaced in result metadata.2. Stale-read detection
The Read tool snapshots a file's modtime/size when it reads it. Before an
Edit/MultiEdit, the tool compares the file against that snapshot; if it changed since the last read (external modification), the edit is rejected with an explicit error telling the model to re-read first. The agent's own writes refresh the snapshot, so consecutive edits are not falsely rejected. Prevents the agent silently clobbering changes made under it.Key files
internal/agent/tools/flexmatch.go(new) — whitespace-tolerant matcher + per-indent re-indentation.internal/agent/tools/edit.go,multiedit.go— flexible fallback wiring + stale-read check.internal/agent/tools/registry.go,internal/services/tools.go— per-file read snapshots (record on Read, refresh on Edit/MultiEdit/Write).config/config.go—tools.edit.strict_whitespace.internal/domain/interfaces.go— additive result fields (WhitespaceNormalized,NormalizedEdits).docs/configuration-reference.md,docs/tools-reference.md) + tests updated.Config
Testing
task test— new flexible-match cases (off-by-one tab, tabs↔spaces, column-0 struct/import, ambiguous/inconsistent → still error) + stale-read reject/allow + atomic-abort.task lint,task buildNotes
No cross-repo impact; tool behavior + config are CLI-internal and documented in-repo, so no separate
inference-gateway/docsticket is needed.