Skip to content

A nameless session's PR is titled with its raw prompt, truncated mid-sentence β€” and the squash makes it permanentΒ #1618

Description

@suleimansh

πŸ€– agent issue

Found by dogfooding #1334's chain end to end on a scratch repo.

A session that emits no session name gets its PR titled with the raw preset prompt, truncated mid-sentence. On squash-merge that becomes a permanent commit subject on main.

The one from the dogfood run, now a real commit on the scratch repo's main:

Open TODO_AGENTS.md and work on the FIRST open entry only. When the work (fix #1)

Where it comes from

agent-handoff.ts:749:

function agentPrTitle(agent) {
  const title = agent.sessionName ?? agent.intent?.split('\n')[0]?.slice(0, 72) ?? `Session ${agent.id}`
  return agent.fixes ? `${title} (fix ${agent.fixes})` : title
}

The (fix #N) machinery from #1334 is correct and did its job β€” the issue auto-closed on merge. The problem is what it gets appended to. sessionName is the agent's own summary of the work; when the agent never emits one, the fallback is the instruction it was given, cut at 72 characters wherever that lands.

The three rungs are not equally good:

  • sessionName β€” what the work was. Correct.
  • intent.slice(0, 72) β€” what the agent was told to do, mid-sentence. This is the bad one.
  • Session ${id} β€” says nothing, but says nothing honestly.

The middle rung reads like a title while being neither a description of the change nor a complete sentence. It is worse than the last rung, which at least cannot mislead.

Why it matters more than a cosmetic title

  • Squash-merge inherits the PR title, so this is not a transient label β€” it is the permanent history of the repository. git log --oneline on a repo driven by the framework fills with truncated instructions.
  • A drain preset's first line is the preset's prose, identical across every run it fires, so repeated firings produce near-identical commit subjects that say nothing about what each one changed.
  • It is most likely to hit exactly where nobody is watching: unattended work, where no human sees the PR before it merges.

Worth deciding rather than patching

The narrow fix is to stop truncating a prompt into a title β€” drop the middle rung, so a nameless session falls through to Session ${id}. Honest, and one line.

The better fix is probably that a handoff should not open a PR without a name for its work at all: sessionName is the one rung that describes the change, and #1612 just moved PR opening onto a path where the framework composes the title. If the agent can be asked to describe its PR, it can be asked for the name too.

Not fixing it in #1616, which found it β€” that PR is about the CI watch reading createdAt, and this is a separate decision about what a PR title is allowed to be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions