Skip to content

feat(web): pull request files can be marked as viewed - #7721

Merged
maria-rcks merged 96 commits into
pingdotgg:mainfrom
TrogonStack:yordis/feat-pr-files-viewed-upstream
Sep 17, 2026
Merged

maria-rcks merged 96 commits into
pingdotgg:mainfrom
TrogonStack:yordis/feat-pr-files-viewed-upstream

Conversation

@yordis

@yordis yordis commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

adds per-file viewed marks to the pull request code tab, with automatic folding and a "changed" state after a file is pushed. github uses its native marks; forgejo, gitlab, bitbucket, and azure devops keep marks per viewer on the connected t3 environment. azure devops gains the diff support needed for this review flow.

resolved conflicts with main, preserved viewed-only diff caching, and isolated stored marks by the requested repository even when another checkout supplies its credentials. truncated forgejo diffs cannot establish a false revision baseline.

verified against real forgejo 16.0.5 through tea 0.16.0 and the t3 web client: mark/unmark, folding, reload persistence, alpha-only changed detection after a real push, and modified/added/deleted/renamed/unicode filenames. a second real repository with the same pr number and filename verified storage isolation and adoption by a newly added checkout. sqlite readback confirmed separate keys and real blob revisions.

blacksmith: the 1,266-test scoped suite passed; all 157 service tests passed again after the isolation fix. the new isolation regression fails on the previous code. server/web typechecks and scoped lint passed. live gitlab, bitbucket, and azure sessions were not rerun; their existing adapter tests passed.

forgejo unmark expands the unicode diff and marking folds it while alpha remains changed

forgejo marks persisted after reload with only alpha changed

forgejo viewed marks in the light theme

final head c2b9144829b184090c005d36ab17e560604d06a3: all github checks passed, both independent final reviewers approved, and no review threads remain unresolved. the pr diff is 67 files, +9,014/-200, compared with 66 files, +8,805/-199 at takeover.

implemented and reviewed with gpt-6-astra via codex.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds viewed-file tracking across GitHub, GitLab, Bitbucket, and Azure DevOps. Adds environment persistence, RPC endpoints, provider revision APIs, optimistic client state, UI controls, Azure DevOps diff generation, and repository identity normalization.

Changes

Pull request review features

Layer / File(s) Summary
Contracts and persistence
packages/contracts/..., apps/server/src/persistence/...
Defines viewed-file states, RPC contracts, repository identity resolution, SQLite storage, and migration registration.
Provider integrations and diffs
apps/server/src/pullRequest/...
Adds provider viewed-state operations, revision lookup, Azure DevOps iteration reads, bounded content reads, local unified diff generation, and Bitbucket patch parsing.
Service orchestration
apps/server/src/pullRequest/PullRequestService.ts, apps/server/src/pullRequest/pullRequestViewedFiles.ts, apps/server/src/pullRequest/PullRequestService.test.ts
Routes host and environment storage, caches revisions, serializes writes, detects stale marks, and invalidates revision state.
RPC, client state, and UI
packages/client-runtime/..., apps/server/src/ws.ts, apps/web/src/components/pullRequest/...
Adds RPC handlers, serial command handling, optimistic overlays, debounced updates, viewed counts, stale indicators, and checkbox-driven folding.
Repository identity and navigation
packages/shared/src/git.ts, apps/web/src/lib/..., apps/web/src/components/..., docs/...
Normalizes Azure DevOps repository identities and uses the shared repository resolver in links, previews, and documentation.

Priority: ➖ Normal

Estimated code review effort: 5 (Critical) | ~120 minutes

Suggested reviewers: bil0000, juliusmarminge

Sequence Diagram(s)

sequenceDiagram
  participant Reader
  participant PullRequestCodeTab
  participant ClientRuntime
  participant WebSocket
  participant PullRequestService
  participant Provider
  participant ViewedRepository
  Reader->>PullRequestCodeTab: Toggle file viewed
  PullRequestCodeTab->>ClientRuntime: Queue viewed-state update
  ClientRuntime->>WebSocket: pullRequests.setFilesViewed
  WebSocket->>PullRequestService: setFilesViewed
  PullRequestService->>Provider: Read file revision when needed
  PullRequestService->>ViewedRepository: Store environment mark
  PullRequestService-->>WebSocket: Complete update
  WebSocket-->>ClientRuntime: Refresh viewed state
  ClientRuntime-->>PullRequestCodeTab: Render viewed or changed state
Loading

Merge Risk: 🟡 Moderate · up to 71c85

Large Azure-created or deleted files can produce oversized diff responses, increasing memory and transport risk. This should be bounded before merge.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 67.95% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 78 functions across 52 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description contains detailed change, testing, UI, and verification information, but it does not use the required What Changed, Why, UI Changes, and Checklist sections. It also does not provide th… Rewrite the description using the repository template headings. Add explicit What Changed and Why sections, keep the UI screenshots and interaction video under UI Changes, and complete the Checklist with the applicable items checked.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: adding per-file viewed marking to pull request views.
Full details: Docstring Coverage

Explanation

Docstring coverage is 67.95% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 78 functions across 52 files. (2 skipped: 2 unsupported.)

Full details: Description check

Explanation

The description contains detailed change, testing, UI, and verification information, but it does not use the required What Changed, Why, UI Changes, and Checklist sections. It also does not provide the required checklist responses.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Aug 20, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the changed web UI: the new viewed-file checkbox in the diff header, the counter in the toolbar, and the fold/overlay logic modules. Two findings, both on changed lines in PullRequestCodeTab.tsx.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/pullRequest/PullRequestCodeTab.tsx Outdated
Comment thread apps/web/src/components/pullRequest/PullRequestCodeTab.tsx Outdated
Comment thread apps/web/src/components/pullRequest/usePullRequestFilesViewed.ts Outdated
Comment thread apps/server/src/sourceControl/githubGraphQlBudget.ts Outdated
Comment thread apps/web/src/components/pullRequest/usePullRequestFilesViewed.ts Outdated
Comment thread apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
Comment thread apps/web/src/components/pullRequest/usePullRequestFilesViewed.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a cross-provider viewed-file workflow with persistent storage, new authenticated RPCs, client-side state management, and substantial Azure diff behavior. It also changes product defaults and adds static-analysis suppression directives, so the breadth and runtime impact require human review.

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

Comment thread apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
Comment thread apps/server/src/sourceControl/githubGraphQlBudget.ts Outdated
Comment thread apps/web/src/components/pullRequest/usePullRequestFilesViewed.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the web UI changes (PullRequestCodeTab.tsx, pullRequestDiff.logic.ts, pullRequestFilesViewed.logic.ts, usePullRequestFilesViewed.ts) for shared-primitive use, Tailwind/CSS ownership and virtualizer behavior.

Both findings from the previous run are resolved: the Checkbox no longer carries a partial size-* override, and truncated is now threaded through the hook and surfaced in the meta line with the same Tooltip + TriangleAlertIcon treatment the withheld-diff caveat uses. Two remaining items below — one virtualizer regression risk, one accessible-name issue on the new control.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/pullRequest/PullRequestCodeTab.tsx Outdated
Comment thread apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
yordis added 10 commits August 20, 2026 18:06
A review spread over an afternoon, or picked up on a second machine, started
again from the top every time, so large changes were read in the browser and
only small ones stayed here.

The marks are the host's rather than ours because a checkbox only this app
remembers is worse than none: it looks like the one GitHub shows, disagrees
with it, and leaves a reviewer unsure which of the two knows what they have
actually read.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…he window resets

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…since

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…at it is partial

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…he wrong way

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…count

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…carries

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
A press moved the whole viewed view, and every file header on screen was memoized on it, so one tick cost a rebuild of all of them. The same mark also has to say whether the control is offered at all, or a capability arriving after the first paint leaves the headers without a box.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
It borrowed its name from the label beside it, and that label turns into "Changed" once the file has been pushed to, leaving a reader who cannot see it with no idea what the box does.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/feat-pr-files-viewed-upstream branch from 1296cb6 to 6b44e51 Compare August 20, 2026 22:07
@yordis

yordis commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

GitHub

Screen.Recording.2026-08-20.at.6.15.29.PM.mov

The branch had drifted behind main far enough to conflict, which blocked
review of the change itself.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Comment thread apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
The button exists for a reader who can see that what they are looking at is
behind, so leaving one part of the page on the last read defeats the point of
pressing it. A push since that read is exactly when the mark beside a ticked
file stops being true.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Comment thread apps/web/src/components/pullRequest/usePullRequestFilesViewed.ts Outdated
An error the reader cannot act on, about a press they have already replaced,
reads as their current tick having been lost when it has not.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One finding on the new viewed-files hook: the command-failure path surfaces an error toast for interrupt-only failures, which diverges from the repo's established useAtomCommand failure convention. Everything else in the web scope (Checkbox/Tooltip primitive use, the amber caveat icon matching the adjacent meta-line pattern, header portal render-prop stability via refs, explicit environmentId threading) looks consistent.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/pullRequest/usePullRequestFilesViewed.ts
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

…s-viewed-upstream

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

# Conflicts:
#	apps/server/src/pullRequest/PullRequestService.ts
#	apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
#	docs/user/source-control.md
#	packages/contracts/src/pullRequest.test.ts
#	packages/shared/package.json
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@Bil0000 Bil0000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed 0d64740. Server, web, contracts, shared and mobile review suites green (765 / 449 / 29 / 42 / 71), typecheck clean on server, web and mobile, lint clean, CI green, up to date with main, no overlapping files.

Julius's round checks out against the code:

  • Azure summary is one az read now, and both reactors go through summary(), so the polled path no longer pays for iterations and changes.
  • The pause bypass is scoped to requiredViewerOf. Background reads hit rateLimits.check before the shared flight, so a paused host is not re-spawned per refresh, and the flight key is still caller-free so a listing and a press coalesce. The new test pins one lookup across an eleven-minute pause.
  • The overlay bug is fixed the right way. I reproduced the original with the logic helper (viewed pressed, host says dismissed, nothing pending, overlay kept) and confirmed the answered set retires it on the first read after the acknowledged write, with the hook tests covering the pushed-before-read sequence.
  • Bitbucket revisions now come off one parse, and a complete answer seeds the held entry for every file, so the tick after this one costs nothing. Docs and description corrected, migration is 052, comment density roughly halved.

One new bug, introduced by the complete-answer seeding, inline. It is Bitbucket only and only on a change with more than a thousand files, but the outcome is a mark that never reports Changed, which is the thing the feature exists to report. Reproduced through the service with a test that fails on this head.

Two notes, neither blocking on my side: the scope split Julius asked for has not happened, and that is his call, not mine. And the last commit rewrites an unrelated existing mobile test to drop its cross-entry-point equality assertion; main's version of that test passes against this head on my machine, so if it is a CI flake it deserves its own commit with the failure linked rather than riding in here.

Will approve once the trim is fixed.

Comment thread apps/server/src/pullRequest/pullRequestViewedFiles.ts
A whole-change answer wider than one entry's path cap trimmed away the reader's own files, which stored the mark without a baseline and left it reading viewed however far the head moved.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

@Bil0000 Bil0000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed 042e3c6. The trim bug is fixed: asked paths are seeded last, so the cap can only reach what the whole-change answer added. My repro (1178-file complete answer, tick f0000 and f0500, move both, refresh) now reports both as dismissed, and the new test beside the cap test covers the same shape and fails on the old ordering.

Server pull request suites green (753), typecheck and lint clean, CI green, merges clean with no overlapping files. The one-line change touches nothing else.

Approving. Scope split remains Julius's call.

@juliusmarminge juliusmarminge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Audit of 042e3c6

Verdict: fix first. Every blocker from my previous round is genuinely fixed and the branch is green on its own, but it cannot land as-is: it has a textual conflict with main on the migration number and, more importantly, a semantic conflict with #11888 that makes four of this PR's own viewed-files tests fail once main is merged in.

Blockers

1. pullRequests.invalidate no longer refreshes viewed marks after merging main.

#11888 (f4600d7) changed invalidate to canonicalise the reference through canonicalRef before bumping the epoch, so the epoch scope now carries the project's resolved host. Every other read (summary, detail, diff) goes through credentialCached, which canonicalises the input the same way, so their keys line up. filesViewed and setFilesViewed are exposed on the service raw and key on the client's un-hosted reference, so after the merge refEpoch(input) in the filesViewed cache key reads a scope that invalidate never bumps.

Consequence: on GitLab, Bitbucket and Azure, a reader who pushes and hits refresh keeps seeing "viewed" instead of "Changed" for up to FILES_VIEWED_CACHE_TTL, and the refresh path the docs promise for staleness stops working. On GitHub the host is authoritative so it is only a delayed re-read.

