Skip to content

Tool system: Align chat sin_edit semantics with MCP sin_edit #373

Description

@Delqhi

Problem

sin_edit in chat is a naive string replace. sin_edit in MCP is a surgical AST/anchor/string editor. Same name, different behavior — prompts break when switching between sin-code chat and sin-code serve.

What to do

  1. Unify sin_edit implementation:
    • Use the same internal/edit package for both chat and MCP
    • Support: anchor mode, symbol mode, string mode
    • Syntax validation before write
  2. Deprecate chat's naive string replace
  3. Add sin_replace chat tool for backward compatibility (simple string replace)
  4. Update all agent profiles to prefer sin_edit with anchors
  5. Tests ensure identical behavior across surfaces

Acceptance criteria

  • Chat and MCP sin_edit use same engine
  • sin_replace for backward compatibility
  • Agent profiles updated
  • Tests for both surfaces
  • Migration note in CHANGELOG

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions