Skip to content

Edit Tool issues with Grok Code Fast 1 #4313

@daevangelion

Description

@daevangelion

Description

Sourced from my AGENTS.md after my failure analysis workflows did hexdumps of diffs and identified a common failure (30% of edits to python code files have tool control delimiters embedded in them)

Edit Tool Usage Guidelines

Delimiter Conflict Prevention

CRITICAL: The edit tool interprets certain XML/HTML-like tags as control delimiters. Including these tags in content can cause edit operations to fail or corrupt files.

Problematic Tags

The following tags are interpreted as edit tool delimiters and must be avoided in content:

  • </content> - End of content delimiter
  • </parameter - Parameter delimiter
  • </edit> - Edit operation delimiter
  • </file> - File delimiter

Safe Content Inclusion

If you need to include these patterns in code, use character transformation:

# Transform delimiters to safe placeholders
echo '[/content]' | tr '[]' '<>'    # Produces </content> safely
echo '[parameter]' | tr '[]' '<>'   # Produces <parameter> safely

OpenCode version

1.0.63

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Arch Linux

Terminal

Headless

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions