Uh oh!
There was an error while loading. Please reload this page.
Fix Aider engine producing no safe outputs by pinning the diff edit format - #53160
Conversation
…re produced Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Thanks for the fix This PR addresses the workflow failure in #53159 with focused changes to the Aider workflow configuration. The investigation, fix, and documentation are thorough. A few things to consider before finalizing:
Once the [WIP] tag is removed and you've done final validation, this should be ready for review.
|
gh-aw-bot
commented
Aug 16, 2026
@copilot quick triage for this PR:
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Pins Aider to diff editing and updates workflows to emit valid safe outputs.
Changes:
- Adds Aider execution constraints.
- Converts prompts to single-line commands and valid JSONL outputs.
- Regenerates affected workflow locks.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/shared/aider.md | Pins diff format and documents constraints. |
.github/workflows/daily-go-test-stubs-aider.md | Revises discovery, edits, and safe outputs. |
.github/workflows/daily-go-test-stubs-aider.lock.yml | Regenerates compiled workflow. |
.github/workflows/daily-code-debt-aider.md | Revises cleanup and PR flow. |
.github/workflows/daily-code-debt-aider.lock.yml | Regenerates compiled workflow. |
.github/workflows/smoke-aider.lock.yml | Applies shared Aider configuration. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (3)
.github/workflows/daily-code-debt-aider.md:75
- This commit runs inside the AWF container, but the generated Aider step has no Git author/committer environment and the host-side global Git config is not visible in the sandbox (
pkg/workflow/git_configuration_steps.go:101-108). Therefore every successful cleanup reachesgit commit, fails for missing identity, and recordsnoopinstead of opening a PR. Configure the identity on the commit itself.
GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod go build ./... && git checkout -b code-debt-$GITHUB_RUN_ID && git add -A && git commit -m "Resolve actionable TODO/FIXME comments" && printf '%s\n' "{\"type\":\"create_pull_request\",\"title\":\"Resolve actionable TODO/FIXME comments\",\"body\":\"Automated cleanup of self-contained TODO and FIXME comments.\",\"branch\":\"code-debt-$GITHUB_RUN_ID\"}" >> "$GH_AW_SAFE_OUTPUTS" || printf '%s\n' '{"type":"noop","message":"Could not build or commit the cleanup changes — no pull request created."}' >> "$GH_AW_SAFE_OUTPUTS"
.github/workflows/daily-go-test-stubs-aider.md:70
- This commit runs inside the AWF container, but the generated Aider step has no Git author/committer environment and the host-side global Git config is not visible in the sandbox (
pkg/workflow/git_configuration_steps.go:101-108). As a result,git commitfails with an unknown author and this path emitsnoopwhenever stubs are generated. Configure the identity on the commit itself.
GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod go build ./... && git checkout -b add-test-stubs-$GITHUB_RUN_ID && git add -A && git commit -m "Add test stubs for uncovered packages" && printf '%s\n' "{\"type\":\"create_pull_request\",\"title\":\"Add test stubs for uncovered packages\",\"body\":\"Automatically generated test stubs for packages with zero test coverage. Stubs use t.Skip and are ready to be filled in.\",\"branch\":\"add-test-stubs-$GITHUB_RUN_ID\"}" >> "$GH_AW_SAFE_OUTPUTS" || printf '%s\n' '{"type":"noop","message":"Could not build or commit the generated test stubs — no pull request created."}' >> "$GH_AW_SAFE_OUTPUTS"
.github/workflows/daily-go-test-stubs-aider.md:52
- This command is not executed until after Aider has produced its single model reply, so the model can never see its output before being asked to select packages and create stubs. With
AIDER_GIT=false, the run also has no repo map or source files in context. Move discovery before the Aider invocation and inject the results/files into the prompt, or use an engine flow that supports another model turn after command execution.
for pkg in $(find . -name '*.go' -not -name '*_test.go' -not -path './vendor/*' -not -path './.git/*' | sed 's|/[^/]*\.go$||' | sort -u); do [ -z "$(find "$pkg" -maxdepth 1 -name '*_test.go')" ] && echo "$pkg"; done | head -5
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Balanced
| test_count=$(find "$pkg" -maxdepth 1 -name "*_test.go" 2>/dev/null | wc -l) | ||
| if [ "$test_count" -eq 0 ]; then echo "$pkg"; fi | ||
| done | head -5 | ||
| for pkg in $(find . -name '*.go' -not -name '*_test.go' -not -path './vendor/*' -not -path './.git/*' | sed 's|/[^/]*\.go$||' | sort -u); do [ -z "$(find "$pkg" -maxdepth 1 -name '*_test.go')" ] && echo "$pkg"; done | head -5 |
| --exclude-dir=vendor \ | ||
| --exclude-dir=.git \ | ||
| . | grep -v "_test.go" | head -20 | ||
| grep -rn "TODO\|FIXME" --include="*.go" --exclude-dir=vendor --exclude-dir=.git . | grep -v "_test.go" | head -20 |
🎉 This pull request is included in a new release. Release: |
Daily Go Test Stubs — Aidercompleted successfully but emitted zero safe outputs. Aider derives its edit format from model metadata; the proxied nameopenai/claude-sonnet-4.5is unknown to Aider/LiteLLM, so it fell back to the defaultwholeformat, whoseWholeFileCodertreats every fence as a file listing and cannot run shell commands at all:Aider retried four times, gave up, and exited 0 — no files edited, no commands run, nothing appended to
$GH_AW_SAFE_OUTPUTS.Two further defects surfaced while reading Aider 0.86.2's source:
handle_shell_commandsdoescommands_str.strip().splitlines()and runs each line as a separate command, so the multi-line pipelines and heredocs in the aider prompts could never have worked regardless of edit format. Aider's own system prompt states "Do not suggest multi-line shell commands."{"type":"noop","reason":...}while the schema requiresmessage, andcreate_pull_requestrequires abranchthat was never supplied.Changes
shared/aider.md— pin--edit-format diff(EditBlockCoder, which supports SEARCH/REPLACE edits and shell commands); document the rationale in the engine docs comment.shared/aider.md— add a prompt-visible "Aider execution constraints" section (single turn, SEARCH/REPLACE edits, one complete shell command per line, single-line safe-output emission) inherited by all three aider workflows.daily-go-test-stubs-aider.md,daily-code-debt-aider.md— collapse bash blocks to one command per line, replace heredoc file writes with SEARCH/REPLACE instructions, and correct the safe-output payloads.|| noopfallback so the run always records exactly one safe output, even if the build or commit fails:daily-go-test-stubs-aider,daily-code-debt-aider, andsmoke-aiderlock files.smoke-aiderneeded no prompt edits (it contains no bash blocks) but picks up the engine fix and shared constraints.Note:
codeql_checkertimed out and reported that it cannot be re-run; the diff is workflow markdown plus generated YAML, with no application code touched.