Skip to content

Commit ced10aa

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/model-fallback
# Conflicts: # apps/web/src/components/ChatView.tsx
2 parents d0363d2 + 5eebf77 commit ced10aa

570 files changed

Lines changed: 34286 additions & 9228 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-mobile/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ This installs the dev client for the checkout's native fingerprint: from the
3838
device, the local cache, or the shared cache in seconds, building once only
3939
when no machine has that fingerprint yet (5-15 minutes, logged to the file it
4040
names). The device id may be omitted when exactly one device is booted. It
41-
prints one JSON line; on failure it names the next command. Authorized mobile
42-
verification includes that step unless the user prohibits it.
41+
prints one JSON line; on failure it names the next command. Mobile verification
42+
includes that step unless the user prohibits it.
4343

4444
For a device you opened in an agent-device session elsewhere (a device pool,
4545
cloud, or remote host), run `vp run mobile:install <ios|android> --session <s>`

‎.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/workflows/ci.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,9 @@ jobs:
354354
id-token: write
355355
name: Test Server ${{ matrix.shard }}
356356
runs-on: blacksmith-4vcpu-ubuntu-2404
357-
timeout-minutes: 10
357+
# Shards take 2-5 minutes. When the shared task cache throttles reads, each
358+
# failed fetch stalls vp for 15-90s, which pushed shards past 10 minutes.
359+
timeout-minutes: 20
358360
strategy:
359361
fail-fast: false
360362
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/mobile-eas-production.yml‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,20 @@ jobs:
160160
working-directory: apps/mobile
161161
env:
162162
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
163-
run: eas env:pull production --non-interactive
163+
run: |
164+
eas env:pull production --non-interactive
165+
# EAS commands skip dotenv, and the Android fingerprint hashes this
166+
# file. Without it every merge misses the build's hash and rebuilds.
167+
node --input-type=module <<'NODE'
168+
import { appendFileSync, readFileSync } from "node:fs";
169+
import { parseEnv } from "node:util";
170+
const env = parseEnv(readFileSync(".env.local", "utf8"));
171+
const googleServicesFile = env.T3CODE_ANDROID_GOOGLE_SERVICES_FILE;
172+
if (!googleServicesFile) {
173+
throw new Error("T3CODE_ANDROID_GOOGLE_SERVICES_FILE is missing from the production environment");
174+
}
175+
appendFileSync(process.env.GITHUB_ENV, `T3CODE_ANDROID_GOOGLE_SERVICES_FILE=${googleServicesFile}\n`);
176+
NODE
164177
165178
- name: Apply manual version override
166179
if: steps.version_app_token.outcome == 'success'

‎.github/workflows/mobile-fingerprint-check.yml‎

Lines changed: 15 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Mobile Fingerprint Check
22

33
# Detects whether a PR changes the native fingerprint — i.e. whether merging
44
# it would leave main un-OTA-able until a new store build ships. Native-change
5-
# PRs get the "📱 Native Change" label so they can be held and merged as a
5+
# PRs get the "📱 Native Change" label (applied by mobile-fingerprint-label.yml,
6+
# which runs from main so fork PRs get it too) so they can be held and merged as a
67
# batch right before the next store submission, keeping main OTA-able for
78
# everything else in between. (Once one native PR merges, every later merge
89
# inherits the drifted fingerprint and loses OTA reach too — that is why the
@@ -27,8 +28,6 @@ jobs:
2728
runs-on: blacksmith-8vcpu-ubuntu-2404
2829
permissions:
2930
contents: read
30-
issues: write
31-
pull-requests: write
3231
env:
3332
APP_VARIANT: production
3433
NODE_OPTIONS: --max-old-space-size=8192
@@ -127,94 +126,19 @@ jobs:
127126
} >> "$GITHUB_STEP_SUMMARY"
128127
echo "changed_platforms=${changed# }" >> "$GITHUB_OUTPUT"
129128
130-
- name: Sync native change label
131-
# Fork PRs get a read-only token under pull_request; the check stays
132-
# advisory there (summary only). This workflow must not move to
133-
# pull_request_target — it installs and runs PR code.
134-
if: github.event.pull_request.head.repo.full_name == github.repository
135-
uses: actions/github-script@v8
129+
# mobile-fingerprint-label.yml reads this from main with a write token
130+
# and syncs the label; this job's token is read-only for fork PRs.
131+
- name: Record changed platforms
136132
env:
137133
CHANGED_PLATFORMS: ${{ steps.compare.outputs.changed_platforms }}
138-
with:
139-
script: |
140-
const managedLabel = {
141-
name: "📱 Native Change",
142-
color: "d93f0b",
143-
description:
144-
"Changes the native fingerprint; merging blocks production OTAs until a new store build ships.",
145-
};
146-
const nativeChanged = (process.env.CHANGED_PLATFORMS ?? "").trim() !== "";
147-
const issueNumber = context.payload.pull_request.number;
148-
149-
try {
150-
const { data: existing } = await github.rest.issues.getLabel({
151-
owner: context.repo.owner,
152-
repo: context.repo.repo,
153-
name: managedLabel.name,
154-
});
155-
156-
if (
157-
existing.color !== managedLabel.color ||
158-
(existing.description ?? "") !== managedLabel.description
159-
) {
160-
await github.rest.issues.updateLabel({
161-
owner: context.repo.owner,
162-
repo: context.repo.repo,
163-
name: managedLabel.name,
164-
color: managedLabel.color,
165-
description: managedLabel.description,
166-
});
167-
}
168-
} catch (error) {
169-
if (error.status !== 404) {
170-
throw error;
171-
}
172-
173-
try {
174-
await github.rest.issues.createLabel({
175-
owner: context.repo.owner,
176-
repo: context.repo.repo,
177-
name: managedLabel.name,
178-
color: managedLabel.color,
179-
description: managedLabel.description,
180-
});
181-
} catch (createError) {
182-
if (createError.status !== 422) {
183-
throw createError;
184-
}
185-
}
186-
}
187-
188-
const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({
189-
owner: context.repo.owner,
190-
repo: context.repo.repo,
191-
issue_number: issueNumber,
192-
per_page: 100,
193-
});
194-
const hasLabel = currentLabels.some((label) => label.name === managedLabel.name);
195-
196-
if (nativeChanged && !hasLabel) {
197-
await github.rest.issues.addLabels({
198-
owner: context.repo.owner,
199-
repo: context.repo.repo,
200-
issue_number: issueNumber,
201-
labels: [managedLabel.name],
202-
});
203-
} else if (!nativeChanged && hasLabel) {
204-
try {
205-
await github.rest.issues.removeLabel({
206-
owner: context.repo.owner,
207-
repo: context.repo.repo,
208-
issue_number: issueNumber,
209-
name: managedLabel.name,
210-
});
211-
} catch (removeError) {
212-
if (removeError.status !== 404) {
213-
throw removeError;
214-
}
215-
}
216-
}
134+
run: |
135+
mkdir -p "$RUNNER_TEMP/fingerprint-result"
136+
printf '%s\n' "$CHANGED_PLATFORMS" > "$RUNNER_TEMP/fingerprint-result/changed-platforms"
217137
218-
core.info(
219-
`PR #${issueNumber}: native fingerprint ${nativeChanged ? `changed (${process.env.CHANGED_PLATFORMS})` : "unchanged"}`,
220-
);
138+
- name: Upload changed platforms
139+
uses: actions/upload-artifact@v7
140+
with:
141+
name: fingerprint-result
142+
path: ${{ runner.temp }}/fingerprint-result
143+
if-no-files-found: error
144+
retention-days: 1

0 commit comments

Comments
 (0)