Skip to content

Commit fd1f44a

Browse files
Merge origin/main into draft/marketing-android-play-store
Resolve provider turn history handling with compaction and goal deferral preserved. Implemented With: Codex via GPT-6 Luna on OpenAI through T3 Code
2 parents 3789f8a + a4fbea8 commit fd1f44a

1,614 files changed

Lines changed: 92724 additions & 26591 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: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,21 @@ 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 (5-15 minutes, logged to the file it
40+
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.
43+
44+
For a device you opened in an agent-device session elsewhere (a device pool,
45+
cloud, or remote host), run `vp run mobile:install <ios|android> --session <s>`
46+
from the directory you opened the session in. It installs the cached build into
47+
that session (`--abi arm64-v8a` for an ARM Android device; `--metro <url>` also
48+
opens it against Metro) and never builds.
3949

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

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
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: ""
38
runs:
49
using: composite
510
steps:
@@ -65,3 +70,20 @@ runs:
6570
- name: Install dependencies
6671
shell: bash
6772
run: vp install
73+
74+
- name: Enable shared task cache
75+
if: >-
76+
github.repository == 'pingdotgg/t3code' &&
77+
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
78+
hashFiles('.task-cache.json') != '' &&
79+
inputs.task-cache-read-token != ''
80+
shell: bash
81+
env:
82+
T3_TASK_CACHE_READ_TOKEN: ${{ inputs.task-cache-read-token }}
83+
run: |
84+
node infra/task-cache/scripts/install-ci.ts
85+
if [[ ( "$GITHUB_EVENT_NAME" == pull_request && "$GITHUB_BASE_REF" == main ) || ( "$GITHUB_EVENT_NAME" == push && "$GITHUB_REF" == refs/heads/main ) ]]; then
86+
echo 'VP_REMOTE_CACHE=read-write' >> "$GITHUB_ENV"
87+
else
88+
echo 'VP_REMOTE_CACHE=read' >> "$GITHUB_ENV"
89+
fi

‎.github/workflows/ci.yml‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
# file, docs included. The `Check` job at the end of this file passes only
6060
# when every other job passes or was skipped by `changes`.
6161
lint:
62+
permissions:
63+
contents: read
64+
id-token: write
6265
name: Lint
6366
runs-on: blacksmith-8vcpu-ubuntu-2404
6467
timeout-minutes: 10
@@ -82,6 +85,8 @@ jobs:
8285
8386
- name: Setup Vite+
8487
uses: ./.github/actions/setup-ci-deps
88+
with:
89+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
8590

8691
# electron's install.js (run by ensure:electron) reads this cache before it
8792
# downloads from GitHub. The key changes only with the Electron version.
@@ -108,6 +113,9 @@ jobs:
108113
run: vp check
109114

110115
build:
116+
permissions:
117+
contents: read
118+
id-token: write
111119
name: Build and Typecheck
112120
needs: changes
113121
if: ${{ !cancelled() && (needs.changes.outputs.build != 'false' || needs.changes.outputs.typecheck != 'false') }}
@@ -139,6 +147,8 @@ jobs:
139147
140148
- name: Setup Vite+
141149
uses: ./.github/actions/setup-ci-deps
150+
with:
151+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
142152

143153
# electron's install.js (run by ensure:electron) reads this cache before it
144154
# downloads from GitHub. The key changes only with the Electron version.
@@ -197,6 +207,9 @@ jobs:
197207
# dependency layers. The concurrency limit stays at the default 4 so peak load
198208
# per runner is unchanged.
199209
test:
210+
permissions:
211+
contents: read
212+
id-token: write
200213
name: Test
201214
needs: changes
202215
if: ${{ !cancelled() && needs.changes.outputs.test != 'false' }}
@@ -237,6 +250,8 @@ jobs:
237250
238251
- name: Setup Vite+
239252
uses: ./.github/actions/setup-ci-deps
253+
with:
254+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
240255

241256
# electron's install.js (run by ensure:electron) reads this cache before it
242257
# downloads from GitHub. The key changes only with the Electron version.
@@ -278,6 +293,9 @@ jobs:
278293
# started last and ran alone for about 40s after everything else finished.
279294
# release.yml mirrors this test, test_web, and test_server split.
280295
test_web:
296+
permissions:
297+
contents: read
298+
id-token: write
281299
name: Test Web
282300
needs: changes
283301
if: ${{ !cancelled() && needs.changes.outputs.test_web != 'false' }}
@@ -295,6 +313,8 @@ jobs:
295313

296314
- name: Setup Vite+
297315
uses: ./.github/actions/setup-ci-deps
316+
with:
317+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
298318

299319
# The browser project runs React tests in headless Chromium. Same cache key as
300320
# test_server, so both jobs share one downloaded browser.
@@ -333,6 +353,9 @@ jobs:
333353
# The shards are the longest jobs, so they gate themselves instead of waiting
334354
# ~15s for `changes`: a shard the change cannot affect stops after checkout.
335355
test_server:
356+
permissions:
357+
contents: read
358+
id-token: write
336359
name: Test Server ${{ matrix.shard }}
337360
runs-on: blacksmith-4vcpu-ubuntu-2404
338361
timeout-minutes: 10
@@ -359,6 +382,8 @@ jobs:
359382
- name: Setup Vite+
360383
if: steps.changes.outputs.test_server != 'false'
361384
uses: ./.github/actions/setup-ci-deps
385+
with:
386+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
362387

363388
# No Electron setup here: `t3` (apps/server) has no Electron dependency
364389
# and none of its tests touch the runtime. Only the non-server `test`
@@ -395,7 +420,18 @@ jobs:
395420
env:
396421
T3CODE_TRANSFER_BUDGET_REPORT_PATH: ${{ runner.temp }}/t3code-transfer-budget.md
397422
T3CODE_TRANSFER_BUDGET_RESULT_PATH: ${{ runner.temp }}/thread-transfer-result.json
398-
run: vp run --filter t3 test --shard ${{ matrix.shard }}/${{ strategy.job-total }}
423+
run: >-
424+
vp run test:cached -- --shard ${{ matrix.shard }}/${{ strategy.job-total }}
425+
--uncached apps/server/integration/transferBudgetV2.integration.test.ts
426+
--verify-hits 1 --report "${{ runner.temp }}/test-cache-${{ matrix.shard }}.json" apps/server
427+
428+
- name: Upload test cache measurements
429+
if: always() && steps.changes.outputs.test_server != 'false'
430+
uses: actions/upload-artifact@v7
431+
with:
432+
name: test-cache-${{ matrix.shard }}
433+
path: ${{ runner.temp }}/test-cache-${{ matrix.shard }}.json
434+
if-no-files-found: error
399435

400436
# integration/transferBudgetV2.integration.test.ts writes the report; exactly one shard
401437
# produces these files. Gating the upload on their presence keeps a
@@ -495,6 +531,9 @@ jobs:
495531
run: vp run lint:mobile
496532

497533
release_smoke:
534+
permissions:
535+
contents: read
536+
id-token: write
498537
name: Release Smoke
499538
needs: changes
500539
if: ${{ !cancelled() && needs.changes.outputs.release_smoke != 'false' }}
@@ -512,6 +551,8 @@ jobs:
512551

513552
- name: Setup Vite+
514553
uses: ./.github/actions/setup-ci-deps
554+
with:
555+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
515556

516557
- name: Exercise release-only workflow steps
517558
run: node scripts/release-smoke.ts

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ jobs:
131131

132132
- name: Setup dependencies
133133
uses: ./.github/actions/setup-ci-deps
134+
with:
135+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
134136
env:
135137
pnpm_config_cache_dir: ${{ runner.temp }}/pnpm-metadata
136138

@@ -245,6 +247,8 @@ jobs:
245247

246248
- name: Setup dependencies
247249
uses: ./.github/actions/setup-ci-deps
250+
with:
251+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
248252

249253
- name: Ensure Electron runtime is installed
250254
run: vp run --filter @t3tools/desktop ensure:electron
@@ -275,6 +279,8 @@ jobs:
275279

276280
- name: Setup dependencies
277281
uses: ./.github/actions/setup-ci-deps
282+
with:
283+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
278284

279285
- name: Ensure Electron runtime is installed
280286
run: vp run --filter @t3tools/desktop ensure:electron
@@ -309,6 +315,8 @@ jobs:
309315

310316
- name: Setup dependencies
311317
uses: ./.github/actions/setup-ci-deps
318+
with:
319+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
312320

313321
- name: Resolve Playwright version
314322
id: playwright_version
@@ -359,6 +367,8 @@ jobs:
359367

360368
- name: Setup dependencies
361369
uses: ./.github/actions/setup-ci-deps
370+
with:
371+
task-cache-read-token: ${{ secrets.T3_TASK_CACHE_READ_TOKEN }}
362372

363373
# No Electron setup here: `t3` (apps/server) has no Electron dependency
364374
# and none of its tests touch the runtime. Only the non-server `test`

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ jobs:
8282
--archive=tgz \
8383
--yes \
8484
--token "$VERCEL_TOKEN" \
85-
--scope "$vercel_scope"
85+
--scope "$vercel_scope" \
86+
--build-env "VITE_RELEASE_CHANNEL=preview"
8687
)"
8788
printf '%s\n' "$deployment_output"
8889
# Vercel can print lockfile warnings to stdout before the deployment URL.

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ apps/mobile/.generated/
3636
apps/mobile/.android-cache/
3737
/.generated/
3838
artifacts/app-store/screenshots/
39+
artifacts/mobile-e2e/
3940
.github/pr-assets/
4041
native/**/target/
4142
node_modules/

