Skip to content

Commit fa793e5

Browse files
Merge remote-tracking branch 'origin/main' into cursor/clone-file-manager-12647
# Conflicts: # packages/client-runtime/src/operations/projects.test.ts
2 parents 7997af0 + a0efdae commit fa793e5

33,822 files changed

Lines changed: 2725281 additions & 1826970 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: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ description: Test T3 Code's web and desktop UI through its built-in Browser pane
55

66
# Test T3 web and desktop
77

8-
Use T3's built-in Browser panel for verification. If its tools are absent or
9-
the panel reports unavailable, explain the blocker and stop verification.
10-
Do not install or switch to another automation system. For native mobile
11-
testing, use [test-t3-mobile](../test-t3-mobile/SKILL.md).
8+
Use T3's built-in Browser panel for verification. Follow the recovery steps
9+
below before declaring it unavailable. Do not install or switch to another
10+
automation system. For native mobile testing, use
11+
[test-t3-mobile](../test-t3-mobile/SKILL.md).
1212

1313
## Start the app
1414

@@ -21,10 +21,28 @@ 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

26-
Call `preview_status`, then `preview_open` if the Browser panel is
27-
closed. Navigate to the complete startup pairing URL once with
39+
Call `preview_status`. If no tab can be automated, call `preview_open`, including
40+
when status reports `available: false` or `tabId: null`. Status can report
41+
unavailable simply because no tab exists yet; opening a tab needs no user action.
42+
Stop verification and explain the blocker only if the tools are absent or
43+
`preview_open` reports unavailable or fails.
44+
45+
Navigate to the complete startup pairing URL once with
2846
`preview_navigate`, then use `preview_snapshot` and T3's interaction tools.
2947
If the token was consumed or expired, run `node apps/server/src/bin.ts pair`
3048
for a fresh one. Keep using the same tab.

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,22 @@ when inspecting or seeding SQLite. Stop the test server before fixture writes.
3131
From the checkout being tested on the selected device host, run:
3232

3333
```bash
34-
node scripts/mobile-native-client.ts ensure <ios|android> <device-id>
34+
vp run mobile:install <ios|android> <device-id>
3535
```
3636

37-
This reuses a matching native client or builds and installs one. Authorized
38-
mobile verification includes that build step unless the user prohibits it.
37+
This installs the dev client for the checkout's native fingerprint: from the
38+
device, the local cache, or the shared cache in seconds, building once only
39+
when no machine has that fingerprint yet: in the `Mobile Dev Client` workflow
40+
on Blacksmith when HEAD is pushed and `gh` may dispatch it (the command waits),
41+
otherwise here (5-15 minutes, logged to the file it names). The device id may be omitted when exactly one device is booted. It
42+
prints one JSON line; on failure it names the next command. Mobile verification
43+
includes that step unless the user prohibits it.
44+
45+
For a device you opened in an agent-device session elsewhere (a device pool,
46+
cloud, or remote host), run `vp run mobile:install <ios|android> --session <s>`
47+
from the directory you opened the session in. It installs the cached build into
48+
that session (`--abi arm64-v8a` for an ARM Android device; `--metro <url>` also
49+
opens it against Metro) and never builds.
3950

4051
Start `vp run dev:client` from `apps/mobile`, or reuse a healthy Metro belonging
4152
to this checkout. Open its printed development-client URL with AgentDevice

‎.coderabbit.config.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,19 @@ export default defineConfig((ctx) => ({
2626
path: "apps/web/src/**/*.{tsx,css}",
2727
instructions: "Hold changed code to the rules in docs/internals/web-ui.md.",
2828
},
29+
{
30+
path: "**/*.test.*",
31+
instructions:
32+
"Hold changed tests to the rules in docs/internals/testing.md. Request tests only as those rules allow.",
33+
},
2934
],
3035
},
3136
knowledge_base: {
3237
code_guidelines: {
3338
filePatterns: [
3439
{ files: "docs/internals/effect-services.md", applyTo: "{apps,packages,infra}/**/*.ts" },
3540
{ files: "docs/internals/web-ui.md", applyTo: "apps/web/src/**/*.{tsx,css}" },
41+
{ files: "docs/internals/testing.md", applyTo: "{apps,packages,infra}/**/*.{ts,tsx}" },
3642
],
3743
},
3844
},

