both toml renderers write control characters into the output raw, which produces a .toml file that a parser rejects.
toml forbids literal control characters (U+0000-U+001F except tab and newline, plus U+007F) in every string form, and a bare carriage return that is not part of a CRLF pair.
two separate code paths hit this:
TomlIntegration._render_toml_string in src/specify_cli/integrations/base.py, used by the gemini and tabnine integrations for the description and prompt fields.
CommandRegistrar.render_toml_command / _render_basic_toml_string in src/specify_cli/agents.py, used for extension/preset command files.
the multiline """ and ''' forms and the basic-string fallback all emit the control char verbatim, so the resulting file cannot be loaded back.
repro (either renderer):
import tomllib
from specify_cli.integrations.base import TomlIntegration
rendered = TomlIntegration._render_toml_string("ab")
tomllib.loads(f"prompt = {rendered}") # tomllib.TOMLDecodeError: Illegal character
both toml renderers write control characters into the output raw, which produces a .toml file that a parser rejects.
toml forbids literal control characters (U+0000-U+001F except tab and newline, plus U+007F) in every string form, and a bare carriage return that is not part of a CRLF pair.
two separate code paths hit this:
TomlIntegration._render_toml_stringinsrc/specify_cli/integrations/base.py, used by the gemini and tabnine integrations for thedescriptionandpromptfields.CommandRegistrar.render_toml_command/_render_basic_toml_stringinsrc/specify_cli/agents.py, used for extension/preset command files.the multiline
"""and'''forms and the basic-string fallback all emit the control char verbatim, so the resulting file cannot be loaded back.repro (either renderer):