Skip to content

fix(web): Git actions follow the selected thread - #18862

Merged
Yash-Singh1 merged 1 commit into
mainfrom
fix/git-actions-selected-thread
Oct 13, 2026
Merged

Yash-Singh1 merged 1 commit into
mainfrom
fix/git-actions-selected-thread

Conversation

@Yash-Singh1

Copy link
Copy Markdown
Collaborator

Problem

After switching threads, the details panel can show the new checkout while Commit, push & PR operates on the first checkout. Progress and error toasts also target the first thread, making the visible button appear to do nothing.

The memo wrapper added in #18077 exposes React 19.2's stale useEffectEvent behavior inside memoized components. The issue is tracked upstream in react/react#34818.

Change

Replace the Git action Effect Event with a dependency-aware useCallback, keeping the panel memoized. Each rendered button uses its current checkout and thread; retained toast actions keep the checkout and thread that produced them. Update the existing permission tests and add real React lifecycle coverage using the same memo wrapper as the details panel.

Scope and approval

This is a focused correction of a reproduced Git action bug. It changes no UI appearance, contracts, provider adapters, or server behavior.

Verification

  • Reproduced in installed Nightly: clicking the styling thread's button sent a Git request to the Claude Stop worktree.
  • Before the fix, the memoized navigation regression fails: after switching to /second, the action sends cwd: /first and threadId: first. With the fix, it passes through first → second → first navigation.
  • vp test run apps/web/src/components/GitActionsControl.lifecycle.test.ts apps/web/src/components/GitActionsControl.test.ts apps/web/src/components/GitActionsControl.logic.test.ts apps/web/src/state/sourceControlActions.test.ts packages/client-runtime/src/state/vcsAction.test.ts: 117 tests passed across 5 suites.
  • vp run --filter @t3tools/web typecheck: passed.
  • Scoped vp lint on the 3 changed files: passed, with one existing react(memo-dependencies) warning at GitActionsControl.tsx:612.
  • Scoped vp fmt --check and git diff --check: passed.

Made with GPT-6.1-Sol through the Codex harness in T3 Code.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 13, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 13, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 76a7487

Macroscope's review found this PR approvable — This is a focused, self-contained fix to existing Git action context handling in a memoized web panel. The added lifecycle coverage verifies both current-thread actions and retained toast actions without introducing schema, infrastructure, default, or static-analysis changes.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 03c9e66e-dd79-4288-bef1-364d28da3d44
📥 Commits

Reviewing files that changed from the base of the PR and between ffb4af8 and 76a7487.

📒 Files selected for processing (3)
  • apps/web/src/components/GitActionsControl.lifecycle.test.ts
  • apps/web/src/components/GitActionsControl.test.ts
  • apps/web/src/components/GitActionsControl.tsx

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

📝 Walkthrough

Walkthrough

GitActionsControl now binds its Git action handler with useCallback. Lifecycle tests verify how retained toast actions and quick-action buttons use thread and working-directory values across navigation.

Changes

Git action lifecycle

Layer / File(s) Summary
Bind the handler to render state
apps/web/src/components/GitActionsControl.tsx
GitActionsControl replaces useEffectEvent with useCallback and lists the captured state and functions as dependencies.
Verify action behavior across navigation
apps/web/src/components/GitActionsControl.test.ts, apps/web/src/components/GitActionsControl.lifecycle.test.ts
The mock records useCallback handlers. Lifecycle tests check retained toast actions against the originating thread and working directory, and quick actions against the current values.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 76a74

No identified issue prevents merging after normal checks.

Pre-merge checks · Passed 4
Passed Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main fix: Git actions now follow the selected thread.
Description check Passed The description covers the problem, change, scope, approval rationale, and detailed verification results. It also identifies the affected React behavior and lists the relevant tests and checks.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: ffb4af8 · PR result: 76a7487 · 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.

@Yash-Singh1
Yash-Singh1 merged commit b03534f into main Oct 13, 2026
33 checks passed
@Yash-Singh1
Yash-Singh1 deleted the fix/git-actions-selected-thread branch October 13, 2026 00:15
@Yash-Singh1
Yash-Singh1 restored the fix/git-actions-selected-thread branch October 13, 2026 00:16
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 13, 2026
## What's Changed
* fix(web): Git actions follow the selected thread by @Yash-Singh1 in pingdotgg/t3code#18862
* fix(desktop): preserve updater failure causes in diagnostics by @Yash-Singh1 in pingdotgg/t3code#18864
* fix(web): attach dropped threads to pending answers by @Yash-Singh1 in pingdotgg/t3code#18789
* fix(web): keep button text stable during press scaling by @Yash-Singh1 in pingdotgg/t3code#18866
* fix(bitbucket): preserve PR head commits for review guides by @ahilles107 in pingdotgg/t3code#18402
* fix(server): return null for unresolved optional commands by @Yash-Singh1 in pingdotgg/t3code#18871
* fix: show computer-use action titles and align app icons by @Yash-Singh1 in pingdotgg/t3code#18865

## New Contributors
* @ahilles107 made their first contribution in pingdotgg/t3code#18402

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261013.3040...v0.0.46-nightly.20261013.3042

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261013.3042
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 13, 2026
## What's Changed
* fix(web): Git actions follow the selected thread by @Yash-Singh1 in pingdotgg/t3code#18862
* fix(desktop): preserve updater failure causes in diagnostics by @Yash-Singh1 in pingdotgg/t3code#18864
* fix(web): attach dropped threads to pending answers by @Yash-Singh1 in pingdotgg/t3code#18789
* fix(web): keep button text stable during press scaling by @Yash-Singh1 in pingdotgg/t3code#18866
* fix(bitbucket): preserve PR head commits for review guides by @ahilles107 in pingdotgg/t3code#18402
* fix(server): return null for unresolved optional commands by @Yash-Singh1 in pingdotgg/t3code#18871
* fix: show computer-use action titles and align app icons by @Yash-Singh1 in pingdotgg/t3code#18865

## New Contributors
* @ahilles107 made their first contribution in pingdotgg/t3code#18402

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261013.3040...v0.0.46-nightly.20261013.3042

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261013.3042
aorwall added a commit to aorwall/t3code that referenced this pull request Oct 13, 2026
Merges upstream `pingdotgg/t3code` `5070a83a32` (48 commits, base
`e688034b5f`) into the fork. It does not stack on another PR.

## Merge
- 240 of 240 upstream-range files landed. Fork delta: 775 files.
- One conflict: `apps/web/src/routeTree.gen.ts`, regenerated for
upstream's new `/_chat/new` route. The other 18 files both sides touched
auto-merged: `duplicate-adds` and `resolution-check` are clean, and
every delta guard holds.
- `pnpm-lock.yaml` was re-derived by install, and `verify --only
lockfile` passes.
- Sweep: `promptLinks/HostedPromptLinkLanding.tsx` renders only in the
`hosted-static` auth state, which Moatless never reaches. Taken as
upstream's.
- Unsupported methods: ADD 0, DROP 0.

## Verification
`verify.mjs` passes duplicate-adds, tripwires, resolution-check,
unsupported-methods, lockfile, fmt, lint, typecheck and build. `test`
fails only on files that fail alone and failed the same way on the last
three merges, because of the sandbox: shared `AgentScope`
(`oom_score_adj` is 935 here), server `ServerBrowserPage` (no Playwright
browser), `AcpAdapterV2`, `OrchestratorReplayFixtures`, and
provider-opencode `OpenCodeServerLedger`.

## Usable as-is
- Prompt links (pingdotgg#18454): `/new?prompt=…`, `ThreadLinkPrompt` on thread
routes, and copy-prompt-link from messages and the command palette.
Choosing a project and placing the prompt work against Moatless.
- Terminal colors (pingdotgg#17168), context meter rounding (pingdotgg#17539), stable
button text (pingdotgg#18866), setup wizards follow themes (pingdotgg#18725), Git actions
follow the selected thread (pingdotgg#18862), dropped threads attach to pending
answers (pingdotgg#18789), the compact merge-button second click (pingdotgg#18878), a
numeric `q` on pull requests (pingdotgg#18666), the home-page bounce fix
(pingdotgg#18672), running terminals shown in the sidebar (pingdotgg#18740), and
computer-use titles (pingdotgg#18865).
- Mobile and desktop fixes (theme contrast, settings rows, the PR action
bar, image caching, the iOS 27.2 black screen, Hyprland, updater
diagnostics).
- "Update everything" sidebar pill (pingdotgg#18053): inert against Moatless,
which advertises no `serverSelfUpdate` or `versionAdvisory`.

## Unsupported in Moatless / needs implementation
- Prompt-link "clone this repository"
(`NewThreadLinkView.cloneRepository`): needs `projectClone.start` and
the `projectCloneTracking` capability. It refuses with a message today.
Added to gaps.md under *Project and repository management*.
- Renaming built-in models (pingdotgg#18840): saves through
`server.updateSettings` (custom model entry with a built-in slug). It
stays behind `FEATURES.providerConfiguration`, under the existing
settings gap.
- Provider secret settings (pingdotgg#18505, `secretSetting` and
`isSecretSetting` in contracts): stored on the host, so they fall under
the same settings gap.

## Backend behavior to consider reproducing in Moatless
Recorded in gaps.md under *Runtime fixes upstream made to its own
server*:
- A confirmed Claude subagent outcome settles that task and its child
work (pingdotgg#18778, the new `subagent` target on
`thread.background-work.settle`).
- Claude thinking before a tool call stays a collapsed Thought (pingdotgg#18887).
- Codex title and branch-name generation no longer starts the user's MCP
servers (pingdotgg#17058).
- The event store resyncs a thread holding an event type from a newer
build (pingdotgg#15937, `isKnownOrchestrationV2EventType`).
- A migration id clash stops startup with a clear error (pingdotgg#15925).
- Cached branch PR lookups start no git process (pingdotgg#17063).
- PR head commits are reported for Forgejo, GitLab and Bitbucket
(pingdotgg#18463, pingdotgg#18608, pingdotgg#18402), and PR bases resolve to branch names (pingdotgg#18754).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
Moatless task:
https://moatless.soaplabstest.com/tasks/dcd13b46-6495-4b1d-af7c-03da83644d11
adampeterhiggins added a commit to adampeterhiggins/t3code that referenced this pull request Oct 13, 2026
* fix(gitlab): merge request details report their head commit (pingdotgg#18608)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* feat(server): rename built-in models from settings (pingdotgg#18840)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): Git actions follow the selected thread (pingdotgg#18862)

* fix(desktop): preserve updater failure causes in diagnostics (pingdotgg#18864)

* fix(web): attach dropped threads to pending answers (pingdotgg#18789)

* fix(web): keep button text stable during press scaling (pingdotgg#18866)

* fix(bitbucket): preserve PR head commits for review guides (pingdotgg#18402)

* fix(server): return null for unresolved optional commands (pingdotgg#18871)

* fix: show computer-use action titles and align app icons (pingdotgg#18865)

* fix(server): apply confirmed Claude subagent outcomes (pingdotgg#18778)

* fix(mobile): Browser page no longer logs a duplicate key warning (pingdotgg#18776)

* fix(web): a numeric q in the pull requests URL no longer crashes the page (pingdotgg#18666)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(client): T3 Connect clients reconnect once a new tunnel is ready (pingdotgg#16554)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(web): leaving the home page while the app loads no longer bounces you to a new draft (pingdotgg#18672)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(mobile): attachment images no longer re-download on every reconnect (pingdotgg#18824)

Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): a migration id clash stops startup with a clear error instead of crash-looping (pingdotgg#15925)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: PR Batch Tester <agent@local.test>

* fix(server): a thread with an event type from a newer build can still resync after a downgrade (pingdotgg#15937)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: PR Batch Tester <agent@local.test>

* fix(server): Codex titles and branch names no longer start the user's MCP servers (pingdotgg#17058)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>

* fix(server): Claude thinking before a tool call stays a collapsed Thought (pingdotgg#18887)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>

* perf(server): cached branch PR lookups no longer start git processes (pingdotgg#17063)

* fix(web): compact merge buttons show when they need a second click (pingdotgg#18878)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(mobile): pull requests load from another environment when theirs is offline (pingdotgg#18698)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* perf(web): collect active tool calls without array shifts (pingdotgg#18853)

Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>

* fix(web): center the pace icon on the limit card's "left" label (pingdotgg#18580)

* fix(web): update everything includes npm-installed servers again (pingdotgg#18709)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(server): review guides find Bitbucket heads reported by short hash (pingdotgg#18900)

Co-authored-by: Pawel Mikolajczuk <pmikolajczuk@atlassian.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): scheduled task model picker no longer shifts the dialog (pingdotgg#18940)

* fix(ci): CodeRabbit reviews no longer request changes (pingdotgg#18954)

---------

Co-authored-by: Scott Norteman <snorteman@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
Co-authored-by: Paweł Mikołajczuk <pawel@mikolajczuk.in>
Co-authored-by: Tristan Knight <admin@snappeh.com>
Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com>
Co-authored-by: PR Batch Tester <agent@local.test>
Co-authored-by: Bryce Bjork <brycedbjork@gmail.com>
Co-authored-by: maria <maria@kuuro.net>
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
Co-authored-by: Dara Adedeji <76637177+SunkenInTime@users.noreply.github.com>
Co-authored-by: Antony <97451137+TonybynMp4@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Alex Southwell <saphid@gmail.com>
Co-authored-by: SAPHID <saphid@users.noreply.github.com>
Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Akash Moradiya <64416825+akash3444@users.noreply.github.com>
Co-authored-by: Pawel Mikolajczuk <pmikolajczuk@atlassian.com>
Co-authored-by: oliver <97427849+flamboh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants