Skip to content

fix(splitting): remove PR-creation references from prompt template#1383

Open
aaight wants to merge 1 commit into
devfrom
fix/splitting-prompt-pr-references
Open

fix(splitting): remove PR-creation references from prompt template#1383
aaight wants to merge 1 commit into
devfrom
fix/splitting-prompt-pr-references

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented May 19, 2026

Summary

Fixes MNG-1084.

The splitting agent has PM-only capabilities (no scm:pr) — it never opens
pull requests. But the prompt template's Step 6 told the agent to "post
summary comment ... once you've confirmed PR creation" and to use "real and
confirmed PR numbers and URLs - see output from CreatePR". That wording was
left over from a copy/paste with the implementation prompt and contradicted
the agent's actual capability contract, leading to confused output on
real splitting runs.

Changes

  • src/agents/prompts/templates/splitting.eta — replaced the two
    action-oriented PR-creation references in Step 6 with wording grounded in
    the splitting workflow's actual side-effects (story work items returned by
    CreateWorkItem). Story sizing language ("One PR, one day" heuristic and
    the - **S**mall - One PR, one day... INVEST bullet) is intentionally
    preserved because it describes target story size, not an action the agent
    should perform.
  • tests/unit/agents/prompts.test.ts — added two narrow regression
    tests:
    • One that asserts the rendered splitting prompt does not contain
      CreatePR, confirmed PR creation, or real and confirmed PR numbers,
      and does still contain CreateWorkItem, Stories Created,
      [Story Title](URL), and URLs returned by `CreateWorkItem`.
    • One that pins the preserved "One PR, One Day" sizing-heuristic wording
      so a future cleanup pass cannot strip it accidentally.

Out of scope

  • No changes to src/agents/definitions/splitting.yaml — capabilities
    already correctly omit scm:pr and the existing
    agent-profiles.test.ts > splitting includes file editing but not CreatePR
    test continues to pass.
  • No changes to src/gadgets/session/core/finish.ts or backend PR-validation
    code — splitting remains a no-PR workflow by capability/agent contract.
  • No documentation updates — README.md and docs/architecture/04-agent-system.md
    already correctly describe splitting as creating smaller work items with
    fs, session, pm capabilities.
  • Custom DB-stored splitting prompt overrides (per-project) may still
    contain stale copy; operators with overrides will need to update those
    separately.

Test plan

  • npx vitest run --project unit-core tests/unit/agents/prompts.test.ts — 129 pass (added 2)
  • npx vitest run tests/unit/backends/agent-profiles.test.ts — 56 pass; the existing splitting includes file editing but not CreatePR invariant still passes
  • npx vitest run --project unit-core tests/unit/agents/capabilities/resolver.test.ts — 37 pass
  • npx vitest run --project unit-core tests/unit/agents/ — all 802 agent unit tests pass
  • npm run typecheck — clean
  • npx biome check on the two touched files — clean

🕵️ claude-code · claude-opus-4-7 · run details

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

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

LGTM - the splitting prompt now grounds the summary step in CreateWorkItem story URLs without removing the intentional PR sizing heuristic. I verified the focused prompt regression test plus the existing capability/profile guards locally.

🕵️ codex · gpt-5.5 · run details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants