Repository navigation
Make the Ollama provider work; fix the AI prompt and dedupe group-commit (stack 2/5) - #43
Closed
martient wants to merge 2 commits into
Conversation
This was referenced Sep 20, 2026
martient
added this pull request to stack #48
September 20, 2026 17:40
Four real defects from the agent audit, plus one withdrawn finding.
- Ollama requests now set `stream: false`. The endpoint defaults to
streaming, so every previous call received newline-delimited events and
died in LlmError::Parse before silently falling back to the default
message. The provider has never worked.
- `format` moves from `options` to the top level, where Ollama reads it,
and now carries a JSON Schema for AiCommitSuggestion rather than the
string "json", so decoding is constrained instead of merely requested.
- The default (non-sensitive) AI path sent only the group name and an
instruction not to reveal anything, leaving the model nothing to work
from. It now sends a redacted shape summary: file count, extension
histogram and top-level areas. No filename, no path below the first
segment, and no file content is sent in either mode.
- `--ai-diff-lines-per-file` was declared, documented and accepted but
never read. Removed, along with the dead LlmError::_Timeout variant and
the commented-out LlmProvider enum.
The audit's P0-4 ("--ai silently ignored in --mode apply") was wrong and
is withdrawn: the apply arm has always had its own AI block. The real
problem there was duplication -- plan and apply carried identical copies
of group building and the AI block -- which is what made the misreading
possible. Both are extracted into build_groups() and ai_user_prompt().
Request bodies are now built by pure functions with unit tests, so the
wire format is verifiable without a network call.
The pull_request trigger filtered on branches: ["*"], and in Actions branch filters `*` matches everything except `/`. Any pull request whose base branch contains a slash therefore matched nothing and ran no checks at all -- silently, since a workflow that does not trigger looks the same as one with nothing to report. That covers every stacked pull request in this series (all but the first target a claude/... base and have zero check runs), and would equally cover anything based on a feat/ or fix/ prefix. `**` matches across slashes, which is what the filter meant.
martient
force-pushed
the
claude/ai-agents-capabilities-report-fgpp3p-ai-fixes
branch
from
September 20, 2026 18:03
1117a74 to
97c0c55
Compare
Owner
Author
|
Superseded by #49, which carries these commits unchanged. Closing — see #42 for why the stack was collapsed. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #42. Resolves the audit's AI findings.
The Ollama provider has never worked
Two independent bugs, either of which is fatal:
streamwas never set./api/chatdefaults tostream: true, so every response was newline-delimited events andresp.json::<ResponseBody>()failed. Every--ai-provider ollamarun ended inLlmError::Parseand silently fell back to the default message. Now sendsstream: false.formatwas nested underoptions, where Ollama does not read it, so JSON mode was a no-op. It is a top-level field, and now carries a JSON Schema forAiCommitSuggestionrather than the bare string"json"— constrained decoding instead of a polite request.The default AI path had nothing to work with
Unless
--ai-allow-sensitivewas set, the prompt contained the group name, the default type, and an instruction to improve the description "without revealing code or filenames". The model was asked to improve something it could not see.It now sends a redacted shape: file count, extension histogram, and top-level areas only.
No filename, no path below the first segment, and no file content is sent in either mode —
--ai-allow-sensitivecontrols paths, not content, which the docs previously got wrong in both directions.Correction to the audit
P0-4 was wrong and is withdrawn. It claimed
--aiwas silently ignored in--mode apply. It never was — the apply arm has its own AI block. The error came from misreading agreppiped throughawk 'NR>=530', whose renumbered output was taken for plan-arm line numbers.The real problem there is what made that misreading possible:
planandapplycarried byte-identical copies of the group-building loop and the ~150-line AI block. Both are now extracted intobuild_groups()andai_user_prompt()and shared.Removals
--ai-diff-lines-per-file(declared, documented, accepted, never read),LlmError::_Timeout, and the commented-outLlmProviderenum.Verification
Request bodies are now built by pure functions with unit tests, so the wire format is verifiable without a network call — 6 tests covering
stream,formatplacement, schema shape, and sampling options. Full suite 374 passed;fmtandclippy -D warningsclean. The two pre-existing failures noted in #42 are unchanged.