‎.task-cache.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"endpoint": "https://t3-task-cache.pinglabs.workers.dev/projects/t3code"
3+
}

‎AGENTS.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ The most common defect in this repo is a change that works on the path you teste
9090

9191
An empty database is a bad test. Seed your worktree's `.t3` with a copy of real data instead of pointing at live state:
9292

93-
- The first `vp run dev` in a worktree does this for you when its database is missing. `--no-seed` or `T3CODE_DEV_SEED=0` skips it.
93+
- The first `vp run dev` in a worktree does this for you when its database is missing and the source is at most 500 MiB. Larger sources warn and dev starts with an empty database. `--no-seed` or `T3CODE_DEV_SEED=0` skips seeding. Manual migration still accepts larger sources and may use substantial disk space before pruning.
9494
- Run `vp run migrate-dev-db` with your dev server stopped to refresh. It rebuilds `<worktree>/.t3/userdata/statev2.sqlite` from a read-only snapshot of `~/.t3/userdata/statev2.sqlite`, the developer's real data. It keeps recent projects and their stopped threads, and drops scheduled tasks, pending work, and auth sessions, so your dev server never runs the developer's agents. Raise `--projects` and `--threads-per-project` for more data.
9595
- Refresh `statev2.sqlite`, not `state.sqlite`. The server copies the V1 `state.sqlite` only when `statev2.sqlite` is missing.
9696
- Bring `secrets` and `settings.json` only if the flow under test needs them.
@@ -134,12 +134,12 @@ An empty database is a bad test. Seed your worktree's `.t3` with a copy of real
134134

135135
- Upon request, user-visible frontend changes should get one integrated pass in a real client: `test-t3-app` for web, `test-t3-mobile` for mobile. The primary agent does this once after integrating. Subagents do not launch their own dev servers. Ask permission before doing computer use or spinning up browsers.
136136

137-
For authorized mobile verification, a missing or outdated native client is a build step, not a blocker. Run `node scripts/mobile-native-client.ts ensure <ios|android> <device-id>` on the simulator host before starting Metro. It checks the local Expo fingerprint and builds/installs when needed. See `test-t3-mobile` for the full workflow.
137+
For authorized mobile verification, a missing or outdated native client is an install step, not a blocker. Run `vp run mobile:install <ios|android> [device-id]` on the device host before starting Metro; it targets the only booted simulator or connected Android device when the id is omitted. It installs the dev client for this checkout's native fingerprint from the shared cache in seconds and builds only when no machine has built it yet, so prefer it over `expo run:*`, `xcodebuild`, or `gradlew`, which rebuild from scratch. Its stdout is one JSON line; build output goes to the log it names. See `test-t3-mobile` for the full workflow.
138138

139139
## Pull requests
140140

141141
- Never make a PR unless the developer explicitly asks you to do so.
142-
- If `origin` is git.cafe, follow [GitCafe mirror](docs/operations/development.md#gitcafe-mirror-optional): use `cafe` for existing PRs, issues, comments and labels, but push and open PRs on GitHub, where CI runs.
142+
- If `origin` is git.cafe, follow [GitCafe mirror](docs/operations/development.md#gitcafe-mirror-optional): push to `origin`, open and track PRs with `cafe` and their git.cafe URLs, and keep `gh` for merging.
143143
- Conventional commit titles, plain language: `fix(web): new threads no longer spike CPU`.
144144
- Body: the problem in a sentence or two, then how you fixed it. End with the model and harness that did the work.
145145
- UI changes need before/after images. Motion or timing needs a short video.
@@ -194,6 +194,7 @@ Architecture and its constraints: `docs/internals/overview.md`. Glossary: `docs/
194194
options, and pass combinators as additional function-builder arguments.
195195
- Inferred types over annotations. `any` is the enemy.
196196
- Default to no comment. Write one only for a constraint, an external quirk, or an invariant the code can't show, in one line where you can and four at most. Don't restate names or signatures, narrate steps, record history, or explain the fix you just made; the PR carries that. `t3code/no-low-value-comments` enforces the length cap and the mechanical cases.
197+
- React effects are for synchronizing with something outside React. Derive in render and act in handlers instead of syncing state, but don't hide real lifecycle work in refs or stores to dodge one. The `t3code/react-effect-budget` lint rule holds each file to its count in `scripts/effect-budget.json`; a new effect states its reason with `// oxlint-disable-next-line t3code/react-effect-budget -- <why>`.
197198
- Our users drive agents all day and notice a dropped frame, a lying spinner, and a stale label. No continuously repainting animations; they peg the GPU on high-refresh displays.
198199
- If a rule here fights the task in front of you, say so loudly and get a human sign-off before breaking it.
199200

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ We are (mostly) not accepting contributions yet. Small fixes may be considered.
9494

9595
Full docs live in [docs/](./docs). There's no docs site yet.
9696

97+
- [FAQ](./docs/user/faq.md)
9798
- [Install and first run](./docs/user/install.md)
9899
- [Permission modes](./docs/user/permission-modes.md)
99100
- [Keyboard shortcuts](./docs/user/keybindings.md)

‎apps/desktop/src/app/DesktopAppActivation.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,10 @@ export const make = Effect.gen(function* () {
382382
webContents.send(DESKTOP_APP_ACTIVATION_REQUEST_CHANNEL, request);
383383
});
384384
}),
385-
complete: (response) => Effect.sync(() => broker.complete(response)),
385+
// The IPC handler owns the activation-completion span.
386+
complete: Effect.fnUntraced(function* (response) {
387+
return yield* Effect.sync(() => broker.complete(response));
388+
}),
386389
});
387390
});
388391

0 commit comments

Comments
 (0)