Skip to content

Feat(handback): Ask Code Monkey to inherit params - #134

Merged
ModeSevenIndustrialSolutions merged 2 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-130
Nov 24, 2026
Merged

ModeSevenIndustrialSolutions merged 2 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-130

Conversation

@lf-releng-code-monkey-bot

@lf-releng-code-monkey-bot lf-releng-code-monkey-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Closes #130

Authored by an AI agent; human review required
Command Exit
uv run python -B -m unittest tests.test_workflow (expected failures before the change) 0
uv run python -B -m unittest discover -s tests (before the change, 3 expected failures) 0
uv run python -B -m unittest discover -s tests 0
uvx zizmor --persona auditor .github/workflows/ 0
prek run --files .github/workflows/code-review.yaml tests/test_workflow.py docs/DESIGN.md 0

The github-code-monkey-bot workflow opened this pull request.
Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds per antagonistic review round; after that a maintainer, or the next antagonistic review, takes on any finding that remains, and a maintainer reviews every round before merge.


INFO: prerequisite confirmed by a maintainer (2026-11-24)
lfreleng-actions/github-code-monkey-bot#241 has merged, as
lfreleng-actions/github-code-monkey-bot#243 (merge commit
a3860d2080552f97bc10231c11a94dac91b748d7, 2026-11-24 16:32 UTC),
and code-monkey-cron.yaml on that repository's default branch
declares the inherit_run_parameters input. This change can merge
without making hand-backs fail with HTTP 422. The authoring session
had no GitHub access and could not check this itself.

What changed and why

  • Inheritance. The Hand back for revision job's dispatch of
    code-monkey-cron.yaml now passes -f inherit_run_parameters=true.
    Everything else in the dispatch is unchanged: one pull request per
    call, dry_run=false, mode=pull-requests, max_pull_requests=0.
    A revision round then runs on the parameters of the Code Monkey run
    that published the pull request's latest round, which Code Monkey
    reads from its own round footer (Feat(revise): Inherit run parameters on hand-back github-code-monkey-bot#241),
    instead of the form's defaults. None of this workflow's inputs
    (model, reasoning_effort, max_ai_credits) pass to Code Monkey.
  • Visible refusals. The dispatch's stderr goes to a temp file. On
    failure the job still records the pull request as failed and
    still fails once (no retry loop). The reason in
    delivery/handback.json and in the step summary is now
    the dispatch failed: HTTP <status>; <first line of the error output>,
    or no HTTP status / no error output when there is none. The
    first line is stripped of control characters and backticks and
    capped at 300 characters. The full error output still goes to the
    job log.
  • Tests (tests/test_workflow.py). The contract test now pins the
    new dispatch arguments. The fake gh can print an error, and two
    new cases cover a 422 refusal (status and reason in the record and
    summary, sent once) and a silent failure. The test that only the
    handback job holds handback_token is unchanged and passes. As
    the guidance asks, the tests landed first as expectedFailure in
    their own commit, and the second commit removes the markers.
  • Docs. docs/DESIGN.md §19.9 gains a "Whose parameters" item
    next to the hand-back "How" item covering the above.

Checks run

  • uv run python -B -m unittest discover -s tests: 921 tests OK.
  • uvx zizmor --persona auditor .github/workflows/: no findings.
  • prek run --files .github/workflows/code-review.yaml tests/test_workflow.py docs/DESIGN.md:
    all hooks pass, including aislop, actionlint/shellcheck, yamllint
    and write-good. No hooks skipped.

For reviewers

  • A successful dispatch's stderr now goes to the temp file and not
    the log. gh workflow run prints nothing there when it is not
    attached to a terminal, so the log loses nothing.
  • The raw error output is echoed to the job log on failure. It comes
    from the CLI and GitHub's API response, not from pull request
    content.

lf-releng-code-monkey-bot Bot and others added 2 commits November 24, 2026 19:51
Pin -f inherit_run_parameters=true in the hand-back dispatch, and
expect a refused dispatch to record its HTTP status and the first
line of the CLI's error output in the delivery record and the step
summary. The cases are marked as expected failures until the
workflow change lands.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
Each hand-back dispatch now passes -f inherit_run_parameters=true, so
a revision round runs on the parameters of the Code Monkey run that
published the pull request's latest round instead of the form's
defaults. Code Monkey reads them from its own round footer; nothing
of this workflow's inputs passes to it.

A refused dispatch now records its HTTP status and the first line of
the CLI's error output in the delivery record's reason and in the step
summary, so a refused input reads as one. The job still fails once and
never retries a refusal itself.

Depends on lfreleng-actions/github-code-monkey-bot#241, which adds
the input to code-monkey-cron.yaml.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Issue #130’s required upstream PR #241 merge remains unverified after a 404 lookup, leaving a prerequisite that requires maintainer confirmation.

No open issues 🎉

What changed in this PR

Updates the antagonistic review hand-back to request Code Monkey’s original run parameters, rather than use its form defaults, while making dispatch failures easier to diagnose.

Changes:

  • Adds inherit_run_parameters=true without changing the other dispatch inputs.
  • Records HTTP status and a sanitized first error line in delivery records and step summaries, without adding retries.
  • Updates contract tests and documentation for inheritance and refused dispatches.
File Description
tests/​test_workflow.py Pins the inheritance input and tests refused and silent dispatch failures.
docs/​DESIGN.md Documents parameter ownership, inheritance, and failure reporting.
.github/​workflows/​code-review.yaml Requests inherited parameters and captures dispatch error details.

Review effort: Balanced

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Antagonistic review by agent: no line-level findings; the summary below is the verdict.

No actionable defects found in the diff; inheritance dispatch and failure recording preserve the existing delivery guards. Does the target workflow's default branch now declare inherit_run_parameters? The offline packet cannot establish that deployment prerequisite.

Antagonistic round 1 of 3.


Automated antagonistic review by lf-releng-antagonistic-review-bot[bot] using model gpt-6-astra; see the run. This is not a human review and never an approval: a maintainer must still review and approve this pull request.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 5e80987 into lfreleng-actions:main Nov 24, 2026
32 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the code-monkey/issue-130 branch November 24, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat(handback): Ask Code Monkey to inherit params

2 participants