Skip to content

[BUG] v3.35.5 regression: write_to_file validation false positive on markdown with code examples #9785

@Michaelzag

Description

@Michaelzag

Issue Summary

write_to_file validation regression in v3.35.5 incorrectly rejects complete markdown files containing code examples with inline comments.

Regression Details

  • Working Version: v3.35.3 (file created successfully)
  • Broken Version: v3.35.5 (same file rejected)
  • Tool Mode: Both XML and native tool calling fail
  • Model: Claude Sonnet 4.5

Reproduction

File created successfully on v3.35.3:
knowledge/erp_domains/analytics_api_implementation_plan.md (854 lines, ~26KB)

Same file fails on v3.35.5:
Attempting to write identical content to different path triggers validation error:

Content appears to contain comments indicating omitted code (e.g., '// rest of code unchanged', '/* previous code */')

False Positive Triggers

Validation flags legitimate documentation comments in code examples:

# Add to orchestrator startup sequence
up:
    @cd service && $(MAKE) up    # NEW
services:
  app:
    # NEW: Service configuration
    image: app:latest

These are documentation annotations, not code omission indicators.

Test Matrix

Version Tool Mode File Size Result
3.35.3 XML 854 lines ✅ Success
3.35.5 XML 854 lines ❌ Rejected
3.35.5 Native 854 lines ❌ Rejected
3.35.5 Fresh task 854 lines ❌ Rejected

Expected Behavior

Validation should distinguish between:

Actual omissions (should reject):

  • // ... rest of code unchanged ...
  • /* code omitted */
  • # (truncated)

Documentation (should accept):

  • # NEW: Feature
  • // Step 1:
  • # Add to config

Impact

Prevents creation of technical documentation containing:

  • Infrastructure-as-Code examples
  • Deployment configurations
  • Implementation plans
  • Annotated code samples

Technical Analysis

Validation logic change between v3.35.3 and v3.35.5 appears to:

  1. Apply pattern matching to entire file content
  2. Not exclude content within markdown code blocks
  3. Trigger on common documentation comment patterns

Suggested fix: For markdown files, skip validation of content inside fenced code blocks (...code...).

Contact

Discord: Available for reproduction files or additional testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions