Skip to content

Configuration And Prompts

Fabrizio Salmi edited this page Sep 6, 2026 · 1 revision

Configuration and prompts

config.toml, and the shape it has to be in

Configuration is loaded with toml.load and handed to Click as its default_map. Click matches the top-level keys of that map against option names, so the file has to be flat:

openai_api_key = "none"
openai_api_base = "http://localhost:1234/v1"
llm_model = "qwen2.5-coder-14b-instruct-mlx"
llm_temperature = 0.2
tools = "black,isort,pylint,flake8"
min_coverage = 80
coverage_fail_action = "warn"

The config.toml shipped in the repository is not in that shape. It groups keys under sections: [general], [static_analysis], [testing], [commit_pr], [caching_logging], [llm_categories], [code_formatting], [forking], [advanced]. With sections, the top-level keys become general, static_analysis and so on, which match no option, so none of those values reach the command and every option keeps its built-in default. Nothing warns you: the run proceeds with defaults.

Demonstrated in isolation:

import click

@click.command()
@click.option('--llm-model', default='DEFAULT')
def cmd(llm_model): print(llm_model)

cmd.main([], default_map={'llm_model': 'from-flat'})              # from-flat
cmd.main([], default_map={'general': {'llm_model': 'from-flat'}}) # DEFAULT

Until this is reconciled, either flatten your own config.toml, or pass the options you care about on the command line, where they always take effect. Command-line values override the config file in any case.

Options worth setting deliberately

Key Why
llm_temperature 0.2 is the default and is already low. Raise it and the model starts inventing rather than fixing
min_coverage and coverage_fail_action warn reports and continues, fail stops. Use fail in any automated run
max_files_per_pr Bounds how much lands in one pull request. A large value produces a diff nobody will read
fork_repo Keep it on. Without it, the tool pushes to the target repository itself
force_push Leave it off unless you know exactly which branch you are overwriting

Prompts

Improvement categories map to files named prompt_<category>.txt in the directory given by --llm-custom-prompt (default: the current directory). The default categories are style, maintenance, security and performance, plus tests for test generation.

Two placeholders are substituted: {code} for the code being improved, and {file_base_name} for the file's base name.

You are a coding assistant tasked with improving the style of the following Python code.
Focus on PEP 8 compliance, readability, and clarity. Return only the improved code,
without any introductory or concluding text. Do not include markdown code fences.

{code}

The instruction to return only code, with no prose and no fences, is not decoration: the output is written to a file. The repository ships working prompts at the top level (prompt_style.txt, prompt_security.txt, prompt_performance.txt, prompt_maintenance.txt, prompt_consolidate.txt, prompt_description.txt), and a larger set under prompts/ used by The Team.

Categories and prompt files must agree. Adding docs to categories without a prompt_docs.txt gives you a category with nothing behind it.

Where the API key lives

openai_api_key sits in config.toml, and the GitHub token is passed as --token. Neither belongs in a repository. For a real key, prefer the environment:

export OPENAI_API_KEY=...
export OPENAI_API_BASE=http://localhost:1234/v1

With a local model the key is genuinely unused, which is why "none" is the documented value.

Clone this wiki locally