GeezerVison is showing github.com — Merge pull request #68 from RTVision/sync/upstream-rtvision-0.0.61 · RTVision/t3code@797e8f6
File treeExpand file treeCollapse file tree Open diff view settings modules/t3-agent-notifications/android/src/main/java/expo/modules/t3agentnotifications
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/VOUCHED.td +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -68,6 +68,7 @@ github:realAhmedRoach | 68 | 68 | github:Rishet11 | 69 | 69 | github:ryanrhughes | 70 | 70 | github:saphid | | 71 | +github:scratchyone | 71 | 72 | github:sethwebster | 72 | 73 | github:shiroyasha9 | 73 | 74 | github:shivamhwp | |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/mobile-eas-preview.yml +13-1Lines changed: 13 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 78 | 78 | working-directory: apps/mobile | 79 | 79 | env: | 80 | 80 | EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }} | 81 | | - run: eas env:pull preview --non-interactive | | 81 | + run: | | | 82 | + eas env:pull preview --non-interactive | | 83 | + # EAS Update disables dotenv loading. Keep the downloaded native config | | 84 | + # in its process environment so Android build and OTA fingerprints match. | | 85 | + node --input-type=module <<'NODE' | | 86 | + import { appendFileSync, readFileSync } from "node:fs"; | | 87 | + import { parseEnv } from "node:util"; | | 88 | + const env = parseEnv(readFileSync(".env.local", "utf8")); | | 89 | + const googleServicesFile = env.T3CODE_ANDROID_GOOGLE_SERVICES_FILE; | | 90 | + if (googleServicesFile) { | | 91 | + appendFileSync(process.env.GITHUB_ENV, `T3CODE_ANDROID_GOOGLE_SERVICES_FILE=${googleServicesFile}\n`); | | 92 | + } | | 93 | + NODE | 82 | 94 |
| 83 | 95 | - name: Deploy with fingerprint check | 84 | 96 | if: steps.expo-token.outputs.present == 'true' | |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/mobile-showcase-screenshots.yml +11Lines changed: 11 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 76 | 76 | echo "$vp_pnpm_bin" >> "$GITHUB_PATH" | 77 | 77 | "$vp_pnpm_bin/pnpm" --version | 78 | 78 |
| | 79 | + - name: Install AXe | | 80 | + # Locks the simulator and answers the notification prompt for the | | 81 | + # agent-activity scene. | | 82 | + # Homebrew refuses third-party tap formulae until they are trusted; | | 83 | + # older releases have no trust command and install them as is. | | 84 | + run: | | | 85 | + brew tap cameroncooke/axe | | 86 | + if brew commands | grep -qx trust; then brew trust --formula cameroncooke/axe/axe; fi | | 87 | + brew install cameroncooke/axe/axe | | 88 | + axe --version | | 89 | +
| 79 | 90 | - name: Capture iOS showcase | 80 | 91 | run: pnpm screenshots:mobile --platform ios --appearance "${{ inputs.appearance }}" --theme "${{ inputs.theme }}" | 81 | 92 |
| |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/release.yml +68-3Lines changed: 68 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -260,13 +260,76 @@ jobs: | 260 | 260 | - name: Typecheck | 261 | 261 | run: vp run typecheck | 262 | 262 |
| | 263 | + # Keep tests on their own runners, using the same package split and server | | 264 | + # shards as CI, so the release check job does not spend its budget on tests. | | 265 | + test: | | 266 | + name: Release tests | | 267 | + needs: [preflight] | | 268 | + if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' }} | | 269 | + runs-on: blacksmith-8vcpu-ubuntu-2404 | | 270 | + timeout-minutes: 10 | | 271 | + steps: | | 272 | + - name: Checkout | | 273 | + uses: actions/checkout@v6 | | 274 | + with: | | 275 | + ref: ${{ needs.preflight.outputs.ref }} | | 276 | + sparse-checkout: | | | 277 | + /* | | 278 | + !/.repos/ | | 279 | + sparse-checkout-cone-mode: false | | 280 | + | | 281 | + - name: Setup Vite+ | | 282 | + uses: voidzero-dev/setup-vp@v1 | | 283 | + with: | | 284 | + node-version-file: package.json | | 285 | + cache: true | | 286 | + run-install: true | | 287 | + | | 288 | + - name: Ensure Electron runtime is installed | | 289 | + run: vp run --filter @t3tools/desktop ensure:electron | | 290 | + | 263 | 291 | - uses: ./.github/actions/setup-apt-mirrors | 264 | 292 |
| 265 | 293 | - name: Install browser secret helper build libraries | 266 | | - run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config | | 294 | + run: | | | 295 | + sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources | | 296 | + sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config build-essential | | 297 | +
| | 298 | + - name: Test | | 299 | + run: vp run --parallel --concurrency-limit 4 --filter '!t3' --filter '!@t3tools/monorepo' test | | 300 | + | | 301 | + test_server: | | 302 | + name: Release server tests ${{ matrix.shard }} | | 303 | + needs: [preflight] | | 304 | + if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' }} | | 305 | + runs-on: blacksmith-8vcpu-ubuntu-2404 | | 306 | + timeout-minutes: 10 | | 307 | + strategy: | | 308 | + fail-fast: false | | 309 | + matrix: | | 310 | + shard: [1, 2, 3] | | 311 | + steps: | | 312 | + - name: Checkout | | 313 | + uses: actions/checkout@v6 | | 314 | + with: | | 315 | + ref: ${{ needs.preflight.outputs.ref }} | | 316 | + sparse-checkout: | | | 317 | + /* | | 318 | + !/.repos/ | | 319 | + sparse-checkout-cone-mode: false | | 320 | + | | 321 | + - name: Setup Vite+ | | 322 | + uses: voidzero-dev/setup-vp@v1 | | 323 | + with: | | 324 | + node-version-file: package.json | | 325 | + cache: true | | 326 | + run-install: true | 267 | 327 |
| | 328 | + # No Electron setup here: `t3` (apps/server) has no Electron dependency | | 329 | + # and none of its tests touch the runtime. Only the non-server `test` | | 330 | + # job, which covers @t3tools/desktop, needs the download. | 268 | 331 | - name: Test | 269 | | - run: vp run test | | 332 | + run: vp run --filter t3 test --shard ${{ matrix.shard }}/${{ strategy.job-total }} | 270 | 333 |
| 271 | 334 | relay_public_config: | 272 | 335 | name: Resolve T3 Connect public config | @@ -631,13 +694,15 @@ jobs: | 631 | 694 | preflight, | 632 | 695 | relay_public_config, | 633 | 696 | quality, | | 697 | + test, | | 698 | + test_server, | 634 | 699 | desktop_mac_arm64, | 635 | 700 | desktop_linux_x64, | 636 | 701 | desktop_linux_arm64, | 637 | 702 | desktop_win_x64, | 638 | 703 | desktop_win_arm64, | 639 | 704 | ] | 640 | | - if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' }} | | 705 | + if: ${{ !failure() && !cancelled() && needs.preflight.result == 'success' && needs.relay_public_config.result == 'success' && needs.quality.result == 'success' && needs.test.result == 'success' && needs.test_server.result == 'success' && needs.desktop_mac_arm64.result == 'success' && needs.desktop_linux_x64.result == 'success' && needs.desktop_linux_arm64.result == 'success' && needs.desktop_win_x64.result == 'success' && needs.desktop_win_arm64.result == 'success' }} | 641 | 706 | runs-on: ubuntu-24.04 # blacksmith-8vcpu-ubuntu-2404 | 642 | 707 | timeout-minutes: 15 | 643 | 708 | permissions: | |
Collapse file Copy file name to clipboardExpand all lines: apps/desktop/src/app/DesktopObservability.test.ts +64Lines changed: 64 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient"; | 2 | 2 | import * as NodeServices from "@effect/platform-node/NodeServices"; | 3 | 3 | import { assert, describe, it } from "@effect/vitest"; | | 4 | +import * as ConfigProvider from "effect/ConfigProvider"; | 4 | 5 | import * as Effect from "effect/Effect"; | 5 | 6 | import * as FileSystem from "effect/FileSystem"; | 6 | 7 | import * as Layer from "effect/Layer"; | @@ -427,6 +428,36 @@ describe("DesktopObservability", () => { | 427 | 428 | ); | 428 | 429 | }); | 429 | 430 |
| | 431 | + it.effect("exports kill switch warnings through the configured logger", () => { | | 432 | + const requests: Array<ExportedRequest> = []; | | 433 | + return Effect.gen(function* () { | | 434 | + const fileSystem = yield* FileSystem.FileSystem; | | 435 | + const baseDir = yield* fileSystem.makeTempDirectoryScoped({ | | 436 | + prefix: "t3-desktop-observability-test-", | | 437 | + }); | | 438 | + const environmentLayer = makeEnvironmentLayer(baseDir, true, { | | 439 | + T3CODE_OTLP_LOGS_URL: "https://collector.example.com/v1/logs", | | 440 | + }); | | 441 | + | | 442 | + yield* Effect.scoped( | | 443 | + Effect.void.pipe( | | 444 | + Effect.provide(DesktopObservability.layer.pipe(Layer.provideMerge(environmentLayer))), | | 445 | + ), | | 446 | + ); | | 447 | + | | 448 | + assert.include(requests[0]?.body ?? "", "OTEL_SDK_DISABLED=1 was read as false"); | | 449 | + }).pipe( | | 450 | + Effect.scoped, | | 451 | + Effect.provide( | | 452 | + Layer.mergeAll( | | 453 | + NodeServices.layer, | | 454 | + collectorLayer(requests), | | 455 | + ConfigProvider.layer(ConfigProvider.fromEnv({ env: { OTEL_SDK_DISABLED: "1" } })), | | 456 | + ), | | 457 | + ), | | 458 | + ); | | 459 | + }); | | 460 | + | 430 | 461 | it.effect("reads every signal endpoint from Settings when the environment names none", () => { | 431 | 462 | const requests: Array<ExportedRequest> = []; | 432 | 463 | return Effect.gen(function* () { | @@ -491,4 +522,37 @@ describe("DesktopObservability", () => { | 491 | 522 | Effect.provide(Layer.mergeAll(NodeServices.layer, collectorLayer(requests))), | 492 | 523 | ); | 493 | 524 | }); | | 525 | + | | 526 | + it.effect("stops every export when the OpenTelemetry SDK is disabled", () => { | | 527 | + const requests: Array<ExportedRequest> = []; | | 528 | + return Effect.gen(function* () { | | 529 | + const fileSystem = yield* FileSystem.FileSystem; | | 530 | + const baseDir = yield* fileSystem.makeTempDirectoryScoped({ | | 531 | + prefix: "t3-desktop-observability-test-", | | 532 | + }); | | 533 | + const environmentLayer = makeEnvironmentLayer(baseDir); | | 534 | + yield* writeObservabilitySettings(environmentLayer, { | | 535 | + otlpTracesUrl: "https://settings.example.com/v1/traces", | | 536 | + otlpLogsUrl: "https://settings.example.com/v1/logs", | | 537 | + }); | | 538 | + | | 539 | + yield* Effect.scoped( | | 540 | + Effect.logInfo("desktop log stays local when disabled").pipe( | | 541 | + Effect.withSpan("desktop-disabled-test"), | | 542 | + Effect.provide(DesktopObservability.layer.pipe(Layer.provideMerge(environmentLayer))), | | 543 | + ), | | 544 | + ); | | 545 | + | | 546 | + assert.lengthOf(requests, 0); | | 547 | + }).pipe( | | 548 | + Effect.scoped, | | 549 | + Effect.provide( | | 550 | + Layer.mergeAll( | | 551 | + NodeServices.layer, | | 552 | + collectorLayer(requests), | | 553 | + ConfigProvider.layer(ConfigProvider.fromEnv({ env: { OTEL_SDK_DISABLED: "true" } })), | | 554 | + ), | | 555 | + ), | | 556 | + ); | | 557 | + }); | 494 | 558 | }); |
Collapse file Copy file name to clipboardExpand all lines: apps/desktop/src/app/DesktopObservability.ts +13-1Lines changed: 13 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 4 | 4 | makeTraceSink, | 5 | 5 | otlpSerializationLayer, | 6 | 6 | } from "@t3tools/shared/observability"; | | 7 | +import * as OtelEnvironment from "@t3tools/shared/otelEnvironment"; | 7 | 8 | import { | 8 | 9 | parsePersistedServerObservabilitySettings, | 9 | 10 | type PersistedServerObservabilitySettings, | @@ -353,12 +354,18 @@ const readPersistedObservabilitySettings: Effect.Effect< | 353 | 354 | * resolve traces against one revision of the file and logs against another. | 354 | 355 | */ | 355 | 356 | const resolveOtlpEndpoints = Effect.gen(function* () { | | 357 | + const otel = yield* OtelEnvironment.load; | | 358 | + if (otel.disabled) { | | 359 | + return { traces: undefined, metrics: undefined, logs: undefined, warnings: otel.warnings }; | | 360 | + } | | 361 | + | 356 | 362 | const environment = yield* DesktopEnvironment.DesktopEnvironment; | 357 | 363 | const persisted = yield* readPersistedObservabilitySettings; | 358 | 364 | return { | 359 | 365 | traces: Option.getOrUndefined(environment.otlpTracesUrl) ?? persisted.otlpTracesUrl, | 360 | 366 | metrics: Option.getOrUndefined(environment.otlpMetricsUrl) ?? persisted.otlpMetricsUrl, | 361 | 367 | logs: Option.getOrUndefined(environment.otlpLogsUrl) ?? persisted.otlpLogsUrl, | | 368 | + warnings: otel.warnings, | 362 | 369 | }; | 363 | 370 | }); | 364 | 371 |
| @@ -671,7 +678,12 @@ const telemetryLayer = Layer.unwrap( | 671 | 678 | // resource, | 672 | 679 | // }).pipe(Layer.provide(serializationLayer)); | 673 | 680 |
| 674 | | - return Layer.mergeAll(loggerLayer, tracerLayer); | | 681 | + // Logged once the loggers above are installed, so the warnings use them. | | 682 | + const otelWarningsLayer = Layer.effectDiscard( | | 683 | + Effect.forEach(endpoints.warnings, (warning) => Effect.logWarning(warning)), | | 684 | + ); | | 685 | + | | 686 | + return otelWarningsLayer.pipe(Layer.provideMerge(Layer.mergeAll(loggerLayer, tracerLayer))); | 675 | 687 | }), | 676 | 688 | ); | 677 | 689 |
| |
Collapse file Copy file name to clipboardExpand all lines: apps/desktop/src/backend/DesktopBackendConfiguration.test.ts +43Lines changed: 43 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -983,6 +983,49 @@ describe("DesktopBackendConfiguration", () => { | 983 | 983 | }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)), | 984 | 984 | ); | 985 | 985 |
| | 986 | + it.effect("resolveWsl carries the kill switch into the distro", () => | | 987 | + Effect.gen(function* () { | | 988 | + const fileSystem = yield* FileSystem.FileSystem; | | 989 | + const baseDir = yield* fileSystem.makeTempDirectoryScoped({ | | 990 | + prefix: "t3-desktop-backend-config-test-", | | 991 | + }); | | 992 | + | | 993 | + const previousWslEnv = process.env.WSLENV; | | 994 | + const previousDisabled = process.env.OTEL_SDK_DISABLED; | | 995 | + try { | | 996 | + delete process.env.WSLENV; | | 997 | + process.env.OTEL_SDK_DISABLED = "true"; | | 998 | + | | 999 | + yield* Effect.gen(function* () { | | 1000 | + const configuration = yield* DesktopBackendConfiguration.DesktopBackendConfiguration; | | 1001 | + const config = yield* configuration.resolveWsl({ port: 5050, distro: null }); | | 1002 | + | | 1003 | + assert.equal(config.env.OTEL_SDK_DISABLED, "true"); | | 1004 | + assert.include((config.env.WSLENV ?? "").split(":"), "OTEL_SDK_DISABLED"); | | 1005 | + }).pipe( | | 1006 | + Effect.provide( | | 1007 | + DesktopBackendConfiguration.layer.pipe( | | 1008 | + Layer.provideMerge(serverExposureLayer), | | 1009 | + Layer.provideMerge(DesktopAppSettings.layerTest()), | | 1010 | + Layer.provideMerge(DesktopWslServerTree.layerTest()), | | 1011 | + Layer.provideMerge( | | 1012 | + DesktopWslEnvironment.layerTest({ | | 1013 | + isAvailable: true, | | 1014 | + windowsToWslPath: () => Option.some("/mnt/c/repo/apps/server/src/index.ts"), | | 1015 | + getDistroIp: () => Option.some("172.27.0.99"), | | 1016 | + }), | | 1017 | + ), | | 1018 | + Layer.provideMerge(makeEnvironmentLayer(baseDir, { platform: "win32" })), | | 1019 | + ), | | 1020 | + ), | | 1021 | + ); | | 1022 | + } finally { | | 1023 | + restoreEnv("WSLENV", previousWslEnv); | | 1024 | + restoreEnv("OTEL_SDK_DISABLED", previousDisabled); | | 1025 | + } | | 1026 | + }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)), | | 1027 | + ); | | 1028 | + | 986 | 1029 | it.effect("resolveWsl preserves existing WSLENV entries when forwarding backend secrets", () => | 987 | 1030 | Effect.gen(function* () { | 988 | 1031 | const fileSystem = yield* FileSystem.FileSystem; | |
Collapse file Copy file name to clipboardExpand all lines: apps/desktop/src/backend/DesktopBackendConfiguration.ts +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -96,6 +96,9 @@ const DESKTOP_BACKEND_ENV_NAMES = [ | 96 | 96 | const WSL_FORWARDED_ENV_NAMES = [ | 97 | 97 | "OPENAI_API_KEY", | 98 | 98 | "ANTHROPIC_API_KEY", | | 99 | + // Otherwise the WSL server keeps exporting to endpoints from the bootstrap. | | 100 | + "T3CODE_OTEL_SDK_DISABLED", | | 101 | + "OTEL_SDK_DISABLED", | 99 | 102 | "T3CODE_OTLP_HEADERS", | 100 | 103 | "T3CODE_OTLP_PROTOCOL", | 101 | 104 | ] as const; | |
Collapse file Copy file name to clipboardExpand all lines: apps/desktop/src/electron/ElectronProtocol.test.ts +9-2Lines changed: 9 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -105,7 +105,7 @@ describe("ElectronProtocol", () => { | 105 | 105 | ); | 106 | 106 | assert.include( | 107 | 107 | response.headers.get("content-security-policy") ?? "", | 108 | | - "connect-src 'self' http: https: ws: wss:", | | 108 | + "connect-src 'self' blob: http: https: ws: wss:", | 109 | 109 | ); | 110 | 110 | assert.include( | 111 | 111 | response.headers.get("content-security-policy") ?? "", | @@ -255,7 +255,14 @@ describe("ElectronProtocol", () => { | 255 | 255 | "https://clerk.t3.codes", | 256 | 256 | "https://challenges.cloudflare.com", | 257 | 257 | ]); | 258 | | - assert.deepEqual(directives["connect-src"], ["'self'", "http:", "https:", "ws:", "wss:"]); | | 258 | + assert.deepEqual(directives["connect-src"], [ | | 259 | + "'self'", | | 260 | + "blob:", | | 261 | + "http:", | | 262 | + "https:", | | 263 | + "ws:", | | 264 | + "wss:", | | 265 | + ]); | 259 | 266 | assert.deepEqual(directives["img-src"], [ | 260 | 267 | "'self'", | 261 | 268 | "t3code:", | |
Collapse file Copy file name to clipboardExpand all lines: apps/desktop/src/electron/ElectronProtocol.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -84,7 +84,8 @@ export function makeDesktopContentSecurityPolicy(input: DesktopProtocolRegistrat | 84 | 84 | // the build-configured Clerk, relay, and OTLP endpoints. Those environment | 85 | 85 | // origins are not known when this response policy is created, so restrict | 86 | 86 | // connections by the network schemes the client supports instead of by host. | 87 | | - const connectSources = ["'self'", "http:", "https:", "ws:", "wss:"]; | | 87 | + // GLTFLoader fetches embedded textures through blob URLs after parsing the model. | | 88 | + const connectSources = ["'self'", "blob:", "http:", "https:", "ws:", "wss:"]; | 88 | 89 |
| 89 | 90 | return [ | 90 | 91 | "default-src 'self'", | |
|