Skip to content

setup writes unescaped strings into agent TOML config, producing invalid files on Windows #726

Description

@Rene-Kuhm

📋 Pre-flight Checks

  • I have searched existing issues and this is not a duplicate
  • I understand this issue needs status:approved before a PR can be opened

🐛 Bug Description

When setup writes the agent configuration, string values are inserted into
the generated TOML without escaping. TOML v1.0 basic strings require \ and
" to be escaped, so any value containing them produces a file no compliant
parser will read.

This is not a corner case on Windows: the install paths resolve under
%APPDATA%, so the emitted value contains backslashes by construction.

🔁 Steps to Reproduce

Run the setup on a path containing a backslash or a double quote — on Windows,
the default install path is enough — then parse the generated TOML.

✅ Expected Behaviour

The generated file is valid TOML, and the value read back is byte-for-byte
what was written.

❌ Actual Behaviour

The emitted string is written raw. A path such as
C:\Users\name\AppData\Roaming becomes an invalid escape sequence, and the
config fails to parse.

📦 Affected Area

internal/setup — config writing for the Gemini and Codex integrations.

📎 Additional Context

I have a fix ready: a tomlStringEscape helper applied when writing string
values, with round-trip tests that use a hand-rolled decoder to assert the
emitted value parses back to the original.

Happy to open the PR once this is approved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions