Description
When generating an AI commit message, changed files are added to the prompt in a non-deterministic order. Regenerating on an unchanged working tree produces a different file order each time.
Steps to reproduce
- Configure Ollama as the AI provider.
- Have a multi-file change in the working tree.
- Click Generate message several times without changing anything.
Result
The diff content is the same between requests, but the per-file order differs each time.
Expected
A fixed file order for identical input.
Effects
- Same changeset yields differently-ordered prompts, so messages vary between regenerations.
- Reordering invalidates the local runtime's prompt cache on each regeneration.
Suggested fix
Sort the change set by file path before assembling the prompt.
Related
Env: GitButler 0.20.3 (macOS), Ollama provider.
Description
When generating an AI commit message, changed files are added to the prompt in a non-deterministic order. Regenerating on an unchanged working tree produces a different file order each time.
Steps to reproduce
Result
The diff content is the same between requests, but the per-file order differs each time.
Expected
A fixed file order for identical input.
Effects
Suggested fix
Sort the change set by file path before assembling the prompt.
Related
Env: GitButler 0.20.3 (macOS), Ollama provider.