Skip to content

fix(server): a branch prefixed with another remote's name publishes under its full name - #40877

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
Abhiram-745:fix/publish-branch-other-remote-prefix
Nov 22, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
Abhiram-745:fix/publish-branch-other-remote-prefix

Conversation

@Abhiram-745

Copy link
Copy Markdown
Contributor

Problem

Pushing a new branch whose name starts with the name of a different remote publishes it under the wrong name on the push remote.

Repro on main:

  1. Have a repo with origin and a second remote named after a GitHub login, say alice (your own fork remote, or one T3 added when you checked out a fork PR). Branches named <login>/<topic> are a common convention.
  2. Create a branch alice/fix with no upstream, commit, and click Push (or Commit & push / Create PR).
  3. T3 runs git push origin HEAD:refs/heads/fix and records origin/fix as the upstream. Expected: it publishes alice/fix to origin. If fix already exists on origin and the push fast-forwards it, someone else's branch moves.

resolvePublishBranchName in GitVcsDriverCore.ts drops a leading <remote>/ whenever <remote> is any configured remote, even when the push goes somewhere else. In the steps above resolvePushDestination takes the no-upstream path, parseRemoteRefWithRemoteNames("alice/fix", ["origin", "alice"]) returns fix, and the push remote falls back to origin.

Change

resolvePublishBranchName(branch, remoteName) now drops the prefix only when it names the remote being pushed to. All three callers pass their destination: the no-upstream publish in resolvePushDestination, the publish path for a branch whose upstream is a base, and pushCurrentBranch with a requested remote. A branch named origin/feature/push pushed to origin still publishes as feature/push, which the existing test covers. The helper no longer lists remotes, so it is a plain function.

Scope

This is a small fix for an obvious bug in one helper, so I didn't open an issue. It follows the rule #33581 set for local-tracking branches, that a branch publishes under its full local name unless that name really is a ref on the destination. #33557 (open) edits the same call sites for a different feature, so expect a textual conflict only.

Verification

  • New test in GitVcsDriverCore.test.ts, "publishes a new branch prefixed with another remote's name under its full name", uses real repos with two bare remotes. On main it fails with expected { status: 'pushed', …(3) } to have deep property 'upstreamBranch' of 'origin/alice/fix', but got 'origin/fix'. With the fix it passes and checks that refs/heads/alice/fix on origin points at HEAD.
  • The existing same-remote case (it.effect.each(["feature/push", "origin/feature/push"])) still passes. GitVcsDriverCore.test.ts and GitManager.test.ts pass (530 tests).
  • vp fmt, vp lint and knip:check on the changed files are clean, and t3 typecheck passes.

Code written with Claude Code (Claude Opus 5.5).

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Branch publishing now strips a branch-name prefix only when it matches the push destination remote. A test covers publishing local branch alice/fix to origin when alice is also a configured remote.

Changes: Destination-aware branch publishing

Layer / File(s) Summary
Resolve the published branch name
apps/server/src/vcs/GitVcsDriverCore.ts, apps/server/src/vcs/GitVcsDriverCore.test.ts
Publish destination resolution uses the selected remote when stripping a branch-name prefix. The test checks that publishing alice/fix to origin updates origin/alice/fix to the local HEAD.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#33581: Both PRs change publish branch-name resolution for branch names that resemble remote prefixes.

Suggested labels: bugfix

Suggested reviewers: saphid, juliusmarminge, stienswout

Merge Risk: Minimal · up to 6c23a

Publishing a new branch such as alice/fix to origin now keeps its full name when alice is a different remote, while a prefix matching the destination remote is still stripped. A regression test covers this. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a branch prefixed with another remote's name now publishes under its full name, and the fix is scoped to the server. It follows the conventional commit form and is spe…
Description check Passed The description follows the template sections: Problem, Change, Scope, and Verification. It explains the bug with reproduction steps and the affected helper. It explains the change and why all three c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a branch prefixed with another remote's name now publishes under its full name, and the fix is scoped to the server. It follows the conventional commit form and is specific enough for a teammate scanning history. It is somewhat long at 87 characters, but the length does not hurt clarity.

Full details: Description check

Explanation

The description follows the template sections: Problem, Change, Scope, and Verification. It explains the bug with reproduction steps and the affected helper. It explains the change and why all three callers pass the destination. It gives the scope rationale for not opening an issue. Verification names the new test, the failing and passing results, and the existing same-remote case, and it lists the checks run. It does not contain a model/harness line in the template's form, but it does name Claude Code, and the template asks for the model and harness, so this is covered. The description meets the template requirements.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between cd88f99 and 6c23a34.

Files selected for processing: 1

  • apps/server/src/vcs/GitVcsDriverCore.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 22, 2026
juliusmarminge and others added 2 commits November 22, 2026 14:26
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Publish local alice/fix with no upstream while origin and alice are configured remotes. In a real replay thread, select Git action options → Push. Same Chromium viewport, light theme, and fresh synthetic state on both commits.

Before After
ad2bdc76a5 6c23a34277
Before: pushed to origin/fix After: pushed to origin/alice/fix
Push recording Push recording

Base created refs/heads/fix. Head created refs/heads/alice/fix and recorded origin/alice/fix as upstream. The scenario failed on base and passed on head.

Scenario source

Not shown:

  • Fast-forwarding an existing unrelated origin/fix branch was not exercised; the reproduction started with only main on origin.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 22, 2026
@juliusmarminge
juliusmarminge merged commit 1d02824 into pingdotgg:main Nov 22, 2026
55 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 22, 2026
gianpaj pushed a commit to gianpaj/t3code that referenced this pull request Nov 22, 2026
…nder its full name (pingdotgg#40877)

Co-authored-by: Abhiram-745 <237478249+Abhiram-745@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 22, 2026
**v0.1.12-nightly.20261122.5111** · 30 changes from 10 contributors

- **Multi-file diffs.** Open diff now shows every file in a multi-file Codex patch.
- **Mixed-content paste.** Pasting a message with text and a picture now keeps both.
- **Queued attachments.** Edit a queued message without losing its image or file attachment chips.
- **Pull request checks.** Agents watching a pull request can recognize checks that already passed instead of waiting indefinitely.
- **Notebook outputs.** Saved HTML outputs now appear when you scroll them into view.

### Plus 24 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* perf(mobile): keep image bytes outside draft JSON by @t3dotgg in pingdotgg/t3code#9727
* fix(server): watch_pull_request says when checks already passed by @juliusmarminge in pingdotgg/t3code#40866
* fix(codex): Open diff shows every file of a multi-file patch by @Abhiram-745 in pingdotgg/t3code#40874
* fix(server): ACP startup gives up when the agent never answers the handshake by @juliusmarminge in pingdotgg/t3code#40864
* fix(server): a branch prefixed with another remote's name publishes under its full name by @Abhiram-745 in pingdotgg/t3code#40877
* fix(server): list open delegated tasks when task_status or task_cancel finds no match by @Project516 in pingdotgg/t3code#40886
* fix(gitlab): find merge requests opened from a fork by @Abhiram-745 in pingdotgg/t3code#40894
* fix(web): pasting a chat message with text and a picture keeps both by @juliusmarminge in pingdotgg/t3code#40909
* fix(antigravity): bound silent post-settle background command holds by @Lokkuchakreshkumar in pingdotgg/t3code#40858
* fix(desktop): WSL is not offered or started when only the Windows install stub exists by @juliusmarminge in pingdotgg/t3code#40918
* fix(server): idle /ws connections behind a reverse proxy no longer drop every 60s by @juliusmarminge in pingdotgg/t3code#40932
* fix(server): thread reads no longer attribute T3 Code's compact-before-send /compact to the user by @juliusmarminge in pingdotgg/t3code#40934
* fix(web,mobile): @-file mentions show by name in message previews, not as raw links by @tiliakoos in pingdotgg/t3code#40924
* fix(web): tool calls stay grouped after a usage-limit pause again by @matthew-waters in pingdotgg/t3code#40905
* fix(server): t3 doctor no longer reports a database just under 1 GiB as "1024.0 MiB" by @tiliakoos in pingdotgg/t3code#40952
* fix(web): show clone failure after progress is dismissed by @StiensWout in pingdotgg/t3code#40951
* Invalidate pending theme imports when a replacement is too large by @StiensWout in pingdotgg/t3code#40965
* fix(mobile): show linked thread history page errors by @StiensWout in pingdotgg/t3code#40973
* fix(client-runtime): skip waiting for lower-priority linked addresses by @StiensWout in pingdotgg/t3code#40989
* fix(web): navigate Excel sheets from the focused tab by @StiensWout in pingdotgg/t3code#41008
* fix(mobile): bound app-owned composer attachment filenames by @StiensWout in pingdotgg/t3code#40991
* fix(web): prioritize visible saved notebook outputs by @StiensWout in pingdotgg/t3code#40998
* fix(web): editing a queued message keeps its attachment chips resolved by @smirea in pingdotgg/t3code#40945
* fix(server): unlinking an environment ends its session on the other machine by @juliusmarminge in pingdotgg/t3code#41005
* fix(mobile): scope Git result banners to their originating thread by @StiensWout in pingdotgg/t3code#41015
* fix(web): keep the conversation when a pairing tab closes by @StiensWout in pingdotgg/t3code#41025
* fix: restart linked thread reads when trying again by @StiensWout in pingdotgg/t3code#41020
* fix(client-runtime): count ambiguous projects in chat file links by @StiensWout in pingdotgg/t3code#40986
* fix(mobile): keep media actions on each sent image page by @StiensWout in pingdotgg/t3code#41018
* perf(server): a run's provider turn lookup is linear, not quadratic by @navidnadali in pingdotgg/t3code#38791

## New Contributors
* @Lokkuchakreshkumar made their first contribution in pingdotgg/t3code#40858
* @matthew-waters made their first contribution in pingdotgg/t3code#40905

**Full Changelog**: pingdotgg/t3code@v0.1.12-nightly.20261122.5098...v0.1.12-nightly.20261122.5111

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.12-nightly.20261122.5111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants