Skip to content

PR writer model names itself in attribution footers because it never receives the thread's model and harness #26892

Open

Description

@ayushdecoded

What happened

My project's AGENTS.md has a rule: agent-written PR descriptions end with a footer naming the model and harness that did the work (*Model: <model> · Harness: <harness>*).

I do the coding in threads running Claude Opus (claude-opus-5-5, Claude harness). I set a different, cheaper model as the source control writer (currently codex / gpt-6.1-terra). When I create the PR with T3's built-in Create PR action, the footer names the writer model (Model: GPT-6 · Harness: Codex) instead of the model that did the work. It happens every time. Earlier, with claude-haiku-5-5 as the writer, the footer said Haiku.

Diagnosis

The writer model never receives the thread's model or harness, so it can only describe itself.

  • buildPrContentPrompt (packages/provider-core/src/server/textGenerationPrompts.ts) builds the prompt from the diff, the commits, the repo PR template and an optional threadContext.
  • threadContext comes from readThreadContext (apps/server/src/git/GitManager.ts:690). That function renders only the thread's visible message history. It never includes the thread's modelSelection (instance and model), even though the thread projection stores it.
  • The writer CLI runs with the repo as its working directory (cwd in CodexTextGeneration.ts / ClaudeTextGeneration.ts), so it loads the repo's AGENTS.md / CLAUDE.md. It applies any attribution rule there using its own identity, because it has no other identity to use.
  • The custom PR instructions setting (style.customInstructions, passed as changeRequestInstructions) is fixed text, so it can't carry a different model for each thread.
  • Current main builds the prompt the same way.

Proposed fix: add the producing thread's model and harness to the PR prompt (and the commit message prompt, when generated from a thread) as labelled reference data, for example "Change produced by: model claude-opus-5-5, harness Claude". The writer can then fill in attribution footers correctly, and it doesn't present itself as the author.

Steps to reproduce

  1. In a repo, add to AGENTS.md: "End PR descriptions with *Model: <actual model> · Harness: <actual harness>*, read from the running session."
  2. In T3 Code settings, set the source control writer model to a different provider and model than the coding thread (e.g. writer codex / gpt-6.1-terra, thread claudeAgent / claude-opus-5-5).
  3. In a worktree thread on Opus, make a change and commit it.
  4. Use T3's Create PR action for that thread.
  5. Expected: footer names claude-opus-5-5 / Claude. Actual: footer names the writer (GPT-6 / Codex).

Version

0.1.5-nightly.20261029.3867 (desktop app + local server)

Environment

Linux x64 (Omarchy, kernel 7.2.8), Node 26.12.1, codex-cli 0.165.0, Claude Code 2.1.312

Evidence

# Thread that produced the PR (thread projection, read-only)
modelSelection: { instanceId: "claudeAgent", model: "claude-opus-5-5" }
pullRequests[0]: { number: 461, source: "created", headBranch: "t3/a6f47597" }

# settings.json
sourceControlWriterModelSelection: { instanceId: "codex", model: "gpt-6.1-terra", reasoningEffort: "medium" }

# Footer the writer put in the PR body
*Model: GPT-6 · Harness: Codex*

Related issues

None found. Searched for attribution, PR writer model, source control writer and PR description model name. #11077 (MR text leaking data from other threads) also concerns threadContext, but about the opposite problem.

Fix applied or workaround

Nothing applied. Workarounds: have the coding agent open the PR itself (gh pr create) instead of using Create PR, or change the repo rule so a writer that didn't make the change writes unknown.

Filed by

Claude Code (claude-opus-5-5) via t3 triage

Activity

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

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