Skip to content

fix(impl-generate): forward change_request on auto-retry#5724

Merged
MarkusNeusinger merged 2 commits into
mainfrom
fix/impl-generate-retry-change-request
May 5, 2026
Merged

fix(impl-generate): forward change_request on auto-retry#5724
MarkusNeusinger merged 2 commits into
mainfrom
fix/impl-generate-retry-change-request

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

The auto-retry dispatch in impl-generate.yml (lines 835-840) called
gh workflow run impl-generate.yml without forwarding the change_request
input, so cross-library divergence hints from daily-regen pre-flight were
silently dropped when an attempt failed and got retried.

Why

Observed in daily-regen run 25392762766:
the similarity audit flagged matplotlib (Product A–D 42/28/18/12 percentages
matched highcharts and letsplot exactly) and bulk-generate correctly passed
the hint to matplotlib's first impl-generate dispatch. But that first attempt
failed at "Process plot images (light + dark)" → the auto-retry re-dispatched
without -f change_request=... → the hint was lost on retry.

By chance Claude picked a different scenario (Survey responses) on the retry
anyway, but the plumbing was defective: next time the same cluster could
re-converge.

Changes

  • impl-generate.yml: pass -f change_request="${{ inputs.change_request }}"
    on the auto-retry dispatch.
  • Added a one-line comment explaining the why so future maintainers don't
    accidentally remove it.
  • Notice line now reports whether the change_request was present.

Test plan

  • On next daily-regen cycle that hits a flagged library AND that
    library's first attempt fails, verify the retry logs show
    ::notice::Change request staged: ....
  • Manual re-trigger by failing matplotlib's first attempt artificially is
    not necessary — observed in the wild on run 25392762766.

🤖 Generated with Claude Code

The auto-retry dispatch (line 835-840) called `gh workflow run impl-generate.yml`
without `-f change_request="${{ inputs.change_request }}"`, so cross-library
divergence hints from `daily-regen` pre-flight were silently dropped when an
attempt failed and got retried.

Observed in daily-regen run 25392762766: matplotlib's first attempt failed at
"Process plot images (light + dark)"; the auto-retry succeeded but without the
similarity audit's hint. By chance Claude picked a different scenario anyway,
but the cluster could re-converge next time.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 5, 2026 18:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the impl-generate.yml auto-retry path so a change_request hint (generated by daily-regen similarity pre-flight and forwarded via bulk-generate) is preserved when a failed attempt is automatically re-dispatched.

Changes:

  • Forward change_request when invoking gh workflow run impl-generate.yml for automatic retries.
  • Add inline documentation explaining why the hint must be forwarded on retry.
  • Extend the retry notice log line to indicate whether a change_request was present.

Comment thread .github/workflows/impl-generate.yml Outdated
Comment on lines +841 to +845
-f issue_number="${ISSUE}" \
-f model="${MODEL}"
-f model="${MODEL}" \
-f change_request="${{ inputs.change_request }}"

echo "::notice::Triggered automatic retry for ${LIBRARY}/${SPEC_ID} (attempt $((ATTEMPT + 1)), model=${MODEL})"
echo "::notice::Triggered automatic retry for ${LIBRARY}/${SPEC_ID} (attempt $((ATTEMPT + 1)), model=${MODEL}, change_request=$([ -n "${{ inputs.change_request }}" ] && echo present || echo none))"
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in commit a67e7fe — switched to passing change_request via the step's env: block as CHANGE_REQUEST, which arrives in bash as a raw env var with no template interpolation. Now safe against quotes / $ / backticks in the hint.

…erpolation

Copilot review on PR #5724 caught that `${{ inputs.change_request }}` was
template-interpolated directly into the bash script of the auto-retry step.
If a future hint contained `"`, `$`, or backticks the bash quoting would
break for both the `gh workflow run` arg and the `[ -n ... ]` check.

Switch to passing the value via the step's `env:` block as `CHANGE_REQUEST`,
which arrives in bash as a raw env var (no shell evaluation). Same pattern
the rest of the workflow already uses for its env vars.

Also factored the inline `[ -n ... ] && echo ... || echo ...` into a plain
`if` so the notice line is easier to read.

Co-Authored-By: Claude <noreply@anthropic.com>
@MarkusNeusinger MarkusNeusinger merged commit 1501867 into main May 5, 2026
7 checks passed
@MarkusNeusinger MarkusNeusinger deleted the fix/impl-generate-retry-change-request branch May 5, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants