Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(projects): Git actions and pull requests per tracked repository #35924

Closedjuliusmarmingewants to merge 1 commit intot3/multi-repo-2-per-repo-review fromrefs/pull/35924/headopened View on GitHub

juliusmarmingecommented

Layer 3 of 4 of the multi-repository rebuild (discussion #7041). Stacked on layer 2.

A thread that changed several repositories could only commit, push and open a pull request for its own folder.

What changed

  • Repository sections. The thread details panel lists the repositories the thread changed, most recent first, each with its branch, counts and pull request. Expanding one gives the usual Git actions bound to that repository. At most four show, with "Show N more", and "Other repositories..." pins any tracked repository for the session.
  • One control, any folder. GitActionsControl takes the folder it acts on as a target. A repository section never writes its branch onto the thread.
  • Cost at rest. A collapsed section reads local status only: one watch on the repository's .git and no network. Only the expanded section uses the full subscription. Repositories the thread did not change are never subscribed.
  • Pull requests. An open pull request on a changed repository's branch is linked to the thread when the turn ends, and one created from a section is linked at once, so the sidebar and thread header show them.
  • Server guard. A tracked folder outside the project folder counts as a known workspace.
  • Mobile. The Git overview sheet has the same repository rows, picker and per-repository commit, push and pull request flow.

After

Thread details with a section per changed repository, api expanded

Known limits

  • Unlinking an auto-detected repository pull request does not stick: it is linked again at the next turn end.
  • A push to a branch that already has a pull request links it at the next thread event, not right after the push.
  • A repository section shows its branch but has no branch switcher.
  • "Other repositories..." is a plain menu, which is slow to scan with 70 repositories.

Proof

  • vp run check:changed: format, lint, knip, typecheck pass; 1,941 of 1,942 tests pass (same unrelated failure as layer 2).
  • Live in the web app: after a turn changed two repositories, both sections appeared; "Commit" in the api section committed in the api repository only.
  • Pushing and creating a pull request from a section was not exercised live (the fixture repositories have no remote).
  • Mobile: typecheck and unit tests only. Not run on a device.

Created with Claude Fable 5.2 in Claude Code, running in T3 Code, with subagents for the parallel build.

🤖 Generated with Claude Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. @@ -338,0 +365,21 @@
      365+ /** Folded away until the user asks for them. Clients render and subscribe for none of these. */
      366+ readonly hidden: ReadonlyArray<ThreadRepositorySection>;
      367+}
      368+
      369+const NO_SECTIONS: ThreadRepositorySections = Object.freeze({
      370+ visible: Object.freeze([]),
      371+ hidden: Object.freeze([]),
      372+});
      373+
      374+/**
      375+ * The repositories a thread changed, most recently changed first. A repository no turn has a
      376+ * checkpoint for yet sorts last, by name.
      377+ */
      378+export function threadChangedRepositories(
      379+ projection: Pick<OrchestrationV2ThreadProjection, "checkpoints" | "checkpointScopes">,
      380+): ReadonlyArray<ThreadRepositoryScope> {
      381+ const scopes = threadRepositoryScopes(projection);
      382+ if (scopes.length < 2) return scopes;
      383+ const lastChange = new Map<CheckpointScopeId, number>();
      384+ for (const [index, checkpoint] of projection.checkpoints.entries()) {
      385+ if (checkpoint.runId !== null) lastChange.set(checkpoint.scopeId, index);
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium state/threadRepositories.ts:385

      After a thread is loaded, threadChangedRepositories can rank repositories by scope ID instead of recency, causing a recently changed repository to be folded behind “Show more.” projection.checkpoints is ordered by scope and then ordinal, so its array index is not a cross-scope chronology; compare checkpoint chronology directly when determining each scope’s last change.

      🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
      In file @packages/client-runtime/src/state/threadRepositories.ts around line 385:
      
      After a thread is loaded, `threadChangedRepositories` can rank repositories by scope ID instead of recency, causing a recently changed repository to be folded behind “Show more.” `projection.checkpoints` is ordered by scope and then ordinal, so its array index is not a cross-scope chronology; compare checkpoint chronology directly when determining each scope’s last change.
    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs Human Approval

      Macroscope's review found this PR requires human approval — This adds per-repository Git actions and automatically attaches existing open pull requests from tracked repositories to eligible threads. The new automatic-linking default needs human confirmation because it changes persistent thread associations without an explicit linking action.

      Needs human approval because:

      • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

      No code changes detected at cfb1671. Prior analysis still applies.

      Adjust the Minimum Blocking Severity for this repo — including turning it Off — in [Settings](https://app.macroscope.com/pingdotgg/settings#Repos). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire—5.0 KiB—6.8 KiB✅
      CodexThread snapshot wire—3.8 KiB—4.9 KiB✅
      CodexLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      CodexLive turn WebSocket decoded—21.5 KiB—24.4 KiB✅
      CodexLive turn messages—1—8✅
      ClaudeTotal thread wire—5.0 KiB—6.8 KiB✅
      ClaudeThread snapshot wire—3.8 KiB—4.9 KiB✅
      ClaudeLive turn WebSocket wire—1.2 KiB—2.0 KiB✅
      ClaudeLive turn WebSocket decoded—21.9 KiB—24.4 KiB✅
      ClaudeLive turn messages—1—8✅

      Other scenarios

      No main baseline exists yet for these 64 scenario measurements.

      All 64 scenario measurements
      ProviderScenarioMetricMain baselineThis PRImpactPR ceiling
      Codexshort turn resumeWebSocket decoded—10.5 KiB—12.7 KiB✅
      Codexshort turn resumeWebSocket messages—2—2✅
      Codexlong turn running, cold openHTTP decoded—281.7 KiB—302.7 KiB✅
      Codexlong turn running, cold openrows—75—75✅
      Codexlong turn running, history pageHTTP decoded—92.4 KiB—107.4 KiB✅
      Codexlong turn running, history pagerows—75—75✅
      Codexlong turn finished, cold openHTTP decoded—381.5 KiB—410.2 KiB✅
      Codexlong turn finished, cold openrows—151—151✅
      Codexlong turn finished, socket cold openWebSocket decoded—381.6 KiB—410.2 KiB✅
      Codexlong turn finished, socket cold openWebSocket messages—2—2✅
      Codexlong turn finished, socket cold openrows—151—151✅
      Codexlong turn finished, work pageHTTP decoded—186.2 KiB—200.2 KiB✅
      Codexlong turn finished, work pagerows—150—150✅
      Codexidle thread resumeWebSocket decoded—65 B—200 B✅
      Codexidle thread resumeWebSocket messages—1—1✅
      Codexfleet shell snapshotHTTP decoded—42.4 KiB—53.7 KiB✅
      Codexfleet shell snapshotrows—27—27✅
      Codexfleet shell subscribeWebSocket decoded—65 B—200 B✅
      Codexfleet shell subscribeWebSocket messages—1—1✅
      Codexfleet shell resume checkHTTP decoded—18 B—100 B✅
      Codexfleet shell resume checkrows—0—0✅
      Codexstale shell reloadHTTP decoded—42.4 KiB—53.7 KiB✅
      Codexstale shell reloadrows—27—27✅
      Codexstale shell resumeWebSocket decoded—140 B—400 B✅
      Codexstale shell resumeWebSocket messages—2—2✅
      Codexstale todo list cold openHTTP decoded—72.4 KiB—83.0 KiB✅
      Codexstale todo list cold openrows—75—75✅
      Codexstale todo list cold opennodes—2—4✅
      Codexstale todo list cold opensubagents—2—4✅
      Codexstale todo list cold openplans—1—2✅
      Codexstale todo list cold openproviderTurns—1—2✅
      Codexstale todo list cold opencheckpoints—1—2✅
      Claudeshort turn resumeWebSocket decoded—10.6 KiB—12.7 KiB✅
      Claudeshort turn resumeWebSocket messages—2—2✅
      Claudelong turn running, cold openHTTP decoded—283.3 KiB—302.7 KiB✅
      Claudelong turn running, cold openrows—75—75✅
      Claudelong turn running, history pageHTTP decoded—93.4 KiB—107.4 KiB✅
      Claudelong turn running, history pagerows—75—75✅
      Claudelong turn finished, cold openHTTP decoded—384.2 KiB—410.2 KiB✅
      Claudelong turn finished, cold openrows—151—151✅
      Claudelong turn finished, socket cold openWebSocket decoded—384.3 KiB—410.2 KiB✅
      Claudelong turn finished, socket cold openWebSocket messages—2—2✅
      Claudelong turn finished, socket cold openrows—151—151✅
      Claudelong turn finished, work pageHTTP decoded—188.1 KiB—200.2 KiB✅
      Claudelong turn finished, work pagerows—150—150✅
      Claudeidle thread resumeWebSocket decoded—66 B—200 B✅
      Claudeidle thread resumeWebSocket messages—1—1✅
      Claudefleet shell snapshotHTTP decoded—43.0 KiB—53.7 KiB✅
      Claudefleet shell snapshotrows—27—27✅
      Claudefleet shell subscribeWebSocket decoded—66 B—200 B✅
      Claudefleet shell subscribeWebSocket messages—1—1✅
      Claudefleet shell resume checkHTTP decoded—18 B—100 B✅
      Claudefleet shell resume checkrows—0—0✅
      Claudestale shell reloadHTTP decoded—43.0 KiB—53.7 KiB✅
      Claudestale shell reloadrows—27—27✅
      Claudestale shell resumeWebSocket decoded—140 B—400 B✅
      Claudestale shell resumeWebSocket messages—2—2✅
      Claudestale todo list cold openHTTP decoded—73.4 KiB—83.0 KiB✅
      Claudestale todo list cold openrows—75—75✅
      Claudestale todo list cold opennodes—2—4✅
      Claudestale todo list cold opensubagents—2—4✅
      Claudestale todo list cold openplans—1—2✅
      Claudestale todo list cold openproviderTurns—1—2✅
      Claudestale todo list cold opencheckpoints—1—2✅

      Baseline: unavailable · PR result: cfb1671 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    5. Without flipping showChanges={false} (now it is) this whole thing is barely useable. But showChanges={true} is not solving "git changes are not visible" problem, since in home-repo / multi-repo case you want to grasp the modified files across, to see where the context boundary is.

      image

      Rest works lovely. Except 2 times nested git submodules (home-repo => git module => git submodule), but it's probably out of scope.

    6. Landed as part of #35925 (60863edc4), which carried the whole stack onto main after the tracking model was reworked. Closing this layer as superseded.

    7. juliusmarminge closed this

Sign in to join this conversation.