‎.devcontainer/devcontainer.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Dev container for T3 Code. Mirrors CI (ubuntu-24.04, Node 24, Rust stable)
1+
// Dev container for T3 Code. Mirrors CI (ubuntu-24.04, Node 26, Rust stable)
22
// and the canonical setup in docs/operations/development.md: global `vp`, `vp i`.
33
// Contributor doc: docs/internals/devcontainer.md
44
{
@@ -8,7 +8,7 @@
88
// nodeGypDependencies (default true) brings python3/make/g++, which Linux
99
// needs for node-pty's node-gyp fallback (its prebuilds are mac/win only).
1010
"ghcr.io/devcontainers/features/node:2": {
11-
"version": "24"
11+
"version": "26"
1212
},
1313
// native/resource-monitor (edition 2024, needs stable >= 1.85). The server
1414
// degrades gracefully without the binary, but CI checks cargo fmt + test.

‎.github/SECURITY.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Security policy
22

33
Report security vulnerabilities affecting T3 Code or T3 Tools-operated infrastructure to
4-
[security@ping.gg](mailto:security@ping.gg). Please do not disclose them publicly until we have had
4+
[security@t3.codes](mailto:security@t3.codes). Please do not disclose them publicly until we have had
55
a reasonable opportunity to investigate and remediate them.
66

77
See the [full security policy](https://t3.codes/security-policy) for reporting details, scope,

‎.github/VOUCHED.td‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ github:myacoub91
5959
github:naMqe-h
6060
github:nateEc
6161
github:naveed949
62+
github:nexxeln
6263
github:nmggithub
6364
github:Noojuno
6465
github:notkainoa

‎.github/actions/ci-changes/action.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ outputs:
55
value: ${{ steps.detect.outputs.typecheck }}
66
build:
77
value: ${{ steps.detect.outputs.build }}
8+
desktop_launch:
9+
value: ${{ steps.detect.outputs.desktop_launch }}
810
test:
911
value: ${{ steps.detect.outputs.test }}
1012
test_packages:
Lines changed: 124 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,161 @@
11
name: Setup CI dependencies
22
description: Install Vite+ and the workspace dependencies from cache.
3+
inputs:
4+
task-cache-read-token:
5+
description: Read-only credential for the private maintainer task cache
6+
required: false
7+
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: ""
16+
save-pnpm-store:
17+
description: Set to "false" when a concurrent job with the same install args saves the pnpm store
18+
required: false
19+
default: "true"
320
runs:
421
using: composite
522
steps:
6-
# setup-vp reuses an installed exact version, so restoring its home skips the
7-
# installer download on every job.
23+
# ~/.vite-plus holds vp, the Node.js runtime, and pnpm. A cache entry never
24+
# updates, so the key names all three versions; otherwise a pnpm or Node.js
25+
# bump makes every job download them from npm again.
826
- name: Resolve Vite+ version
927
id: vp
1028
shell: bash
1129
run: |
1230
echo "version=$(sed -nE 's/^ vite-plus: ([0-9][^ ]*)$/\1/p' pnpm-workspace.yaml)" >> "$GITHUB_OUTPUT"
31+
echo "node=$(jq -r '.engines.node' package.json)" >> "$GITHUB_OUTPUT"
32+
echo "pnpm=$(jq -r '.packageManager' package.json)" >> "$GITHUB_OUTPUT"
1333
34+
# Pinned because release-desktop.yml signs builds with this action in the job.
1435
- name: Cache Vite+
36+
id: vp_cache
1537
if: steps.vp.outputs.version != ''
16-
uses: actions/cache@v6
38+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
1739
with:
1840
path: ~/.vite-plus
19-
key: vite-plus-home-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}
41+
key: vite-plus-home-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.vp.outputs.version }}-node${{ steps.vp.outputs.node }}-${{ steps.vp.outputs.pnpm }}
2042

43+
# setup-vp always runs the installer, which fetches vp from npm even when
44+
# this exact version is installed. A cache hit already has everything, so
45+
# skip setup-vp and do its remaining work here. This keeps npm outages from
46+
# failing jobs.
47+
- name: Use cached Vite+
48+
if: steps.vp_cache.outputs.cache-hit == 'true'
49+
shell: bash
50+
run: |
51+
echo "$HOME/.vite-plus/bin" >> "$GITHUB_PATH"
52+
"$HOME/.vite-plus/bin/vp" env use "${{ steps.vp.outputs.node }}"
53+
54+
# vp gives each Node.js download attempt 10 minutes by default, so one
55+
# stalled stream holds the job that long. It retries 3 times and resumes
56+
# partial bytes, so a shorter limit costs a slow download only a retry.
2157
- name: Setup Vite+
22-
uses: voidzero-dev/setup-vp@v1
58+
if: steps.vp_cache.outputs.cache-hit != 'true'
59+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
60+
env:
61+
VP_DOWNLOAD_TIMEOUT: "120"
2362
with:
2463
node-version-file: package.json
2564
cache: false
2665
run-install: false
2766

