Skip to content

Commit 5cd164e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix/citation-comment-popover-viewport
# Conflicts: # apps/web/src/components/chat/AssistantCitationChip.browser.test.tsx
2 parents 6ef0bcc + 81dea78 commit 5cd164e

981 files changed

Lines changed: 71931 additions & 13919 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.

‎.gitattributes‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Batch files need CRLF for cmd.exe to parse them reliably.
44
*.cmd text eol=crlf
55
*.bat text eol=crlf
6-
# GitHub's GraphQL schema and the operations graphqlgen writes from it.
6+
# GitHub's and Expo's GraphQL schemas and the operations graphqlgen writes from them.
77
packages/source-control-github/schema/** linguist-generated
8+
apps/server/schema/** linguist-generated
89
**/*.graphql.ts linguist-generated

‎.github/scripts/thread-transfer-report.cjs‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,26 @@ async function resolve({ github, context, core }) {
244244

245245
let pullNumber = source.pull_requests?.[0]?.number;
246246
if (!pullNumber) {
247-
const associated = await github.paginate(
248-
github.rest.repos.listPullRequestsAssociatedWithCommit,
249-
{ owner, repo, commit_sha: source.head_sha, per_page: 100 },
250-
);
247+
let associated;
248+
try {
249+
associated = await github.paginate(github.rest.repos.listPullRequestsAssociatedWithCommit, {
250+
owner,
251+
repo,
252+
commit_sha: source.head_sha,
253+
per_page: 100,
254+
});
255+
} catch (error) {
256+
// A force-pushed or deleted PR head can disappear before this workflow runs.
257+
if (
258+
error.status === 422 &&
259+
error.response?.data?.message === `No commit found for SHA: ${source.head_sha}`
260+
) {
261+
core.info(`Skipping CI result for unavailable commit ${source.head_sha}.`);
262+
core.setOutput("publish", "false");
263+
return;
264+
}
265+
throw error;
266+
}
251267
const matchingPulls = associated.filter(
252268
(pull) =>
253269
pull.state === "open" &&

‎.github/scripts/thread-transfer-report.test.cjs‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,47 @@ test("does not guess when a fallback commit belongs to multiple PRs", async () =
216216
assert.equal(fetchedPull, false);
217217
});
218218

219+
test("skips a missing PR commit but preserves other lookup failures", async () => {
220+
for (const [status, message, shouldSkip] of [
221+
[422, "No commit found for SHA: old-head", true],
222+
[422, "Validation Failed", false],
223+
[403, "API rate limit exceeded", false],
224+
]) {
225+
const outputs = {};
226+
const error = Object.assign(new Error(message), {
227+
status,
228+
response: { data: { message } },
229+
});
230+
const run = resolve({
231+
github: {
232+
paginate: async () => {
233+
throw error;
234+
},
235+
rest: { repos: { listPullRequestsAssociatedWithCommit: () => {} } },
236+
},
237+
context: {
238+
repo: { owner: "pingdotgg", repo: "t3code" },
239+
payload: {
240+
workflow_run: { event: "pull_request", head_sha: "old-head", pull_requests: [] },
241+
},
242+
},
243+
core: {
244+
info: () => {},
245+
setOutput: (key, value) => {
246+
outputs[key] = value;
247+
},
248+
},
249+
});
250+
if (shouldSkip) {
251+
await run;
252+
assert.equal(outputs.publish, "false");
253+
} else {
254+
await assert.rejects(run, (caught) => caught === error);
255+
assert.deepEqual(outputs, {});
256+
}
257+
}
258+
});
259+
219260
test("does not report a passing run that skipped the server tests", async () => {
220261
const outputs = {};
221262
const listWorkflowRunArtifacts = () => {};

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ jobs:
9393
- name: Check generated GitHub GraphQL operations
9494
run: vp run --filter @t3tools/source-control-github generate --check
9595

96+
- name: Check generated Expo GraphQL operations
97+
run: vp run --filter t3 generate --check
98+
9699
- name: Check
97100
run: vp check
98101

‎.github/workflows/cursor-hygiene-webhook.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Forward to Cursor hygiene
33
on:
44
push:
55
branches: [main]
6-
pull_request:
6+
# Use trusted workflow code and repository secrets for fork PRs.
7+
# Keep this job payload-only: never check out or run PR code.
8+
pull_request_target:
79
types: [opened, reopened, ready_for_review]
810
issues:
911
types: [opened, closed, reopened]
@@ -34,7 +36,7 @@ jobs:
3436
--output /dev/null --write-out '%{http_code}' \
3537
-H "Authorization: $AUTH" \
3638
-H "Content-Type: application/json" \
37-
-H "X-GitHub-Event: ${{ github.event_name }}" \
39+
-H "X-GitHub-Event: ${{ github.event_name == 'pull_request_target' && 'pull_request' || github.event_name }}" \
3840
-H "X-GitHub-Delivery: ${{ github.run_id }}-${{ github.run_attempt }}" \
3941
--data-binary @"${{ github.event_path }}") || curl_status=$?
4042
if [ "$curl_status" -eq 0 ]; then

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ jobs:
551551
clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
552552
relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
553553
label: macOS arm64
554-
runner: blacksmith-12vcpu-macos-26
554+
runner: macos-26-xlarge
555555
platform: mac
556556
target: dmg
557557
arch: arm64
@@ -574,7 +574,7 @@ jobs:
574574
clerk_cli_oauth_client_id: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}
575575
relay_url: ${{ needs.relay_public_config.outputs.relay_url }}
576576
label: macOS x64
577-
runner: blacksmith-12vcpu-macos-26
577+
runner: macos-26-xlarge
578578
platform: mac
579579
target: dmg
580580
arch: x64

‎AGENTS.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ An empty database is a bad test. Seed your worktree's `.t3` with a copy of real
100100
- **Do not run repo-wide checks.** No `vp check`, no `vp run -r test`, no `vp run -r typecheck` unless I ask. CI owns the full suite.
101101
- Backend behavior changes ship with focused tests for that behavior.
102102
- The server is event-sourced, and side effects run after the command commits. In tests, drain the effect worker (`OrchestrationEffectWorkerV2.drain`) or await the specific persisted event or `Deferred` that marks the milestone. Never wait on sleeps or polling. A test that needs a timeout to pass is wrong.
103+
- Web component tests are `*.browser.test.tsx` and render through `apps/web/test/render.tsx`. Acquire everything a test changes with `using`/`await using` so disposal undoes it even when the test fails; no `beforeEach`/`afterEach`, no module-level screens. Shared mock state that `vi.mock` factories read gets reset by a `setup()` call at the top of the test. `t3code/require-disposable-render` flags the old patterns.
104+
105+
```tsx
106+
it("saves on Enter", async () => {
107+
const onSave = vi.fn();
108+
using _now = vi.spyOn(Date, "now").mockReturnValue(0);
109+
await using screen = await render(<TitleEditor onSave={onSave} />, { router: "/threads/1" });
110+
await userEvent.type(screen.getByRole("textbox"), "Title{Enter}");
111+
expect(onSave).toHaveBeenCalledWith("Title");
112+
});
113+
```
114+
103115
- 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.
104116

105117
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.

‎apps/desktop/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@types/node": "catalog:",
3939
"acorn": "8.16.0",
4040
"cross-env": "^10.1.0",
41-
"electron-builder": "26.15.6",
41+
"electron-builder": "26.16.1",
4242
"tailwindcss": "^4.0.0",
4343
"vite-plus": "catalog:"
4444
},

‎apps/desktop/scripts/ensure-electron-runtime.mjs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ function installElectronRuntime(electronDir, version) {
123123
try {
124124
runChecked("curl", [
125125
"-fsSL",
126+
"--retry",
127+
"3",
128+
"--retry-all-errors",
129+
"--connect-timeout",
130+
"30",
131+
"--max-time",
132+
"300",
126133
`https://github.com/electron/electron/releases/download/v${version}/electron-v${version}-${hostPlatform}-${hostArch}.zip`,
127134
"-o",
128135
zipPath,

‎apps/desktop/src/backend/DesktopBackendPool.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export const layer = Layer.effect(
180180
electronDialog
181181
.showErrorBox(
182182
"This T3 home is unavailable",
183-
"Another T3 Code server, such as the background service, is using this data directory. Stop that server and reopen T3 Code, or set a separate T3CODE_HOME and pair with the running server.",
183+
"Another T3 Code server, such as the background service, is using this data directory, or an older background service is set up for it. Stop that server or try `t3 update`. If the older launcher cannot update, run `t3 service uninstall` and optionally reinstall with `t3 service install` from a current CLI. Use `npx t3@latest` if `t3` is missing or outdated, and pass `--base-dir` with the service's T3 home to each command. Then reopen T3 Code. You can also set a separate T3CODE_HOME and pair with the running server.",
184184
)
185185
.pipe(Effect.andThen(electronApp.quit)),
186186
});

0 commit comments

Comments
 (0)