Skip to content

Commit 92568fe

Browse files
fix: scope knowledge budgets and review models while integrating main
Use the active native conversation when budgeting knowledge steering after provider-session recovery. Preserve handoff membership and exclude the pending steer message from historical occupancy. Validate dedicated review-guide models for generateReviewGuide across every selected environment, keeping valid preferences or selecting a shared capable fallback. Integrate current main, resolve the context-budget baseline from actual measurements, and align Loom and settings fixtures with current client APIs. Preserve the budget assertion and approval workflow. Validated with the required changed-file gate: 1,313 tests across 43 files and typechecks for 32 packages. Regression cases failed before the corresponding fixes.
2 parents 870c719 + 71206f5 commit 92568fe

1,588 files changed

Lines changed: 47588 additions & 32607 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/test-t3-app/SKILL.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ Test with meaningful project and thread data. Read
2121
[references/sqlite-fixtures.md](references/sqlite-fixtures.md) only when
2222
inspecting or seeding SQLite. Stop the test server before direct fixture writes.
2323

24+
## Drive agent turns for free
25+
26+
Do not spend a paid model to see a turn render. `vp run dev` registers the
27+
`Replay (dev)` provider, which replays recorded turns with simulated streaming
28+
through the real adapter and orchestration. Its models are scenarios:
29+
`showcase` covers thinking, a plan, tool calls, an approval, and markdown.
30+
Press `Ctrl+Alt+Shift+R` for a picker (GNOME takes that key for screen
31+
recording), call `window.t3dev.replay("showcase")`
32+
with `preview_evaluate`, or run
33+
`node apps/server/src/bin.ts thread start --base-dir .t3 --provider devReplay --model showcase <project> "go"`.
34+
When the test needs real provider behavior, use that provider's cheapest
35+
model, such as Haiku for Claude or Luna for Codex.
36+
2437
## Use the Browser panel
2538

2639
Call `preview_status`, then `preview_open` if the Browser panel is

‎.coderabbit.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default defineConfig((ctx) => ({
2727
instructions: "Hold changed code to the rules in docs/internals/web-ui.md.",
2828
},
2929
{
30-
path: "**/*.test.{ts,tsx}",
30+
path: "**/*.test.*",
3131
instructions:
3232
"Hold changed tests to the rules in docs/internals/testing.md. Request tests only as those rules allow.",
3333
},

‎.github/actions/setup-ci-deps/action.yml‎

Lines changed: 75 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ inputs:
55
description: Read-only credential for the private maintainer task cache
66
required: false
77
default: ""
8+
install:
9+
description: Set to "false" to set up Vite+ only, with no pnpm store or install
10+
required: false
11+
default: "true"
12+
install-args:
13+
description: Arguments for `vp install`, such as filters. Empty installs the whole workspace.
14+
required: false
15+
default: ""
816
runs:
917
using: composite
1018
steps:
@@ -19,10 +27,11 @@ runs:
1927
echo "node=$(jq -r '.engines.node' package.json)" >> "$GITHUB_OUTPUT"
2028
echo "pnpm=$(jq -r '.packageManager' package.json)" >> "$GITHUB_OUTPUT"
2129
30+
# Pinned because release-desktop.yml signs builds with this action in the job.
2231
- name: Cache Vite+
2332
id: vp_cache
2433
if: steps.vp.outputs.version != ''
25-
uses: actions/cache@v6
34+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
2635
with:
2736
path: ~/.vite-plus
2837
key: vite-plus-home-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}-node${{ steps.vp.outputs.node }}-${{ steps.vp.outputs.pnpm }}
@@ -38,38 +47,93 @@ runs:
3847
echo "$HOME/.vite-plus/bin" >> "$GITHUB_PATH"
3948
"$HOME/.vite-plus/bin/vp" env use "${{ steps.vp.outputs.node }}"
4049
50+
# vp gives each Node.js download attempt 10 minutes by default, so one
51+
# stalled stream holds the job that long. It retries 3 times and resumes
52+
# partial bytes, so a shorter limit costs a slow download only a retry.
4153
- name: Setup Vite+
4254
if: steps.vp_cache.outputs.cache-hit != 'true'
43-
uses: voidzero-dev/setup-vp@v1
55+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
56+
env:
57+
VP_DOWNLOAD_TIMEOUT: "120"
4458
with:
4559
node-version-file: package.json
4660
cache: false
4761
run-install: false
4862

49-
- name: Resolve pnpm store path
63+
# A shared key lets whichever install saves first, often a small filtered
64+
# one, become every job's store. Each set of install args gets its own.
65+
- name: Resolve pnpm store
5066
id: pnpm_store
67+
if: inputs.install == 'true'
5168
shell: bash
69+
env:
70+
INSTALL_ARGS: ${{ inputs.install-args }}
5271
run: |
53-
store_path="$(vp pm cache dir)"
54-
echo "path=$store_path" >> "$GITHUB_OUTPUT"
72+
echo "path=$(vp pm cache dir)" >> "$GITHUB_OUTPUT"
73+
metadata_dir="${pnpm_config_cache_dir:-$RUNNER_TEMP/pnpm-metadata}"
74+
echo "pnpm_config_cache_dir=$metadata_dir" >> "$GITHUB_ENV"
75+
echo "verified=$metadata_dir/lockfile-verified.jsonl" >> "$GITHUB_OUTPUT"
76+
if [[ -z "$INSTALL_ARGS" ]]; then
77+
echo "namespace=full" >> "$GITHUB_OUTPUT"
78+
else
79+
echo "namespace=filtered-$(printf '%s' "$INSTALL_ARGS" | cksum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
80+
fi
5581
56-
# setup-vp's shared cache key ignores install filters. Keep full installs in a
57-
# separate namespace, including fallback restores.
82+
# Filtered installs prefer the current full store, which holds every package,
83+
# over an older store of their own.
5884
# The pnpm store stays a cache tarball on the runner's own disk. A store on a
5985
# Blacksmith sticky disk mounts in under a second, but pnpm then copies every
6086
# package across filesystems instead of hard-linking it: install took 28-49s
6187
# against 9s plus an 11s restore.
62-
- name: Cache full pnpm store
63-
uses: actions/cache@v6
88+
- name: Restore pnpm store
89+
id: pnpm_cache
90+
if: inputs.install == 'true'
91+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
6492
with:
6593
path: ${{ steps.pnpm_store.outputs.path }}
66-
key: pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
94+
key: pnpm-${{ steps.pnpm_store.outputs.namespace }}-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
6795
restore-keys: |
96+
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
97+
pnpm-${{ steps.pnpm_store.outputs.namespace }}-v1-${{ runner.os }}-${{ runner.arch }}-
6898
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-
6999
100+
# pnpm accepts an earlier pass for the same lockfile and policy at any age, so
101+
# a cached record skips fetching registry metadata for every package.
102+
- name: Restore lockfile verification
103+
id: pnpm_verified
104+
if: inputs.install == 'true'
105+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
106+
with:
107+
path: ${{ steps.pnpm_store.outputs.verified }}
108+
key: pnpm-verified-v1-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
109+
70110
- name: Install dependencies
111+
if: inputs.install == 'true'
71112
shell: bash
72-
run: vp install
113+
env:
114+
INSTALL_ARGS: ${{ inputs.install-args }}
115+
# Unquoted so each filter is its own argument.
116+
run: vp install $INSTALL_ARGS
117+
118+
- name: Save lockfile verification
119+
if: inputs.install == 'true' && steps.pnpm_verified.outputs.cache-hit != 'true'
120+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
121+
with:
122+
path: ${{ steps.pnpm_store.outputs.verified }}
123+
key: ${{ steps.pnpm_verified.outputs.cache-primary-key }}
124+
125+
# A filtered install that started from the current full store adds nothing
126+
# worth a second copy of it.
127+
- name: Save pnpm store
128+
if: >-
129+
inputs.install == 'true' &&
130+
steps.pnpm_cache.outputs.cache-hit != 'true' &&
131+
(steps.pnpm_store.outputs.namespace == 'full' ||
132+
steps.pnpm_cache.outputs.cache-matched-key != format('pnpm-full-v1-{0}-{1}-{2}', runner.os, runner.arch, hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json')))
133+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
134+
with:
135+
path: ${{ steps.pnpm_store.outputs.path }}
136+
key: ${{ steps.pnpm_cache.outputs.cache-primary-key }}
73137

74138
- name: Enable shared task cache
75139
if: >-

‎.github/triage/PLAYBOOK.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ provided alongside this playbook. Everything machine-specific lives there, not h
1111

1212
## 1. Ask what went wrong
1313

14-
Your first message to the user: ask them to describe what went wrong, in their own
15-
words. Ask them to paste screenshots directly into this session if they have any.
14+
Unless the user already described it, your first message asks what went wrong, in
15+
their own words. Ask them to paste screenshots directly into this session if they have any.
1616
Ask follow-up questions when the description is vague. Good repro steps are the most
1717
valuable thing you can extract from this conversation.
1818

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,6 @@ jobs:
230230
!/apps/mobile/modules/t3-terminal/Vendor/**/*.a
231231
sparse-checkout-cone-mode: false
232232

233-
# Blacksmith boots GitHub's Ubuntu runner image (gcc is usually present),
234-
# but ACP process-tree live tests compile a small pthread fixture with `cc`
235-
# and soft-skip when it is missing. Install build-essential so that path
236-
# always runs in CI instead of silently no-oping.
237-
- name: Install C toolchain for process-tree fixtures
238-
run: |
239-
sudo apt-get update
240-
sudo apt-get install -y --no-install-recommends build-essential
241-
command -v cc
242-
243233
- uses: ./.github/actions/setup-apt-mirrors
244234

245235
# The desktop tests compile the browser secret helper. The install runs in
@@ -369,7 +359,9 @@ jobs:
369359
id-token: write
370360
name: Test Server ${{ matrix.shard }}
371361
runs-on: blacksmith-4vcpu-ubuntu-2404
372-
timeout-minutes: 10
362+
# Shards take 2-5 minutes. When the shared task cache throttles reads, each
363+
# failed fetch stalls vp for 15-90s, which pushed shards past 10 minutes.
364+
timeout-minutes: 20
373365
strategy:
374366
fail-fast: false
375367
matrix:

‎.github/workflows/deploy-relay.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
8181
APNS_PRIVATE_KEY: ${{ secrets.APNS_PRIVATE_KEY }}
8282
FCM_SERVICE_ACCOUNT: ${{ secrets.FCM_SERVICE_ACCOUNT }}
83+
T3CHAT_LINK_SECRET: ${{ secrets.T3CHAT_LINK_SECRET }}
8384

8485
- name: Publish relay deploy commit status
8586
uses: actions/github-script@v8

‎.github/workflows/relay-preview.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,5 @@ jobs:
7979
PLANETSCALE_API_TOKEN: ${{ secrets.PLANETSCALE_API_TOKEN }}
8080
AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
8181
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
82+
# Unset by default, so previews keep the T3 Chat link off.
83+
T3CHAT_LINK_SECRET: ${{ secrets.T3CHAT_LINK_SECRET }}

‎.github/workflows/release-desktop.yml‎

Lines changed: 108 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,6 @@ jobs:
147147
git sparse-checkout set --no-cone '/*' '!/.repos/'
148148
git -c checkout.workers=0 checkout --detach FETCH_HEAD
149149
150-
- name: Setup Vite+
151-
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
152-
with:
153-
node-version-file: package.json
154-
cache: true
155-
run-install: false
156-
157150
# pnpm checks the lockfile and policy before reusing this result. A missing
158151
# artifact leaves the cache empty, so installation runs the checks again.
159152
- name: Download dependency verification
@@ -163,10 +156,35 @@ jobs:
163156
name: release-dependency-verification
164157
path: ${{ runner.temp }}/pnpm-metadata
165158

166-
- name: Install desktop dependencies
159+
- name: Setup dependencies
160+
uses: ./.github/actions/setup-ci-deps
161+
with:
162+
install-args: --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
167163
env:
168164
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
169-
run: vp install --filter=@t3tools/desktop... --filter=t3... --filter=@t3tools/scripts...
165+
166+
# The CLI archive and the staged app install without a lockfile, so they
167+
# ask the registry about every package and fetch platform packages the
168+
# workspace store lacks. They share this registry metadata and store. A
169+
# new week starts cold, which bounds how stale cached ranges can get.
170+
- name: Resolve staged install cache
171+
id: stage_pnpm
172+
shell: bash
173+
run: |
174+
echo "dir=$RUNNER_TEMP/desktop-stage-pnpm" >> "$GITHUB_OUTPUT"
175+
echo "prefix=desktop-stage-pnpm-v2-${{ inputs.platform }}-${{ inputs.arch }}-$(date -u +%G-%V)-" >> "$GITHUB_OUTPUT"
176+
177+
- name: Restore staged install cache
178+
id: stage_pnpm_cache
179+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
180+
with:
181+
path: ${{ steps.stage_pnpm.outputs.dir }}
182+
key: ${{ steps.stage_pnpm.outputs.prefix }}${{ github.run_id }}-${{ github.run_attempt }}
183+
restore-keys: ${{ steps.stage_pnpm.outputs.prefix }}
184+
185+
- name: Mark staged install cache
186+
shell: bash
187+
run: mkdir -p "${{ steps.stage_pnpm.outputs.dir }}" && touch "$RUNNER_TEMP/desktop-stage-pnpm.marker"
170188

171189
- name: Cache resource monitor
172190
id: resource_monitor_cache
@@ -258,6 +276,63 @@ jobs:
258276
if [[ "${{ inputs.version }}" =~ -nightly\.[0-9]{8}\.[0-9]+$ ]]; then brand=nightly; fi
259277
node scripts/apply-web-brand-assets.ts "$brand" apps/server/dist/client
260278
279+
- name: Resolve target Node.js for the CLI executable
280+
id: target_node
281+
if: inputs.cli_archive && inputs.platform == 'win'
282+
shell: bash
283+
run: echo "version=$(node -p 'require("./package.json").engines.node')" >> "$GITHUB_OUTPUT"
284+
285+
# The download only changes with engines.node, so a cached copy keeps
286+
# releases off nodejs.org, which stalls on the runners some days.
287+
- name: Restore target Node.js for the CLI executable
288+
id: target_node_cache
289+
if: inputs.cli_archive && inputs.platform == 'win'
290+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
291+
with:
292+
path: ${{ runner.temp }}/node-download
293+
key: node-download-v${{ steps.target_node.outputs.version }}-win-${{ inputs.arch }}
294+
295+
# tsdown downloads the target Node with one fetch and no retry, and
296+
# nodejs.org drops that download often enough to fail releases. Seed
297+
# tsdown's cache with a retried, checksum-verified copy instead. A transfer
298+
# under 100 KB/s for 30s counts as failed, so a stall retries.
299+
- name: Download target Node.js for the CLI executable
300+
if: inputs.cli_archive && inputs.platform == 'win' && steps.target_node_cache.outputs.cache-hit != 'true'
301+
shell: bash
302+
env:
303+
VERSION: ${{ steps.target_node.outputs.version }}
304+
run: |
305+
set -euo pipefail
306+
name="node-v$VERSION-win-${{ inputs.arch }}"
307+
dir="$RUNNER_TEMP/node-download"
308+
mkdir -p "$dir"
309+
fetch=(curl -fsSL --retry 5 --retry-all-errors --connect-timeout 10 --speed-limit 102400 --speed-time 30)
310+
"${fetch[@]}" -o "$dir/$name.zip" "https://nodejs.org/dist/v$VERSION/$name.zip"
311+
"${fetch[@]}" -o "$dir/SHASUMS256.txt" "https://nodejs.org/dist/v$VERSION/SHASUMS256.txt"
312+
(cd "$dir" && grep " $name.zip\$" SHASUMS256.txt | sha256sum -c -)
313+
314+
# Saved right away so a later failure in this job still keeps the download.
315+
- name: Save target Node.js for the CLI executable
316+
if: inputs.cli_archive && inputs.platform == 'win' && steps.target_node_cache.outputs.cache-hit != 'true'
317+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
318+
with:
319+
path: ${{ runner.temp }}/node-download
320+
key: ${{ steps.target_node_cache.outputs.cache-primary-key }}
321+
322+
- name: Install target Node.js for the CLI executable
323+
if: inputs.cli_archive && inputs.platform == 'win'
324+
shell: bash
325+
env:
326+
VERSION: ${{ steps.target_node.outputs.version }}
327+
run: |
328+
set -euo pipefail
329+
name="node-v$VERSION-win-${{ inputs.arch }}"
330+
dir="$RUNNER_TEMP/node-download"
331+
dest="${XDG_CACHE_HOME:-$HOME/.cache}/tsdown/node/v$VERSION/win-${{ inputs.arch }}"
332+
mkdir -p "$dest"
333+
(cd "$dir" && grep " $name.zip\$" SHASUMS256.txt | sha256sum -c -)
334+
unzip -p "$dir/$name.zip" "$name/node.exe" > "$dest/node.exe"
335+
261336
# Setup Vite+ selects the exact engines.node version from package.json.
262337
# Native builds embed that executable; cross-target builds download the
263338
# same version for their target.
@@ -318,6 +393,9 @@ jobs:
318393
if: inputs.cli_archive
319394
shell: bash
320395
env:
396+
pnpm_config_cache_dir: ${{ steps.stage_pnpm.outputs.dir }}/cache
397+
pnpm_config_store_dir: ${{ steps.stage_pnpm.outputs.dir }}/store
398+
pnpm_config_prefer_offline: "true"
321399
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
322400
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
323401
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
@@ -437,7 +515,10 @@ jobs:
437515
- name: Build desktop artifact
438516
shell: bash
439517
env:
440-
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
518+
# pnpm only goes to the registry for packages or versions the cache lacks.
519+
pnpm_config_cache_dir: ${{ steps.stage_pnpm.outputs.dir }}/cache
520+
pnpm_config_store_dir: ${{ steps.stage_pnpm.outputs.dir }}/store
521+
pnpm_config_prefer_offline: "true"
441522
T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: true
442523
T3CODE_DESKTOP_REUSE_LINUX_CAPTURE_HELPERS: ${{ steps.capture_helper_cache.outputs.cache-hit == 'true' }}
443524
CSC_LINK: ${{ secrets.CSC_LINK }}
@@ -522,6 +603,23 @@ jobs:
522603
523604
vp run dist:desktop:artifact "${args[@]}"
524605
606+
# Warm installs only touch the store index, so new content means a fetch.
607+
- name: Check staged install cache for new content
608+
id: stage_pnpm_changed
609+
shell: bash
610+
run: |
611+
dir="${{ steps.stage_pnpm.outputs.dir }}"
612+
new=$(find "$dir/cache/v12" "$dir/store/v11/files" -type f -newer "$RUNNER_TEMP/desktop-stage-pnpm.marker" 2>/dev/null | wc -l | tr -d ' ')
613+
echo "Staged installs added $new cached files."
614+
echo "changed=$([[ "$new" -gt 0 ]] && echo true || echo false)" >> "$GITHUB_OUTPUT"
615+
616+
- name: Save staged install cache
617+
if: steps.stage_pnpm_changed.outputs.changed == 'true'
618+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
619+
with:
620+
path: ${{ steps.stage_pnpm.outputs.dir }}
621+
key: ${{ steps.stage_pnpm_cache.outputs.cache-primary-key }}
622+
525623
# A build can package fine and still not open (a missing module in the
526624
# backend or the bundle). This launches the app from the shipped
527625
# AppImage or DMG.

0 commit comments

Comments
 (0)