Evidence: merged origin/main into this head in a scratch worktree (migration renumbered to 053, see below) and ran apps/server/src/pullRequest/: 4 failures in PullRequestService.test.ts, all tests that use service.invalidate({ reference }):

  • reports a file pushed to since it was cleared as changed
  • leaves a mark alone when the host could not say what the head has of it
  • keeps the version it last heard when a later read of the head stops short
  • forgets what the head had of a marked file once a mutation moves the head

The same tests pass on the un-merged head (753/753). CI could not see this because the merge-ref check never ran while the PR reports as conflicting.

Smallest fix, verified (full merged server pullRequest + persistence + server.test.ts suite 1007/1007, server and web typecheck clean):

// PullRequestService.of({ ... })
filesViewed: (input) => canonicalRef(input).pipe(Effect.flatMap(filesViewed)),
setFilesViewed: (input) => canonicalRef(input).pipe(Effect.flatMap(setFilesViewed)),

plus input.host ?? null as a slot in the filesViewedCache key and the matching field in its loader:

const [, , projectId, host, repository, number] = JSON.parse(key) as [number, number, string, string | null, string, number];
return viewedFiles.filesViewed({ projectId, ...(host === null ? {} : { host }), repository, number } as PullRequestRef);

2. Migration 052 is taken. Main now has 052_ProjectionThreadTitleState.ts (#10720), so Migrations.ts conflicts and this PR's file needs to become 053_PullRequestFilesViewed.ts. Mechanical, but it is why GitHub reports the PR as conflicting and why blocker 1 was invisible.

Previous findings, re-checked

All three blockers from my last round are resolved and hold up:

  • Azure polling cost (5a5b7bd): getChangeRequestSummary is a single az read, so the reactor's one-minute poll no longer walks iterations.
  • Global getViewer pause bypass (4c404a8): opt-in via viewerAllowsPause, only requiredViewerOf asks for it, background resolveViewers callers hit rateLimits.check before joining the shared flight. The project-registration call site does not pass the flag. Pinned by c98d31b.
  • Optimistic tick hiding a pushed file (63ea078): the press retires on the first read that lands after the acknowledged write, regardless of whether the host agrees. The hook test covers the push-between-write-and-read sequence.

Also confirmed: Bitbucket revisions off one parsed patch with the asked-paths-last trim fix (042e3c6), and the revision guide now matches the implementation on a failed press.

Non-blocking

  • Unrelated mobile test rewrite (0d64740). The preceding merge commit did fail CI on shikiReviewHighlighter.test.ts (run 34856951033), so it was not invented. But main's version of that test passed 3/3 for me on the merged tree, and the rewrite drops the assertion that highlightSourceFile and highlightCodeSnippet produce equal tokens. That is a weakening of a test this PR does not otherwise touch. It belongs in its own PR with the failure linked; if it is a grammar warm-up flake, fix the warm-up rather than remove the equality.
  • Scope. Still four PRs in one: viewed marks; Azure diff support with the new diff dependency; Azure SSH remote canonicalisation in packages/shared/src/git.ts; the gitPatchPath quoted-name fix across web and mobile. At minimum the Azure diff work and the remote canonicalisation should land separately, since each changes behaviour for Azure users who never touch a checkbox.
  • Squash on merge.

Verification

  • PR head: server src/pullRequest/ + src/persistence/PullRequestFilesViewed 753/753; web components/pullRequest/ + lib/diffRendering + lib/openPullRequestLink 449/449; shared 836/836; contracts pullRequest 29/29.
  • Head merged with origin/main (migration renumbered to 053): server pullRequest + persistence + server.test.ts 1007/1007 only with the canonicalRef patch above; 4 failures without it. Server and web typecheck clean on the patched merge.
  • CI is green on 042e3c6 but runs against the head, not the merge.
  • Not verified: live GitLab/Bitbucket/Azure calls, and no browser pass on the UI.

Audit by Claude Fable 5 via Claude Code.

…s-viewed-upstream

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

# Conflicts:
#	apps/server/src/persistence/Migrations.ts
The equality it dropped guards a test this change does not otherwise
touch, and the CI flake behind the rewrite is load-sensitive rather than
a property of viewed marks. Both belong in their own change.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis

yordis commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

On the scope point: I cannot use gh stack from a fork, so splitting this into stacked PRs is not an option on my side. Keeping it as one PR.

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6-astra on behalf of Maria

@juliusmarminge ready for another review at f28664a. Current main is integrated, migration is 053, and credential-aware cache keys use the current reference encoding. The unrelated mobile highlighter test rewrite is no longer in the PR diff.

The takeover also fixed collapsed-default viewed gestures, quoted GitHub/GitLab filenames, account guards and environment routing, and viewed-only invalidation (including skipping linked-thread sync). All latest CI checks pass. Blacksmith passed 374 focused regression tests and 203 server/sync tests, relevant typechecks and scoped lint. Two independent final reviewers approved this exact head. Both outstanding inline threads are resolved.

The PR body includes live GitHub mark/unmark evidence, independent provider readback, and the no-diff-refetch check. Live GitLab/Bitbucket/Azure sessions were not rerun; their automated coverage and the author's demos remain linked.

Your earlier request to split Azure diff support and SSH canonicalization remains a scope decision. I preserved the existing PR and history rather than splitting or replacing it during this takeover. Please re-review the fixes and that remaining scope question; your changes-requested review is still active.

@maria-rcks
maria-rcks merged commit 0395008 into pingdotgg:main Sep 17, 2026
19 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 18, 2026
## What's Changed
* fix(web): keep thoughts and failed tool calls in one activity row by @maria-rcks in pingdotgg/t3code#12270
* fix(web): avoid reopening settled threads when adding projects by @dominic-r in pingdotgg/t3code#11804
* feat(mobile): make Settings easier to navigate and scope by @juliusmarminge in pingdotgg/t3code#12272
* fix(mobile): prevent overlapping text and UI on Android chat messages by @Exotic209093 in pingdotgg/t3code#11611
* feat(web): pull request files can be marked as viewed by @yordis in pingdotgg/t3code#7721
* fix(web): keep composer banners compact and readable by @Bil0000 in pingdotgg/t3code#12166
* fix(web): collapse thoughts within tool groups by @maria-rcks in pingdotgg/t3code#12302
* fix(usage): preserve saved totals after transcript cleanup by @maria-rcks in pingdotgg/t3code#12304
* fix(mobile): show Agent behavior icon on Android by @juliusmarminge in pingdotgg/t3code#12316

## New Contributors
* @Exotic209093 made their first contribution in pingdotgg/t3code#11611

**Full Changelog**: pingdotgg/t3code@v0.0.43-nightly.20260917.1866...v0.0.43-nightly.20260917.1880

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.43-nightly.20260917.1880
aorwall added a commit to aorwall/t3code that referenced this pull request Sep 18, 2026
Merges `pingdotgg/t3code` `6d1d549441..9946541` (50 commits) into the
fork.

Landed 304 files against 303 in the upstream range — the extra one is
`docs/fork/inventory.json`. Fork delta is 777 files, unchanged from the
last
merge. Everything upstream changed landed.

Six conflicts, each resolved with the verdict `preflight.mjs` printed;
five were
a single hunk. Details and reasoning are in
[the merge tracker](docs/fork/upstream-merge-log.md). The two worth
reading here:

- **`ChatView.tsx`** — pingdotgg#12306 added `activeWorktreePath !== null` to the
"Revert
  files too" button, on the line the fork gates with
`FEATURES.checkpointFileRestore`. Kept both as a conjunction: upstream's
condition is about a shared workspace, the fork's is about what Moatless
  serves, and they answer different questions.
- **`FilePreviewPanel.tsx`** (the one `decide`) — pingdotgg#10909 restructured
the file
read so a folder is knowable as a folder, adding `isDirectory` /
`previewPath`.
Took that whole and re-stated the fork's `onRetargetFile` effect on top.

`apps/web/src/routeTree.gen.ts` was regenerated rather than
hand-resolved.

One judgement call: pingdotgg#11598's new `/settings/storage` page is
deliberately **not**
given a `FEATURES` gate. It self-gates on two new capability booleans
Moatless
does not report and renders an explanatory notice, so a fork flag would
duplicate
a decision the wire already makes — and would have to be deleted again
the day
the capability is reported.

## Usable as-is

- Diff files open from a right-click context menu (pingdotgg#11842).
- Sidebar filtering from the thread menu (pingdotgg#8719).
- Command palette matches thread IDs (pingdotgg#11185).
- Mobile settings are easier to navigate and scope (pingdotgg#12272); favorites
in the
  mobile model picker (pingdotgg#12231).
- Thoughts collapse within tool groups (pingdotgg#12302); thoughts and failed
tool calls
  stay in one activity row (pingdotgg#12270).
- Folder links from chat open the file tree instead of a broken preview
(pingdotgg#10909).
- Chat no longer jumps when the scroll-to-end pill mounts (pingdotgg#12317);
numbered
jumps no longer steal browser tabs (pingdotgg#12315); composer banners stay
compact
  (pingdotgg#12166).
- A large batch of shared-component refactors across web and mobile
(pingdotgg#12353pingdotgg#12371).

## Unsupported in Moatless / needs implementation

- **Pull request files marked as viewed** (pingdotgg#7721) — adds
`pullRequests.filesViewed` and `pullRequests.setFilesViewed`, which
record
which files a reviewer has checked off, persisted server-side. Both
declare
  `PullRequestRpcError` and so arrived already refusing;
`unsupported-methods.mjs` reported ADD 0 / DROP 0 as a result. Closes
with the
  rest of the `pullRequests.*` group, not separately.
- **Multi-model threads in separate worktrees** (pingdotgg#12179) — one prompt
starts a
thread per selected model, each in its own worktree. The model picker is
the
same `worktree` send-mode control `FEATURES.worktreeSelection` already
gates,
  so the fan-out is simply not offered. The same commit adds a
  `requiredWorktreeBootstrap` capability the backend does not report.
- **Automatic storage cleanup settings** (pingdotgg#11598) — the
`/settings/storage` page,
gated by the backend's absent `storageCleanup` and
`projectWorktreeCleanup`
  capabilities. Needs the sweeper below before the page means anything.
- **Command palette entries for the pull requests and usage pages**
(pingdotgg#12211) —
  the PR half is covered by `FEATURES.pullRequestSurface`.

## Backend behavior to consider reproducing in Moatless

Eight items, recorded in full in [the gaps register](docs/fork/gaps.md)
under
_Runtime fixes upstream made to its own server_. Five are on the
checkpoint and
usage paths the previous merge already opened:

- **Reject a file rewind on a shared or nested-owner cwd** (pingdotgg#12306,
`CheckpointReactor.ts`) — a checkpoint holds the whole checkout, so
restoring
one erases a sibling's uncommitted work. Moatless isolates by sandbox,
but a
workspace with nested repositories has the same overlap inside one task.
- **Capture a checkpoint when the baseline lookup fails** (pingdotgg#12307) — the
case
  that silently leaves a turn with no restore point.
- **Move the file-search refresh off the checkpoint path** (pingdotgg#12308) — it
  extended every capture by an index walk.
- **Survive an empty nested repository, and clear a stale index lock**
(pingdotgg#12181,
`GitVcsDriver.ts`) — git cannot stage an embedded repository until it
has a
commit. The lock half matters most here: forced termination is the
normal end
  of a sandboxed task.
- **Bound the provider event log before serialization** (pingdotgg#12305,
`EventNdjsonLogger.ts`) — otherwise it grows proportionally to tokens
streamed.
- **Keep usage totals across transcript cleanup** (pingdotgg#12304,
`UsageService.ts`) and
  **resolve a contested fingerprint to the newest scan** (pingdotgg#10315,
  `usageMerge.ts`). Moatless serves `server.getUsageSummary` itself.
- **Pass provider image attachments by path** (pingdotgg#11050,
`CodexAdapter.ts`) — the
turn/start request stops scaling with attachment size. A sandbox adds a
hop, so
  an oversized request costs more there.
- **Sweep stale worktrees and transcripts against retention rules**
(pingdotgg#11598,
`storageCleanup.ts`, with a workspace lease so two servers cannot sweep
the
same directory). A sandbox per task bounds the worktree half;
transcripts
  outlive the sandbox.

## Verification

`verify.mjs` — all 9 checks green on the first full pass, tests included
(333 test files, 5071 tests). No flaky retries and no caveats.

Contract drift: ADD 0 / DROP 0, so `packages/contracts/src/rpc.ts`
needed no
change. The `orchestration-decode-boilerplate` duplicate-add exception
went stale
— the colliding line is gone — and was deleted from `inventory.json` in
this
merge.

Owned-concern sweep: the three new
`apps/mobile/src/features/connection/` files
are false positives, all upstream extracting shared mobile components
out of
files it already owned, with no fork delta in any of them.

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

---
Moatless task:
https://moatless.soaplabstest.com/tasks/c83db5aa-7c47-47c6-93f4-fe2f6f9f548e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants