GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Refresh upstream state after branch checkout and invalidate git queries by juliusmarminge · Pull Request #46 · pingdotgg/t3code

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Feb 15, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

  • refresh tracked upstream metadata after git checkout by fetching the checked-out branch's remote (quiet, no-tags)
  • ensure checkout-derived status reflects current ahead/behind counts when the remote branch has advanced
  • add an integration test covering the stale-behind-count scenario after checkout
  • invalidate git-related React Query caches on turn/completed events so UI git state refreshes promptly

Testing

  • Added integration test in apps/server/src/git.test.ts that:
  • creates a remote + source + clone setup
  • advances the remote tracked branch from another clone
  • checks out the branch locally and asserts aheadCount === 0 and behindCount === 1
  • Verified implementation path in apps/server/src/git.ts calls upstream refresh after successful checkout
  • Not run: project lint scripts
  • Not run: full test suite

Open with Devin

Summary by CodeRabbit

  • New Features

    • Checkout now attempts to refresh upstream tracking after switching branches.
    • UI invalidates git queries when background events complete to keep git state up to date.
  • Bug Fixes / Resiliency

    • Checkout proceeds even if the upstream refresh/fetch fails; a single fetch retry is attempted and failures are best-effort only.
  • Tests

    • Added tests covering upstream behind-count, scoped fetch behavior, and checkout behavior during refresh/fetch failures.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@juliusmarminge
Refresh branch upstream after checkout and invalidate git queries
4c77205
- fetch tracked remote after checkout to update ahead/behind counts
- add integration test for behind count when remote branch advances
- invalidate git React Query data on `turn/completed` events in the web app
@coderabbitai

coderabbitai Bot commented Feb 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Walkthrough

Adds best-effort upstream refresh after branch checkout in the server Git service, two tests validating upstream behind-count and checkout resilience to fetch failures, and client-side invalidation of Git queries on "turn/completed" events.

Changes

Cohort / File(s) Summary
Git Tests
apps/server/src/git.test.ts
Adds multiple tests that create a bare remote, a local source repo, and a clone to verify upstream behind-count after remote branch advancement, that checkout proceeds when an upstream fetch/refresh fails, and that fetches are scoped to the checked-out branch.
Git Operations (server)
apps/server/src/git.ts
Adds a private refreshCheckedOutBranchUpstream(cwd: string) to resolve the current branch upstream and run a branch-scoped git fetch; checkoutBranch now calls this method after checkout (best-effort, failures ignored). Note: the new method appears duplicated in the class locations.
Client: event-driven invalidation
apps/web/src/App.tsx
Imports useQueryClient and invalidateGitQueries, and invokes invalidateGitQueries(queryClient) when event.method === "turn/completed" in EventRouter; adds queryClient to effect dependencies.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Client as Web Client
participant Server as GitService
participant Remote as Remote Git (bare repo)
Client->>Server: request checkoutBranch(repo, branch)
Server->>Server: git checkout
Server->>Server: resolve upstream (remote + ref)
Server->>Remote: git fetch
Remote-->>Server: fetch result
Server-->>Client: checkout result (fetch errors ignored)

mermaid
sequenceDiagram
participant EventRouter as Web EventRouter
participant QueryClient as React QueryClient
participant ServerAPI as Server Git API
EventRouter->>QueryClient: invalidateGitQueries(queryClient)
QueryClient->>ServerAPI: refetch Git-related queries
ServerAPI-->>QueryClient: latest Git data
QueryClient-->>EventRouter: updated data (subscribers)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main changes: refreshing upstream state after branch checkout and invalidating git queries in the UI.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch git-in

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Feb 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Greptile Summary

Added upstream branch refresh after checkout to ensure accurate ahead/behind counts when remote branches advance, plus UI query invalidation on agent turn completion.

Key changes:

  • refreshCheckedOutBranchUpstream() fetches the checked-out branch's upstream refspec after successful checkout (scoped fetch, not all remote refs)
  • Fetch failures are silently caught since checkout already succeeded (best-effort refresh)
  • Integration tests verify behind-count accuracy, failure tolerance, and refspec scoping
  • UI now invalidates git-related React Query caches on turn/completed events to reflect post-agent git state

Confidence Score: 4/5

  • Safe to merge with minor considerations around error handling patterns
  • Implementation follows CLAUDE.md priorities (reliability, predictable failure behavior) by wrapping fetch in try-catch and scoping to specific refspec. Comprehensive test coverage validates the happy path, failure tolerance, and refspec scoping. The UI integration properly invalidates queries. Previous review comments addressed fetch scoping and error masking concerns.
  • No files require special attention

Important Files Changed

Filename Overview
apps/server/src/git.ts Added refreshCheckedOutBranchUpstream method to fetch upstream state after checkout, properly scoped to the checked-out branch's refspec, with error tolerance
apps/server/src/git.test.ts Added three comprehensive integration tests covering behind-count refresh, fetch failure tolerance, and refspec scoping
apps/web/src/App.tsx Invalidates git queries on turn/completed events to ensure UI reflects current git state after agent operations

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as App.tsx
    participant API as Git API
    participant Git as GitCoreService
    participant Remote as Git Remote

    User->>API: checkout branch
    API->>Git: checkoutBranch()
    Git->>Git: executeGit(["checkout", branch])
    Note over Git: Checkout succeeds
    
    Git->>Git: refreshCheckedOutBranchUpstream()
    Git->>Git: gitStdout(["rev-parse", "@{upstream}"])
    Git-->>Git: "origin/feature-branch"
    Git->>Git: Parse remote name and branch
    Git->>Remote: git fetch --quiet --no-tags origin +refs/heads/feature:refs/remotes/origin/feature
    
    alt Fetch succeeds
        Remote-->>Git: Updated refs
        Git-->>API: Checkout complete
    else Fetch fails
        Note over Git: Silently catch error
        Git-->>API: Checkout complete (best effort)
    end
    
    API-->>UI: Checkout result
    
    Note over UI: On turn/completed event
    UI->>UI: invalidateGitQueries(queryClient)
    UI->>API: Re-fetch git status
    API->>Git: statusDetails()
    Git-->>API: Current ahead/behind counts
    API-->>UI: Updated git state
    Note over UI: UI shows fresh git status
Loading

Last reviewed commit: 147f433

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Feb 15, 2026
View reviewed changes

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/git.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented Feb 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Refresh the checked-out branch’s upstream after GitCoreService.checkoutBranch and invalidate Git React Query caches on turn/completed events

Add GitCoreService.refreshCheckedOutBranchUpstream to run a scoped fetch after checkout and call it best-effort from GitCoreService.checkoutBranch; invalidate Git-related queries in App.EventRouter on turn/completed; add tests covering behind count refresh, fetch scoping, and failure tolerance in apps/server/src/git.test.ts and logic in apps/server/src/git.ts and apps/web/src/App.tsx.

📍Where to Start

Start with GitCoreService.refreshCheckedOutBranchUpstream and its invocation inside GitCoreService.checkoutBranch in apps/server/src/git.ts.


Macroscope summarized 147f433.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Make checkout tolerate upstream refresh failures
ca2acb0
- treat post-checkout upstream fetch as best effort so checkout still succeeds
- route refresh fetch through `this.git(...)` for consistent behavior
- add regression test for fetch-timeout during branch checkout
@juliusmarminge

juliusmarminge commented Feb 15, 2026

Copy link
Copy Markdown
Member Author

@greptileai review

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Feb 15, 2026
View reviewed changes

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/git.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
Scope branch refresh fetch to checked-out upstream refspec
147f433
- derive upstream branch from `branch@{upstream}` and guard empty values
- fetch only `+refs/heads/<branch>:refs/remotes/<remote>/<branch>` instead of all remote refs
- add integration test asserting scoped fetch args during `checkoutBranch`
@juliusmarminge

juliusmarminge commented Feb 15, 2026

Copy link
Copy Markdown
Member Author

@greptileai review

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge merged commit 6708fe9 into main Feb 15, 2026
3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

DavidIlie added a commit to DavidIlie/t3code that referenced this pull request Mar 13, 2026
@DavidIlie
upstream: inline branch filtering, fix fork PR upstream tracking
bbe966f
Port upstream commits ac3f22c..268016d:
- Inline branch picker filtering and drop PR-only shortcut (pingdotgg#46)
- Fix PR thread upstream tracking for fork branches (pingdotgg#47)

Removes filterBranchPickerItems shared function in favor of inline filtering,
adds URL-derived fork identity resolution, ensures upstream tracking is
restored on local checkouts and reused worktrees, and simulates real
git checkout in fake GH CLI for integration tests.
piero-dev25 added a commit to piero-dev25/devgame that referenced this pull request Aug 4, 2026
@piero-dev25
docs: freeze the Editor Presence command protocol before anyone imple…
dbd0b8d
…ments it

Design for task pingdotgg#47, written now so the implementing lane gets a contract
rather than a paragraph.

The one decision worth recording: a command frame is FLAT, not nested. The
protocol already documents an inbound-flat / outbound-nested asymmetry, and the
stated reason is that an inbound frame describes one editor's own state while an
outbound frame carries a set of editors each needing a key. A command is
addressed to exactly one editor, so the same rule makes it flat. That asymmetry
has already caused one wrong implementation that failed SILENTLY -- the parser
just dropped the frame while the connection looked healthy -- so getting it
right up front is worth a spec.

Capability advertisement is required rather than optional, because the engines
genuinely differ: frame-step exists only on Unity through supported APIs. The
toolbar must not offer what an engine cannot do, and a hello without
capabilities defaults to play+stop so older plugins keep working.

Two rules that are easy to get backwards, both written down:
- A failed command is an in-band result, NOT a close code. The close-code set is
  a named set (4400/4401 = stop retrying), not a threshold, so closing a socket
  because Play failed would disconnect an engine over a recoverable error.
- Presence is a level; commands are edges. A Play queued while an editor was
  disconnected must not fire on reconnect -- the user's intent is stale by then.

Also records that pingdotgg#46 (authorization) gates this: the route authenticates but
does not authorize, and sits outside the compile-time net that would catch that.
No-scope-check on a read-only feed is a low-stakes bug; on a channel that makes
an editor execute code it is not.
@coderabbitai coderabbitai Bot mentioned this pull request Sep 17, 2026
feat(web): make pull request comments easier to scan #12150
Merged
maria-rcks pushed a commit to maria-rcks/t3libre that referenced this pull request Sep 21, 2026
@yordis
chore(deps): bump astro from 7.0.3 to 7.2.8 (pingdotgg#46)
22b725b
i2cjak referenced this pull request in BackplaneWorks/Backplane Sep 29, 2026
i2cjak
Merge pull request #46 from i2cjak/backplane/rooms-listed-once
0a884f8
Each room listed once
@Andrey170170 Andrey170170 mentioned this pull request Oct 3, 2026
feat(trellis): choose where previews listen in Settings → Trellis Andrey170170/t3code#23
Merged
This was referenced Oct 7, 2026
Mistake #16707
Closed
Mistake #16709
Closed
TomCohenDev pushed a commit to TomCohenDev/t3code that referenced this pull request Oct 18, 2026
@Yarden-zamir
Merge pull request pingdotgg#46 from Yarden-zamir/feat/pr-owner-filter
05c2fbb
feat(fork): owner filters with show only or hide, and filter chips
gmackie pushed a commit to gmackie/t3code that referenced this pull request Oct 20, 2026
gmackie
Merge pull request 'feat(source-control): T3CODE-35 ForgeGraph shows …
379c880
…one commit's changes' (pingdotgg#46) from T3CODE-35-commit-diff into custom-local
yasinuslu added a commit to yasinuslu/t3code that referenced this pull request Oct 20, 2026
@yasinuslu
Merge pull request 'fix(server): Claude threads recover when their se…
b7ebb25
…ssion cannot be resumed' (pingdotgg#46) from fix/resume-missing-session into yu-v2

Reviewed-on: ⁨https://git.nepjua.org/yasinuslu/t3code/pulls/46⁩
bigx333 added a commit to bigx333/t3code that referenced this pull request Nov 24, 2026
@bigx333 @claude
feat(pstack): port built-in pstack pack, orchestration wiring, and pa…
e4255fc
…ckaging

Port built-in pstack from scriptedalchemy/main (PRs pingdotgg#8, pingdotgg#12, pingdotgg#20, pingdotgg#25, pingdotgg#26,
pingdotgg#27, pingdotgg#38, pingdotgg#46, pingdotgg#51, pingdotgg#102, pingdotgg#117, pingdotgg#153) onto current main.

- packages/pstack (snapshot 0.15.43-t3code.1), shared/pstack, server pstack
  module and client-runtime providerSkills taken verbatim from the fork.
- Server: PstackPack layer, composer expansion on turn start and steer,
  pstack catalog in server config and live pstackUpdated snapshots,
  orchestrationTargets helpers shared with the MCP service, driverKind
  targets prefer instances advertising the requested model and options,
  orchestrator_capabilities allModels for setup-pstack, and native
  pstack@<marketplace> plugins switched off in Claude and Codex sessions.
- pstackEnabled is on by default; toggle lives in Settings > Labs on web
  and mobile, with i18n for all locales.
- Packaging: CLI build, CLI archive, desktop artifact, WSL tree and desktop
  backend carry the pack and point the server at it.

Adapted to main: no provider cooldowns or inference routes upstream, so
role resolution uses providerConstraints and the retired-route migration
and its tests are dropped; turn start expands only messages that
reference pstack; fork-only linked-delegation driverKind refusal is not
ported because main resolves driverKind remotely.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Luzivog Luzivog mentioned this pull request Nov 24, 2026
[Bug]: Antigravity native schedule pins turns in running indefinitely, starving queued runs and scheduled automations #41467
Open
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.