Skip to content

File type detection misidentifies encrypted .c/.cpp/.h files as binary payloads #3964

@Frank-Shaw-FS

Description

@Frank-Shaw-FS

What happened?

Environment

  • Qwen Code version: 0.15.8 (works fine in 0.15.6)
  • OS: Windows 11 (win32)
  • Node.js: v20.x
  • Special: Encrypted/DRM-protected file system environment

Problem

Starting from version 0.15.7/0.15.8, the edit and write_file tools misidentify .c, .cpp, .h and other source code files as "binary/image/audio/video/PDF/notebook payloads" when the files are stored in an encrypted/DRM-protected file system. This prevents editing any source files in such environments.

Error message:

File X is a binary / image / audio / video / PDF / notebook payload that the read_file tool returns as a structured value rather than as plain text. The Edit / WriteFile tools cannot mutate that payload safely.

Version 0.15.6 works correctly and can edit these files without issues.

Reproduction Steps

  1. Install Qwen Code 0.15.6: npm install -g @qwen-code/qwen-code@0.15.6
  2. Try editing a .cpp file with the edit tool → works
  3. Upgrade to 0.15.8: npm install -g @qwen-code/qwen-code@0.15.8
  4. Try editing the same .cpp file with the edit tool → fails with binary error

Expected Behavior

Source code files (.c, .cpp, .h) should be editable regardless of the underlying file system encryption status.

Actual Behavior

Files in encrypted environments are incorrectly classified as binary payloads, blocking all edit/write operations.

Additional Context

  • The same files can be edited normally by Trae IDE
  • The issue appears to be a regression in the file type detection logic between 0.15.6 and 0.15.8
  • User confirmed that downgrading to 0.15.6 resolves the issue completely

Workaround

Currently working around this by:

  1. Staying on version 0.15.6
  2. Disabling auto-update in ~/.qwen/settings.json: "general": { "enableAutoUpdate": false }
  3. Using shell commands to edit files when necessary

What did you expect to happen?

Source code files (.c, .cpp, .h, .md, etc.) should always be editable through the edit and write_file tools, regardless of the underlying file system encryption status.

Client information

Qwen Code v0.15.8
Model: qwen3.6-plus
Fast Model: not set
Auth: openai
Platform: win32 x64 (10.0.26100)
Node.js: v24.14.0
Session: 2efc1a77-3602-4cf1-a4e9-5f6b10b6293b
Git commit: 605a913

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions