feat: unify chat sin_edit with MCP surgical editor and add sin_replace (issue #373)#414
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown)
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown) Run ID:
|
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
Aligns the chat tool
sin_editwith the MCP surgical editor by routing it through the shared internal edit engine. Preserves the previous naive string-replace behavior as a newsin_replacetool for backward compatibility.Changes
internal.EditByString(path, old, new)helper incmd/sin-code/internal/edit.go.toolEditincmd/sin-code/chat_tools.goto callinternal.EditByString.sin_replacechat tool that retains the old naivestrings.Replacebehavior.sin_replacetobuiltinSpecsandbuiltinTooldispatch.sin_replacepermission default (allow) incmd/sin-code/internal/permission_defaults.go.sin_editambiguity behavior andsin_replacefirst-occurrence replacement.Verification
go build ./cmd/sin-code/...passes.go test ./cmd/sin-code -run 'TestArgBool|TestTool|TestMaybeGenerateTest|TestChat|TestMCP' -race -count=1go test ./cmd/sin-code/internal -run 'TestEdit|TestString|TestApply|TestPermission|TestServeIntegration' -race -count=1go test ./cmd/sin-code/... -race -count=1run has unrelated pre-existing failures (autonomy build error, golden help mismatch, EFM Docker/OrbStack environment issues, agentloop concurrency timing flake) that are not introduced by this change.Closes #373