can1357/oh-my-pi · error · ToolError

title is required unless fill is true

Error message

title is required unless fill is true

What it means

The PR creation flow (gh pr create) requires either an explicit title/body or the --fill flag, which derives them from commit messages. If no title was supplied and fill was not set to true, the tool throws before invoking gh, because GitHub requires a title and the tool refuses to invent one.

Source

Thrown at packages/coding-agent/src/tools/gh-pr-checkout.ts:588

export async function executePrCreate(
	session: ToolSession,
	params: GithubInput,
	signal: AbortSignal | undefined,
): Promise<AgentToolResult<GhToolDetails>> {
	const repo = normalizeOptionalString(params.repo);
	const title = normalizeOptionalString(params.title);
	const body = params.body;
	const base = normalizeOptionalString(params.base);
	const head = normalizeOptionalString(params.head);
	const draft = params.draft ?? false;
	const fill = params.fill ?? false;
	const reviewers = normalizePrIdentifierList(params.reviewer);
	const assignees = normalizePrIdentifierList(params.assignee);
	const labels = normalizePrIdentifierList(params.label);

	if (!fill && !title) {
		throw new ToolError("title is required unless fill is true");
	}
	if (fill && (title || body !== undefined)) {
		throw new ToolError("fill is mutually exclusive with title and body");
	}

	const args = ["pr", "create"];
	appendRepoFlag(args, repo);
	if (title) args.push("--title", title);
	if (base) args.push("--base", base);
	if (head) args.push("--head", head);
	if (draft) args.push("--draft");
	if (fill) args.push("--fill");
	for (const reviewer of reviewers) args.push("--reviewer", reviewer);
	for (const assignee of assignees) args.push("--assignee", assignee);
	for (const label of labels) args.push("--label", label);

	let bodyDir: string | undefined;
	try {

View on GitHub (pinned to 9690622007)

Solutions

  1. Add a title (and optionally body) to the pr_create parameters.
  2. Set `fill: true` to derive title and body from the branch's commit messages.
  3. Check that the title parameter is actually being passed by your wrapper/script — an empty string is treated as absent.

Example fix

// before
op pr_create --base main
// after
op pr_create --base main --title "Fix login redirect" --body "Fixes #42"
// or
op pr_create --base main --fill
Defensive patterns

Strategy: validation

Validate before calling

if (!params.fill && !(typeof params.title === "string" && params.title.trim())) {
  throw new Error("pr_create requires a title, or fill=true to derive one from commits");
}

Type guard

function canCreatePr(p: { title?: string; fill?: boolean }): p is { title: string; fill?: boolean } {
  return Boolean(p.fill) || (typeof p.title === "string" && p.title.trim().length > 0);
}

Try / catch

try {
  await op.prCreate(params);
} catch (err) {
  if (err instanceof ToolError && err.message === "title is required unless fill is true") {
    await op.prCreate({ ...params, fill: true });
  } else throw err;
}

Prevention

When it happens

Trigger: Calling the pr_create op with no `title` parameter and `fill` omitted/false — e.g. providing only base/label/reviewer parameters, or forgetting that fill defaults to false.

Common situations: Automated scripts that pass reviewers/labels but forget the title; users expecting gh's default behavior of filling from commits without setting fill=true.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/dac574dada473794. Report an issue: GitHub.