28-
- name: Resolve pnpm store path
67+
# A shared key lets whichever install saves first, often a small filtered
68+
# one, become every job's store. Each set of install args gets its own.
69+
- name: Resolve pnpm store
2970
id: pnpm_store
71+
if: inputs.install == 'true'
3072
shell: bash
73+
env:
74+
INSTALL_ARGS: ${{ inputs.install-args }}
3175
run: |
32-
store_path="$(vp pm cache dir)"
33-
echo "path=$store_path" >> "$GITHUB_OUTPUT"
76+
echo "path=$(vp pm cache dir)" >> "$GITHUB_OUTPUT"
77+
metadata_dir="${pnpm_config_cache_dir:-$RUNNER_TEMP/pnpm-metadata}"
78+
echo "pnpm_config_cache_dir=$metadata_dir" >> "$GITHUB_ENV"
79+
echo "verified=$metadata_dir/lockfile-verified.jsonl" >> "$GITHUB_OUTPUT"
80+
if [[ -z "$INSTALL_ARGS" ]]; then
81+
echo "namespace=full" >> "$GITHUB_OUTPUT"
82+
else
83+
echo "namespace=filtered-$(printf '%s' "$INSTALL_ARGS" | cksum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
84+
fi
3485
35-
# setup-vp's shared cache key ignores install filters. Keep full installs in a
36-
# separate namespace, including fallback restores.
86+
# Filtered installs prefer the current full store, which holds every package,
87+
# over an older store of their own.
3788
# The pnpm store stays a cache tarball on the runner's own disk. A store on a
3889
# Blacksmith sticky disk mounts in under a second, but pnpm then copies every
3990
# package across filesystems instead of hard-linking it: install took 28-49s
4091
# against 9s plus an 11s restore.
41-
- name: Cache full pnpm store
42-
uses: actions/cache@v6
92+
- name: Restore pnpm store
93+
id: pnpm_cache
94+
if: inputs.install == 'true'
95+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
4396
with:
4497
path: ${{ steps.pnpm_store.outputs.path }}
45-
key: pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
98+
key: pnpm-${{ steps.pnpm_store.outputs.namespace }}-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
4699
restore-keys: |
100+
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
101+
pnpm-${{ steps.pnpm_store.outputs.namespace }}-v1-${{ runner.os }}-${{ runner.arch }}-
47102
pnpm-full-v1-${{ runner.os }}-${{ runner.arch }}-
48103
104+
# pnpm accepts an earlier pass for the same lockfile and policy at any age, so
105+
# a cached record skips fetching registry metadata for every package.
106+
- name: Restore lockfile verification
107+
id: pnpm_verified
108+
if: inputs.install == 'true'
109+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
110+
with:
111+
path: ${{ steps.pnpm_store.outputs.verified }}
112+
key: pnpm-verified-v1-${{ hashFiles('pnpm-lock.yaml', 'pnpm-workspace.yaml', 'package.json') }}
113+
49114
- name: Install dependencies
115+
if: inputs.install == 'true'
50116
shell: bash
51-
run: vp install
117+
env:
118+
INSTALL_ARGS: ${{ inputs.install-args }}
119+
# Unquoted so each filter is its own argument.
120+
run: vp install $INSTALL_ARGS
121+
122+
- name: Save lockfile verification
123+
if: inputs.install == 'true' && steps.pnpm_verified.outputs.cache-hit != 'true'
124+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
125+
with:
126+
path: ${{ steps.pnpm_store.outputs.verified }}
127+
key: ${{ steps.pnpm_verified.outputs.cache-primary-key }}
128+
129+
# A filtered install that started from the current full store adds nothing
130+
# worth a second copy of it. A stacked PR, based on a branch other than the
131+
# default, saves a ~1 GB store only its own reruns can read, so it only restores.
132+
# Concurrent jobs with the same install args reserve one key, so the losers
133+
# compress the store for nothing; all but one pass save-pnpm-store: false.
134+
- name: Save pnpm store
135+
if: >-
136+
inputs.install == 'true' && inputs.save-pnpm-store == 'true' &&
137+
(github.event_name != 'pull_request' || github.base_ref == github.event.repository.default_branch) &&
138+
steps.pnpm_cache.outputs.cache-hit != 'true' &&
139+
(steps.pnpm_store.outputs.namespace == 'full' ||
140+
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')))
141+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
142+
with:
143+
path: ${{ steps.pnpm_store.outputs.path }}
144+
key: ${{ steps.pnpm_cache.outputs.cache-primary-key }}
145+
146+
- name: Enable shared task cache
147+
if: >-
148+
github.repository == 'pingdotgg/t3code' &&
149+
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
150+
hashFiles('.task-cache.json') != '' &&
151+
inputs.task-cache-read-token != ''
152+
shell: bash
153+
env:
154+
T3_TASK_CACHE_READ_TOKEN: ${{ inputs.task-cache-read-token }}
155+
run: |
156+
node infra/task-cache/scripts/install-ci.ts
157+
if [[ ( "$GITHUB_EVENT_NAME" == pull_request && "$GITHUB_BASE_REF" == main ) || ( "$GITHUB_EVENT_NAME" == push && "$GITHUB_REF" == refs/heads/main ) ]]; then
158+
echo 'VP_REMOTE_CACHE=read-write' >> "$GITHUB_ENV"
159+
else
160+
echo 'VP_REMOTE_CACHE=read' >> "$GITHUB_ENV"
161+
fi

0 commit comments

Comments
 (0)