Skip to content

fix(delivery): support custom pull request bodies - #1012

Merged
tomdps merged 1 commit into
mainfrom
codex/fix-custom-pr-body
Aug 12, 2026
Merged

fix(delivery): support custom pull request bodies#1012
tomdps merged 1 commit into
mainfrom
codex/fix-custom-pr-body

Conversation

@tomdps

@tomdps tomdps commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1011.

Summary

  • add --pr-body <template> for run and finish, with deterministic issue tokens
  • persist the unrendered body through detached and resumed runs
  • correct resumed issue-number lookup and suppress unknown/N/A references
  • shell-quote custom bodies and legacy finish metadata across GitHub, GitLab, and Azure DevOps

Validation

  • 63 focused tests pass
  • lint passes with repository baseline warnings only
  • full TypeScript typecheck passes
  • introduced-change Opcore validation passes
  • Opcore Zero reports no introduced cycles, duplicates, interface findings, or documentation requirements

A local full-suite attempt was stopped after the shared tmpfs filled and cascaded into ENOSPC failures; required GitHub CI is the authoritative clean full-suite run.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds deterministic custom pull-request body templates to run and finish workflows while preserving templates across detached and resumed execution.

  • Adds bounded substitution for issue-number, issue-title, and issue-reference tokens.
  • Shell-quotes generated PR metadata for GitHub, GitLab, and Azure DevOps commands.
  • Persists unrendered custom bodies in cluster state and detached-run options.
  • Aligns resumed issue lookup with the persisted ISSUE_OPENED payload.
  • Adds focused template, integration, detached-startup, CLI-help, and delivery-mode tests.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking defects identified.

Custom bodies remain unrendered while crossing detached and persisted state boundaries, are rendered against the authoritative issue payload at delivery time, and are shell-quoted before inclusion in provider commands.

Important Files Changed

Filename Overview
src/pr-body-template.js Introduces bounded PR-body normalization and deterministic issue-token rendering, including safe behavior when issue metadata is unavailable.
src/agents/git-pusher-template.js Integrates rendered, shell-quoted custom bodies into GitHub, GitLab, and Azure DevOps delivery prompts without changing merge-mode behavior.
src/orchestrator.js Persists custom body templates, forwards them into generated delivery agents, and corrects resumed issue-number lookup.
src/legacy-lib/start-cluster-run-options.ts Carries the unrendered body through canonical foreground and daemon start options.
src/legacy-lib/detached-startup.ts Persists custom body metadata in provisional detached cluster records for later startup and recovery.
cli/index.js Exposes the new run and finish flags and safely renders custom or default bodies into finish-agent commands.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI["run / finish --pr-body"] --> Options["Canonical run options"]
  Options -->|foreground| Orchestrator["Orchestrator"]
  Options -->|detached JSON environment| Daemon["Detached child"]
  Daemon --> Orchestrator
  Orchestrator --> Persist["Persist unrendered prOptions.prBody"]
  Persist --> Resume["Resume / finish"]
  Orchestrator --> Render["Render deterministic issue tokens"]
  Resume --> Render
  Render --> Quote["Shell-quote body and metadata"]
  Quote --> Provider{"Git platform"}
  Provider --> GitHub["gh pr create --body"]
  Provider --> GitLab["glab mr create --description"]
  Provider --> Azure["az repos pr create --description"]
Loading

Reviews (1): Last reviewed commit: "fix(delivery): support custom pull reque..." | Re-trigger Greptile

@tomdps
tomdps enabled auto-merge August 12, 2026 21:32
@tomdps
tomdps added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit 7be7eea Aug 12, 2026
12 checks passed
@tomdps
tomdps deleted the codex/fix-custom-pr-body branch August 12, 2026 21:54
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 6.39.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

bug(delivery): custom PR body instructions are replaced with Closes #unknown

1 participant