PR inline summary
Overview
PR inline summary lets KanbanAI draft pull request titles and descriptions based on the changes between a base branch and a feature branch. It remains an inline operation: it does not create Attempts, branches, or commits; it simply returns a suggested PR title/body that you can accept or ignore. The request now runs in the background, survives dialog close/reopen, and caches the latest suggestion per project + branch (+ optional base).UI behavior
- The Create Pull Request dialog shows a small robot button inside the Description field.
- The button is:
- Enabled only when a branch is available for the PR.
- Disabled while a summary request is already in flight.
- When you click it:
- The current title/description and branch information are sent to the server for summarization.
- A toast appears: “Drafting PR template…” and notes you can close the dialog while it runs.
- The button shows a spinner while the request runs, but closing the dialog no longer cancels the task.
- Background lifecycle:
- Results are cached per
(projectId, headBranch, baseBranch|auto). - If the dialog is closed when the summary finishes, a toast says “PR template ready for branch <branch>” with an action to reopen the dialog.
- Reopening the dialog for the same project/branch rehydrates the cached suggestion—no re-run required.
- A running request shows a small inline banner with a cancel button; cancellation uses
AbortControllerand clears the cached state.
- Results are cached per
- On success:
- An “AI suggestion preview” box appears below the form.
- The preview shows Original vs Suggestion titles and descriptions side-by-side (using the snapshot captured when you clicked the bot).
- You can click Accept to apply the suggestion into the form, or Reject to discard it and keep your original text.
- After Accept/Reject you can click the bot button again to request a new suggestion.
- Summarization never creates a PR on its own:
- You still need to click Create PR to open the pull request on GitHub.
API surface
The UI uses a dedicated summary endpoint:POST /projects/:projectId/pull-requests/summary- Request body:
base(string, optional) – base branch; when omitted, falls back to the project’s configuredbaseBranch.branch(string, optional) – head branch; when omitted, the server uses the current git branch.attemptId(string, optional) – Attempt ID associated with the PR; used to look up linked GitHub issues.cardId(string, optional) – Card/ticket ID associated with the PR; used to look up linked GitHub issues.agent(string, optional agent key override).profileId(string, optional profile ID override).
- Successful response (
200 OK):{ "summary": { "title": "...", "body": "..." } }
- Request body:
- Error handling:
- Unknown or missing project →
404problem response. - Unknown agent key or agent without inline PR-summary support →
400problem response. - Cancelled inline tasks →
499problem response. - Internal errors in the summary pipeline →
502problem response with a generic “Failed to summarize pull request” message.
- Unknown or missing project →
- The endpoint is pure transformation:
- It does not create, update, or persist PRs.
- Callers are expected to copy any accepted suggestion into their own form state and then call the normal PR creation endpoint.
Agent pipeline
PR summarization reuses the same inline infrastructure as ticket enhancement:- Input options for
agentSummarizePullRequest:projectId, requiredheadBranch, optionalbaseBranch.- Optional
agentKey, optionalprofileId, optionalattemptId/cardId, optionalAbortSignal. - Behavior:
- Loads the project and its settings (including
baseBranch,inlineAgent,inlineProfileId, and the per-inline-agent profile mapping). - Resolves an effective agent/profile:
- Uses the explicit
agentKey/profileIdwhen provided. - Otherwise consults the per-inline-agent mapping for
InlineAgentId = "prSummary"when configured so PR summaries can use a dedicated profile. - Otherwise prefers the project’s configured
inlineAgent/inlineProfileId. - When no inline agent is configured, falls back to the project’s
defaultAgent/defaultProfileId(or"DROID"when none is set).
- Uses the explicit
- Constructs a
PrSummaryInlineInputcontaining:repositoryPath,baseBranch,headBranch, and optional change summaries.
- Resolves the agent profile, preferring inline prompts:
- If the resolved profile contains
inlineProfile, it is used to tailor the PR-summary prompt. - Otherwise, the primary profile’s prompt (e.g.
appendPrompt) is used.
- If the resolved profile contains
- Builds an
InlineTaskContextannotated withprofileSource: "inline" | "primary". - Invokes
runInlineTask({agentKey, kind: "prSummary", input, profile, context, signal}). - Returns
PrSummaryInlineResult{title, body}. When the associated card/ticket has GitHub issues, the body ends with an auto-close line likecloses #123, fixes #456. If the PR repository cannot be resolved, references are emitted as fully-qualifiedowner/repo#123. When bothcardIdandattemptIdare provided,cardIdtakes precedence; mismatches are rejected at the HTTP layer. - Built-in agents that currently implement PR inline summary are:
CODEXvia the Codex SDK.DROIDvia the Droid CLI.OPENCODEvia the@opencode-ai/sdkclient, which builds the samebuildPrSummaryPromptprompt, parses the Markdown withsplitTicketMarkdown, and prefersinlineProfileoverappendPromptwhen present.
When to use PR inline summary
- Quickly drafting clear, consistent PR titles and bodies for feature branches.
- Encouraging richer PR descriptions (including diagrams) without manual boilerplate.
- Keeping inline behavior aligned with your chosen agent/profile, so ticket enhancement and PR summary share the same tuning.
Custom prompts
Projects can override the default PR summary prompt with a custom one via the Custom Prompts section in project settings. When a custom prompt is configured:- Your custom prompt replaces the built-in system prompt as the base.
- The repository and change context (base/head branches, commits, diff summary) is automatically appended to your custom prompt.
- Profile append prompts still apply on top of the custom prompt.
core/agents-and-profiles.md and core/advanced-ticket-enhancement.md.