Skip to content

Commit 5f1f604

Browse files
feat(mobile): on-demand chrome e2e runner across simulators
`vp run mobile:e2e [--device <id>] [--concurrency <n>]` boots dedicated simulators, installs the cached dev client, starts a fixture server and Metro, pairs automatically, then runs home -> open thread -> back. Each step records video and checks the settled chrome (tab bar, back button, composer) from accessibility snapshots, and compares video frames to the settled screenshots to catch chrome that lags a transition, such as the workspace tabs drawn over an entering thread (#24666). Results land in artifacts/mobile-e2e/<run>/index.html with screenshots, videos, frame sheets and the first offending frame. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e3592ef commit 5f1f604

65 files changed

Lines changed: 940 additions & 1716 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.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ jobs:
8282
--archive=tgz \
8383
--yes \
8484
--token "$VERCEL_TOKEN" \
85-
--scope "$vercel_scope" \
86-
--build-env "VITE_RELEASE_CHANNEL=preview"
85+
--scope "$vercel_scope"
8786
)"
8887
printf '%s\n' "$deployment_output"
8988
# 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/

‎AGENTS.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ 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 a last resort: derive in render, act in handlers, reset with `key`, or use a ref callback or store. The `t3code/react-effect-budget` lint rule holds each file to its entry in `scripts/effect-budget.json`; raise an entry only in the PR that needs the effect, and lower it when you remove one.
198197
- 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.
199198
- If a rule here fights the task in front of you, say so loudly and get a human sign-off before breaking it.
200199

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ import { PRIMARY_LOCAL_ENVIRONMENT_ID } from "@t3tools/contracts";
22
import {
33
makeLocalFileTracer,
44
makeTraceSink,
5-
processServiceInstanceId,
65
type SignalExport,
76
} from "@t3tools/shared/observability";
87
import * as HostProcess from "@t3tools/shared/HostProcess";
98
import * as SharedObservability from "@t3tools/shared/observability";
109
import * as OtelEnvironment from "@t3tools/shared/otelEnvironment";
11-
import { releaseChannelOf, releaseResourceAttributes } from "@t3tools/shared/releaseResource";
1210
import {
1311
parsePersistedServerObservabilitySettings,
1412
type PersistedServerObservabilitySettings,
@@ -597,22 +595,14 @@ const layerTelemetry = Layer.unwrap(
597595
Effect.gen(function* () {
598596
const environment = yield* DesktopEnvironment.DesktopEnvironment;
599597
const endpoints = yield* resolveOtlpEndpoints;
600-
// Unpackaged runs launch a script, so Electron reports its own version.
601-
const serviceVersion = environment.isPackaged
602-
? environment.appVersion
603-
: desktopPackageJson.version;
604598
const resource = {
605599
serviceName: "t3code-desktop",
606-
serviceVersion,
600+
// Unpackaged runs launch a script, so Electron reports its own version.
601+
serviceVersion: environment.isPackaged ? environment.appVersion : desktopPackageJson.version,
607602
attributes: {
608603
"service.namespace": "t3code",
609604
"service.runtime": "desktop",
610605
"service.mode": environment.isDevelopment ? "development" : "packaged",
611-
"service.instance.id": processServiceInstanceId(endpoints.resourceAttributes),
612-
...releaseResourceAttributes(
613-
environment.isDevelopment ? "dev" : releaseChannelOf(serviceVersion),
614-
endpoints.resourceAttributes,
615-
),
616606
"host.name": endpoints.resourceAttributes["host.name"] || (yield* HostProcess.Hostname),
617607
},
618608
};

‎apps/desktop/src/backend/DesktopBackendConfiguration.test.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ describe("DesktopBackendConfiguration", () => {
678678
),
679679
);
680680

681-
it.effect("resolveWsl carries the kill switch and resource attributes into the distro", () =>
681+
it.effect("resolveWsl carries the kill switch into the distro", () =>
682682
Effect.gen(function* () {
683683
const fileSystem = yield* FileSystem.FileSystem;
684684
const baseDir = yield* fileSystem.makeTempDirectoryScoped({
@@ -688,12 +688,10 @@ describe("DesktopBackendConfiguration", () => {
688688
const previousWslEnv = process.env.WSLENV;
689689
const previousDisabled = process.env.OTEL_SDK_DISABLED;
690690
const previousTelemetry = process.env.T3CODE_TELEMETRY_ENABLED;
691-
const previousResourceAttributes = process.env.OTEL_RESOURCE_ATTRIBUTES;
692691
try {
693692
delete process.env.WSLENV;
694693
process.env.OTEL_SDK_DISABLED = "true";
695694
process.env.T3CODE_TELEMETRY_ENABLED = "false";
696-
process.env.OTEL_RESOURCE_ATTRIBUTES = "deployment.environment.name=staging";
697695

698696
yield* Effect.gen(function* () {
699697
const configuration = yield* DesktopBackendConfiguration.DesktopBackendConfiguration;
@@ -703,8 +701,6 @@ describe("DesktopBackendConfiguration", () => {
703701
assert.include((config.env.WSLENV ?? "").split(":"), "OTEL_SDK_DISABLED");
704702
assert.equal(config.env.T3CODE_TELEMETRY_ENABLED, "false");
705703
assert.include((config.env.WSLENV ?? "").split(":"), "T3CODE_TELEMETRY_ENABLED");
706-
assert.equal(config.env.OTEL_RESOURCE_ATTRIBUTES, "deployment.environment.name=staging");
707-
assert.include((config.env.WSLENV ?? "").split(":"), "OTEL_RESOURCE_ATTRIBUTES");
708704
}).pipe(
709705
Effect.provide(
710706
layerBackendConfiguration().pipe(
@@ -726,7 +722,6 @@ describe("DesktopBackendConfiguration", () => {
726722
restoreEnv("WSLENV", previousWslEnv);
727723
restoreEnv("OTEL_SDK_DISABLED", previousDisabled);
728724
restoreEnv("T3CODE_TELEMETRY_ENABLED", previousTelemetry);
729-
restoreEnv("OTEL_RESOURCE_ATTRIBUTES", previousResourceAttributes);
730725
}
731726
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
732727
);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ const WSL_FORWARDED_ENV_NAMES = [
110110
"OTEL_TRACES_EXPORTER",
111111
"OTEL_METRICS_EXPORTER",
112112
"OTEL_LOGS_EXPORTER",
113-
"OTEL_RESOURCE_ATTRIBUTES",
114113
] as const;
115114

116115
const WSL_SERVER_SYSTEM_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";

‎apps/mobile/src/features/observability/tracing.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ it.effect("does not let OTLP serialization failures alter application effects",
2727
},
2828
{
2929
appVariant: "test",
30-
serviceInstanceId: "test-instance",
3130
serviceVersion: "1.2.3",
3231
},
3332
).pipe(Layer.provide(layerRemoteHttpClient(fetchFn)));

‎apps/mobile/src/features/observability/tracing.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Constants from "expo-constants";
2-
import { type ReleaseChannel, releaseResourceAttributes } from "@t3tools/shared/releaseResource";
32
import * as RelayTracing from "@t3tools/shared/relayTracing";
43

54
import { hasTracingPublicConfig, resolveCloudPublicConfig } from "../cloud/publicConfig";
@@ -12,16 +11,9 @@ export interface TracingConfig {
1211

1312
export interface TracingResource {
1413
readonly serviceVersion?: string;
15-
readonly serviceInstanceId: string;
1614
readonly appVariant: string;
1715
}
1816

19-
const RELEASE_CHANNEL_BY_VARIANT: Readonly<Record<string, ReleaseChannel | undefined>> = {
20-
development: "dev",
21-
preview: "preview",
22-
production: "stable",
23-
};
24-
2517
export function resolveTracingConfig(): TracingConfig | null {
2618
const config = resolveCloudPublicConfig();
2719
if (!hasTracingPublicConfig(config)) {
@@ -32,23 +24,16 @@ export function resolveTracingConfig(): TracingConfig | null {
3224
}
3325

3426
export function layerFromConfig(config: TracingConfig | null, resource: TracingResource) {
35-
const channel =
36-
typeof __DEV__ !== "undefined" && __DEV__
37-
? "dev"
38-
: RELEASE_CHANNEL_BY_VARIANT[resource.appVariant];
3927
return RelayTracing.layer(config, {
4028
serviceName: "t3code-mobile",
4129
serviceVersion: resource.serviceVersion,
4230
runtime: "react-native",
43-
serviceInstanceId: resource.serviceInstanceId,
4431
client: `mobile-${resource.appVariant}`,
45-
attributes: channel && releaseResourceAttributes(channel),
4632
});
4733
}
4834

4935
export const layer = layerFromConfig(resolveTracingConfig(), {
5036
serviceVersion: Constants.expoConfig?.version,
51-
serviceInstanceId: Constants.sessionId,
5237
appVariant:
5338
typeof Constants.expoConfig?.extra?.appVariant === "string"
5439
? Constants.expoConfig.extra.appVariant

‎apps/mobile/src/features/threads/use-composer-command-menu.ts‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ import type { ComposerCommandItem } from "./ComposerCommandPopover";
5959
import { matchesSlashSkillQuery } from "./composerSlashSkillSearch";
6060

6161
const WORKSPACE_SNAPSHOT_RETRY_COOLDOWN_MS = 10_000;
62-
// A cwd that never scans, such as a deleted worktree, would otherwise retry forever.
63-
const WORKSPACE_SNAPSHOT_MAX_ATTEMPTS = 3;
6462

6563
function composerSelectionAtEnd(draftMessage: string): ComposerEditorSelection {
6664
return { start: draftMessage.length, end: draftMessage.length };
@@ -254,7 +252,6 @@ export function useComposerCommandMenu({
254252
);
255253
// Record client request time to enforce TTL even when the client clock runs ahead of the server.
256254
const workspaceRefreshKeyRef = useRef<{ key: string; requestedAt: number } | null>(null);
257-
const failedRefreshesRef = useRef<{ key: string; count: number } | null>(null);
258255
const [workspaceRefreshRetry, setWorkspaceRefreshRetry] = useState<{
259256
key: string;
260257
notBefore: number;
@@ -310,11 +307,6 @@ export function useComposerCommandMenu({
310307
workspaceRefreshKeyRef.current = request;
311308
const retryLater = () => {
312309
if (workspaceRefreshKeyRef.current !== request) return;
313-
const failed = failedRefreshesRef.current;
314-
const count = failed?.key === key ? failed.count + 1 : 1;
315-
failedRefreshesRef.current = { key, count };
316-
// Keeping the request marker lets the TTL hold off the next scan.
317-
if (count >= WORKSPACE_SNAPSHOT_MAX_ATTEMPTS) return;
318310
workspaceRefreshKeyRef.current = null;
319311
setWorkspaceRefreshRetry({
320312
key,
@@ -334,7 +326,6 @@ export function useComposerCommandMenu({
334326
projectCwd,
335327
);
336328
if (!refreshed) retryLater();
337-
else failedRefreshesRef.current = null;
338329
}, retryLater);
339330
}, [
340331
draftMessage,

‎apps/server/scripts/acp-mock-agent.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ const emitGrokMonitorPostTurnPoll = process.env.T3_ACP_EMIT_GROK_MONITOR_POST_TU
5252
const emitGrokBackgroundTaskStarted = process.env.T3_ACP_EMIT_GROK_BACKGROUND_TASK_STARTED === "1";
5353
const emitGrokBackgroundTaskPoll = process.env.T3_ACP_GROK_BACKGROUND_TASK_COMPLETION === "poll";
5454
const emitForeignSessionUpdates = process.env.T3_ACP_EMIT_FOREIGN_SESSION_UPDATES === "1";
55-
const omitInitializeModelState = process.env.T3_ACP_OMIT_INITIALIZE_MODEL_STATE === "1";
5655
const waitForResumeRelease = process.env.T3_ACP_WAIT_FOR_RESUME_RELEASE === "1";
5756
const completeFirstPromptOnCancel = process.env.T3_ACP_COMPLETE_FIRST_PROMPT_ON_CANCEL === "1";
5857
const floodStderr = process.env.T3_ACP_FLOOD_STDERR === "1";
@@ -576,7 +575,7 @@ const program = Effect.gen(function* () {
576575
return {
577576
protocolVersion: 2,
578577
info: { name: "t3-acp-mock-agent", version: "0.0.0" },
579-
...(omitInitializeModelState ? {} : { _meta: { modelState: modelState() } }),
578+
_meta: { modelState: modelState() },
580579
capabilities: {
581580
session: {
582581
...(supportsSessionLifecycle ? { fork: {}, additionalDirectories: {} } : {}),

0 commit comments

Comments
 (0)