Skip to content

feat: unify chat sin_edit with MCP surgical editor and add sin_replace (issue #373)#414

Merged
Delqhi merged 1 commit into
mainfrom
feat/sin-edit-unify
Jun 18, 2026
Merged

feat: unify chat sin_edit with MCP surgical editor and add sin_replace (issue #373)#414
Delqhi merged 1 commit into
mainfrom
feat/sin-edit-unify

Conversation

@Delqhi

@Delqhi Delqhi commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Aligns the chat tool sin_edit with the MCP surgical editor by routing it through the shared internal edit engine. Preserves the previous naive string-replace behavior as a new sin_replace tool for backward compatibility.

Changes

  • Added exported internal.EditByString(path, old, new) helper in cmd/sin-code/internal/edit.go.
  • Refactored toolEdit in cmd/sin-code/chat_tools.go to call internal.EditByString.
  • Added sin_replace chat tool that retains the old naive strings.Replace behavior.
  • Added sin_replace to builtinSpecs and builtinTool dispatch.
  • Added sin_replace permission default (allow) in cmd/sin-code/internal/permission_defaults.go.
  • Added unit tests for the new sin_edit ambiguity behavior and sin_replace first-occurrence replacement.

Verification

  • go build ./cmd/sin-code/... passes.
  • Targeted race tests pass:
    • go test ./cmd/sin-code -run 'TestArgBool|TestTool|TestMaybeGenerateTest|TestChat|TestMCP' -race -count=1
    • go test ./cmd/sin-code/internal -run 'TestEdit|TestString|TestApply|TestPermission|TestServeIntegration' -race -count=1
  • The full go test ./cmd/sin-code/... -race -count=1 run 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

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sin-code Ready Ready Preview, Comment, Open in v0 Jun 18, 2026 9:08pm

@github-actions

Copy link
Copy Markdown

🏆 CEO Audit — A+ (100.0/100)

Metric Value
Grade A+
Score 100.0/100
Critical findings 0
High findings 0
Profile QUICK
Min grade gate B

📥 Download full report (Markdown)
📊 Download SARIF (for Code Scanning)

Run ~/.config/opencode/skills/ceo-audit/scripts/audit.sh . --profile=QUICK locally to reproduce.

@github-actions

Copy link
Copy Markdown

🏆 CEO Audit — A+ (100.0/100)

Metric Value
Grade A+
Score 100.0/100
Critical findings 0
High findings 0
Medium findings 0
Profile QUICK
Min grade gate B

📥 Download full report (Markdown)

Run ID: 27789433720 · Commit: ${github.sha}

Run ~/.config/opencode/skills/ceo-audit/scripts/audit.sh . --profile=QUICK locally to reproduce.

@Delqhi
Delqhi merged commit d604e3d into main Jun 18, 2026
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool system: Align chat sin_edit semantics with MCP sin_edit

1 participant