Skip to content

Commit 2dc261f

Browse files
committed
Merge remote-tracking branch 'origin/main' into t3/investigate-errordata-preview-browser
2 parents ae7cc72 + a02bc75 commit 2dc261f

13 files changed

Lines changed: 1422 additions & 1143 deletions

‎.github/workflows/ci.yml‎

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,16 +355,22 @@ jobs:
355355
356356
# The web suite is the largest outside the server. In the shared Test job it
357357
# started last and ran alone for about 40s after everything else finished.
358-
# release.yml mirrors this test, test_web, and test_server split.
358+
# Browser tests are bound by the Vite server transforming modules for each
359+
# file, not by Chromium, so a second runner (and Vite server) halves the job
360+
# that gated every run. release.yml mirrors this test, test_web, and test_server split.
359361
test_web:
360362
permissions:
361363
contents: read
362364
id-token: write
363-
name: Test Web
365+
name: Test Web ${{ matrix.shard }}
364366
needs: changes
365367
if: ${{ !cancelled() && needs.changes.outputs.test_web != 'false' }}
366368
runs-on: blacksmith-8vcpu-ubuntu-2404
367369
timeout-minutes: 10
370+
strategy:
371+
fail-fast: false
372+
matrix:
373+
shard: [1, 2]
368374
steps:
369375
- name: Checkout
370376
uses: actions/checkout@v6
@@ -406,7 +412,7 @@ jobs:
406412
fi
407413
408414
- name: Test
409-
run: vp run --filter @t3tools/web test
415+
run: vp run --filter @t3tools/web test --shard ${{ matrix.shard }}/${{ strategy.job-total }}
410416

411417
# apps/server sets `fileParallelism: false`, so its test files run strictly
412418
# one at a time. Sharding spreads them over separate runners instead of
@@ -481,6 +487,17 @@ jobs:
481487
node apps/server/node_modules/playwright-core/cli.js install-deps chromium
482488
fi
483489
490+
# Each server test file runs in its own Vitest process, and a fresh install starts
491+
# Vitest's content-keyed module cache empty, so every file re-transformed its imports.
492+
# Only pushes to main save it, so pull requests never evict each other's entries.
493+
- name: Restore Vitest module cache
494+
if: steps.changes.outputs.test_server != 'false'
495+
uses: actions/cache/restore@v6
496+
with:
497+
path: node_modules/.vitest-cache
498+
key: vitest-modules-server-${{ matrix.shard }}-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
499+
restore-keys: vitest-modules-server-${{ matrix.shard }}-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-
500+
484501
- name: Test
485502
if: steps.changes.outputs.test_server != 'false'
486503
env:
@@ -491,6 +508,13 @@ jobs:
491508
--uncached apps/server/integration/transferBudgetV2.integration.test.ts
492509
--verify-hits 1 apps/server
493510
511+
- name: Save Vitest module cache
512+
if: github.event_name == 'push' && steps.changes.outputs.test_server != 'false'
513+
uses: actions/cache/save@v6
514+
with:
515+
path: node_modules/.vitest-cache
516+
key: vitest-modules-server-${{ matrix.shard }}-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
517+
494518
# integration/transferBudgetV2.integration.test.ts writes the report; exactly one shard
495519
# produces these files. Gating the upload on their presence keeps a
496520
# single `thread-transfer-results` artifact per run, which is the name

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,15 @@ jobs:
300300
# Web browser tests time out when they share a runner with the other package
301301
# suites: Chromium gets too little CPU and diff workers miss their 10s start budget.
302302
test_web:
303-
name: Release web tests
303+
name: Release web tests ${{ matrix.shard }}
304304
needs: [preflight]
305305
if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' }}
306306
runs-on: blacksmith-8vcpu-ubuntu-2404
307307
timeout-minutes: 10
308+
strategy:
309+
fail-fast: false
310+
matrix:
311+
shard: [1, 2]
308312
steps:
309313
- name: Checkout
310314
uses: actions/checkout@v6
@@ -344,10 +348,11 @@ jobs:
344348
fi
345349
346350
- name: Test
347-
run: vp run --filter @t3tools/web test
351+
run: vp run --filter @t3tools/web test --shard ${{ matrix.shard }}/${{ strategy.job-total }}
348352

349353
# Browser tests run source modules; this boots the production chunk graph.
350354
- name: Boot the built web client
355+
if: matrix.shard == 1
351356
run: |
352357
vp run --filter @t3tools/web build
353358
node apps/web/scripts/verify-built-boot.ts

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts‎

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4958,6 +4958,154 @@ describe("ClaudeAdapterV2 background wake turns", () => {
49584958
),
49594959
);
49604960

4961+
// regression: #15708 Stop must not silently drop a steer Claude queued behind a foreground task
4962+
it.effect.each([
4963+
{
4964+
readBy: "none",
4965+
echoes: true,
4966+
title: "warns that a steer Claude never read before Stop was not delivered",
4967+
},
4968+
{
4969+
readBy: "none",
4970+
echoes: false,
4971+
title: "does not warn about a steer on a CLI that never echoes prompt uuids",
4972+
},
4973+
{
4974+
readBy: "assistant",
4975+
echoes: true,
4976+
title: "does not warn about a steer Claude read before Stop",
4977+
},
4978+
] as const)("$title", ({ readBy, echoes }) =>
4979+
Effect.gen(function* () {
4980+
const harness = yield* makeWakeHarnessWithOptions({
4981+
close: (sdkMessages) => Queue.shutdown(sdkMessages),
4982+
freshQueueOnReopen: true,
4983+
});
4984+
const idAllocator = yield* IdAllocator.IdAllocatorV2;
4985+
const firstInput = makeClaudeTestTurnInput({
4986+
threadId: harness.threadId,
4987+
providerThread: harness.providerThread,
4988+
now: yield* DateTime.now,
4989+
attemptId: RunAttemptId.make("attempt-claude-unread-steer-1"),
4990+
text: "Run the slow curl in the foreground.",
4991+
attachments: [],
4992+
});
4993+
yield* harness.runtime.startTurn(firstInput);
4994+
const providerTurnId = idAllocator.derive.providerTurn({
4995+
driver: ClaudeAdapterV2.CLAUDE_PROVIDER,
4996+
nativeTurnId: `turn:${firstInput.attemptId}`,
4997+
});
4998+
yield* harness.offerAndWait(
4999+
claudeSdkFrame({
5000+
type: "assistant",
5001+
uuid: "00000000-0000-4000-8000-000000015701",
5002+
session_id: WAKE_NATIVE_SESSION,
5003+
parent_tool_use_id: null,
5004+
...(echoes ? { user_message_uuids: [harness.promptUuid(0)] } : {}),
5005+
message: {
5006+
id: "msg_unread_steer_bash",
5007+
type: "message",
5008+
role: "assistant",
5009+
model: "claude-sonnet-4-6",
5010+
content: [
5011+
{
5012+
type: "tool_use",
5013+
id: "toolu-unread-steer-bash",
5014+
name: "Bash",
5015+
input: { command: "curl http://127.0.0.1:9/hang" },
5016+
},
5017+
],
5018+
},
5019+
}),
5020+
);
5021+
// Past task_started the CLI queues a "now" steer until the call returns.
5022+
yield* harness.offerAndWait(
5023+
claudeSdkFrame({
5024+
type: "system",
5025+
subtype: "task_started",
5026+
task_id: "task-unread-steer-bash",
5027+
tool_use_id: "toolu-unread-steer-bash",
5028+
description: "Slow curl",
5029+
is_backgrounded: false,
5030+
task_type: "local_bash",
5031+
uuid: "00000000-0000-4000-8000-000000015702",
5032+
session_id: WAKE_NATIVE_SESSION,
5033+
}),
5034+
);
5035+
const steerText = "Codeword: PELICAN. Remember it, I will ask for it later.";
5036+
yield* harness.runtime.steerTurn({
5037+
threadId: harness.threadId,
5038+
runId: firstInput.runId,
5039+
providerThread: harness.providerThread,
5040+
providerTurnId,
5041+
message: {
5042+
createdBy: "user",
5043+
creationSource: "web",
5044+
messageId: MessageId.make("unread-steer"),
5045+
text: steerText,
5046+
attachments: [],
5047+
},
5048+
});
5049+
const steerUuid = harness.offeredMessages.at(-1)?.uuid;
5050+
assert.isDefined(steerUuid);
5051+
if (readBy === "assistant") {
5052+
yield* harness.offerAndWait(
5053+
claudeSdkFrame({
5054+
type: "assistant",
5055+
uuid: "00000000-0000-4000-8000-000000015703",
5056+
session_id: WAKE_NATIVE_SESSION,
5057+
parent_tool_use_id: null,
5058+
user_message_uuids: [steerUuid],
5059+
message: {
5060+
id: "msg_unread_steer_reply",
5061+
type: "message",
5062+
role: "assistant",
5063+
model: "claude-sonnet-4-6",
5064+
content: [{ type: "text", text: "Noted." }],
5065+
},
5066+
}),
5067+
);
5068+
}
5069+
const noticesBefore = harness.events.length;
5070+
yield* harness.runtime.interruptTurn({
5071+
providerThread: harness.providerThread,
5072+
providerTurnId,
5073+
});
5074+
assert.equal((yield* Queue.take(harness.terminalReceipts)).status, "interrupted");
5075+
5076+
const notices = harness.events
5077+
.slice(noticesBefore)
5078+
.flatMap((event) =>
5079+
event.type === "turn_item.updated" && event.turnItem.type === "system_notice"
5080+
? [event.turnItem.message]
5081+
: [],
5082+
);
5083+
const undelivered = notices.find((message) =>
5084+
/not (have )?(been )?delivered|never (reached|delivered)/i.test(message ?? ""),
5085+
);
5086+
if (readBy !== "none" || !echoes) {
5087+
assert.isUndefined(undelivered);
5088+
return;
5089+
}
5090+
assert.isDefined(
5091+
undelivered,
5092+
`expected an undelivered-steer notice, got ${JSON.stringify(notices)}`,
5093+
);
5094+
assert.match(undelivered ?? "", /resend|send it again|re-send/i);
5095+
assert.include(undelivered, "PELICAN");
5096+
}).pipe(
5097+
Effect.scoped,
5098+
Effect.provide(
5099+
Layer.mergeAll(
5100+
IdAllocator.layer,
5101+
McpProviderSessions.layer,
5102+
NodeServices.layer,
5103+
NodeCrypto.layer,
5104+
),
5105+
),
5106+
),
5107+
);
5108+
49615109
// regression: #23948 Claude holds a steer behind a running foreground tool
49625110
// call and goes silent, so each steer stays pending until Claude starts it.
49635111
it.effect("keeps a steer pending until Claude starts it", () =>

0 commit comments

Comments
 (0)