Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions apps/marketing/src/pages/privacy-policy.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const sections = [
description="How T3 Tools, Inc. handles information when you use T3 Code, app.t3.codes, and t3.codes."
heading="T3 Code Privacy Policy"
lede="This Privacy Policy describes how T3 Tools, Inc. collects, uses, and shares personal information when you use the T3 Code desktop, mobile, and hosted web applications, visit the t3.codes marketing site, or use the optional T3 Connect service."
effectiveDate="2026-10-06"
lastUpdated="2026-10-06"
effectiveDate="2026-10-30"
lastUpdated="2026-10-30"
sections={sections}
>
<section id="introduction">
Expand Down Expand Up @@ -82,9 +82,13 @@ const sections = [
headline.
</li>
<li>
<strong>Product usage data.</strong> By default, T3 Code sends us anonymous usage
<strong>Product usage data.</strong> By default, T3 Code sends us usage
data, such as which provider and model a turn used, whether it succeeded, and your app
version and operating system. We use it to improve the product. You can turn this off
version and operating system. Events carry hashed account and installation identifiers
that can link activity across installations, including identifiers from Codex and
Claude Code login files and linked T3 Connect accounts. These identifiers are pseudonymous, not
anonymous: someone who knows an account ID can calculate the same hash. We use this
data to improve the product. You can turn this off
at any time; see “Product Usage Data” under Your Choices below.
</li>
<li>
Expand Down Expand Up @@ -163,8 +167,8 @@ const sections = [
<li>To monitor reliability, prevent abuse, and investigate security incidents;</li>
<li>To comply with applicable law and enforce the terms governing the Services; and</li>
<li>
To analyze and improve T3 Code using product usage data and aggregated,
de-identified, or other anonymous operational information.
To analyze and improve T3 Code using product usage data and aggregated operational
information.
</li>
</ul>

Expand Down Expand Up @@ -344,9 +348,17 @@ const sections = [

<h3>Product Usage Data</h3>
<p>
To stop sending product usage data, set the environment variable{" "}
<code>T3CODE_TELEMETRY_ENABLED=false</code>{" "}where T3 Code runs, for example in your
shell profile, and restart T3 Code.
You can choose whether to share product analytics during onboarding or in
{" "}<strong>Settings → About → Privacy</strong>. On mobile, use
{" "}<strong>Settings → Maintenance → Privacy</strong>. The choice applies to everyone
using the selected environment. Turning it off stops collection and discards queued
events without restarting. It does not control relay diagnostics, mobile crash reports,
or your own OpenTelemetry exports. You can also set the environment variable
{" "}<code>T3CODE_TELEMETRY_ENABLED=false</code>{" "}where T3 Code runs and restart it;
this overrides the saved product analytics preference.
Changing the saved preference requires permission to change environment settings
and a server version that supports the control. If it is unavailable, ask the
environment administrator to change it or update the server.
</p>

<h3>Cookies and Local Data</h3>
Expand Down
11 changes: 8 additions & 3 deletions apps/mobile/src/components/ui/ListToggleRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import { ThemedSwitch } from "./ThemedSwitch";
export function ListToggleRow(
props: Omit<ListRowContentProps, "detail"> & {
readonly value: boolean | null;
readonly mixedValue?: boolean;
readonly onValueChange: (value: boolean) => void;
},
) {
const mixedValue = props.mixedValue ?? true;
const mixedLabel = mixedValue ? "on" : "off";
return (
<ListRowLayout
icon={props.icon}
Expand All @@ -19,15 +22,17 @@ export function ListToggleRow(
accessory={
props.value === null ? (
<Pressable
accessibilityLabel={`Set ${props.label} on for selected environments`}
accessibilityLabel={`Set ${props.label} ${mixedLabel} for selected environments`}
accessibilityRole="button"
accessibilityHint={props.description}
accessibilityState={{ disabled: Boolean(props.disabled) }}
disabled={props.disabled}
className="rounded-full bg-subtle px-3 py-2 active:opacity-70"
onPress={() => props.onValueChange(true)}
onPress={() => props.onValueChange(mixedValue)}
>
<AppText className="text-sm font-t3-medium text-foreground">Mixed · Set on</AppText>
<AppText className="text-sm font-t3-medium text-foreground">
Mixed · Set {mixedLabel}
</AppText>
</Pressable>
) : (
<ThemedSwitch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,43 @@ vi.mock("./components/SettingsEnvironmentFilterHeader", () => ({
vi.mock("./components/DatabaseStorageNotice", () => ({ DatabaseStorageNotice: () => null }));
vi.mock("./components/SettingsSection", () => ({ SettingsSection: Children }));
vi.mock("../../components/ui/ListChoiceRow", () => ({ ListChoiceRow: () => null }));
vi.mock("./components/SettingsSwitchRow", () => ({
SettingsSwitchRow: ({
vi.mock("../../components/ui/ListRowLayout", () => ({
ListRowLayout: ({
label,
description,
accessory,
}: {
label: string;
description?: string;
accessory?: ReactNode;
}) => (
<div>
{label}
{description}
{accessory}
</div>
),
}));
vi.mock("../../components/ui/ThemedSwitch", () => ({
ThemedSwitch: ({
accessibilityLabel,
value,
disabled,
onValueChange,
}: {
label: string;
value: boolean | null;
accessibilityLabel: string;
value: boolean;
disabled?: boolean;
onValueChange: (value: boolean) => void;
}) => (
<button
role="switch"
aria-checked={value ?? "mixed"}
aria-label={accessibilityLabel}
aria-checked={value}
disabled={disabled}
onClick={() => onValueChange(!value)}
>
{label}
{accessibilityLabel}
</button>
),
}));
Expand Down Expand Up @@ -138,6 +156,7 @@ vi.mock("./settings-environment-filter", () => ({
import {
SettingsThreadsRouteScreen,
SettingsWorktreesRouteScreen,
SettingsEnvironmentMaintenanceRouteScreen,
} from "./SettingsServerControlsRouteScreen";

function environment(environmentId: string, label: string) {
Expand All @@ -152,7 +171,11 @@ function environment(environmentId: string, label: string) {
sidebarAutoSettleOnMerge: false,
},
environment: {
capabilities: { projectSettingsOverrides: true, threadAutoSettlement: true },
capabilities: {
projectSettingsOverrides: true,
threadAutoSettlement: true,
productAnalyticsConsent: true,
},
},
},
};
Expand All @@ -178,6 +201,24 @@ afterEach(() => {
});

describe("SettingsServerControlsRouteScreen", () => {
it("opts out every selected environment directly when analytics values are mixed", async () => {
const remote = environment("remote", "Remote");
remote.serverConfig.settings.telemetryEnabled = false;
mocks.targets = [environment("local", "Local"), remote];
act(() => root.render(<SettingsEnvironmentMaintenanceRouteScreen />));

const optOut = container.querySelector<HTMLButtonElement>(
'button[aria-label="Set Share product analytics off for selected environments"]',
);
expect(optOut).not.toBeNull();
await act(async () => optOut!.click());

expect(mocks.updateSettings.mock.calls.map(([request]) => request)).toEqual([
{ environmentId: "local", input: { patch: { telemetryEnabled: false } } },
{ environmentId: "remote", input: { patch: { telemetryEnabled: false } } },
]);
});

it("sends a draft saved during a pending write once that write settles", async () => {
const pending = Promise.withResolvers<AsyncResult.Success<void>>();
mocks.updateSettings.mockReturnValueOnce(pending.promise);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {
!PROJECT_SCOPED_SERVER_SETTING_KEYS.includes(
key as (typeof PROJECT_SCOPED_SERVER_SETTING_KEYS)[number],
));
const analyticsSupported =
displayTargets.length > 0 &&
displayTargets.every(
(target) =>
target.environment.serverConfig?.environment.capabilities.productAnalyticsConsent === true,
);

return (
<>
Expand Down Expand Up @@ -462,6 +468,26 @@ function ServerSettingsDetail(props: { readonly page: SettingsPage }) {

{props.page === "maintenance" ? (
<>
<SettingsSection
title="Privacy"
footer="This applies to everyone on the selected environments. Turning it off discards queued events. Relay diagnostics, crash reports, and your OpenTelemetry exports are separate. T3CODE_TELEMETRY_ENABLED=false always overrides this switch."
>
<SettingsSwitchRow
icon="chart.bar.xaxis"
label="Share product analytics"
subtitle={
projectSelected
? "Environment-wide setting. Select All projects to change it."
: analyticsSupported
? "Sends usage events and hashed account and installation IDs to T3 Code and PostHog. These are pseudonymous: they can link activity across installations. No prompts or file contents."
: "Update the selected environment servers to control product analytics here. Older servers may collect analytics by default."
}
value={analyticsSupported ? uniform("telemetryEnabled") : null}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
mixedValue={false}
disabled={!analyticsSupported || disabledFor("telemetryEnabled")}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
onValueChange={(value) => write({ telemetryEnabled: value })}
/>
</SettingsSection>
{!projectSelected ? (
<DatabaseStorageNotice
targets={selectedTargets.filter(
Expand Down
4 changes: 3 additions & 1 deletion apps/mobile/src/features/settings/settings-search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const SECTIONS = [
rows: [
{ id: "SettingsProviderAccounts", label: "Provider accounts" },
{ id: "SettingsEnvironmentSourceControl", label: "Source control" },
{ id: "SettingsEnvironmentMaintenance", label: "Maintenance" },
],
},
];
Expand All @@ -48,9 +49,10 @@ describe("filterSettingsSections", () => {
{ query: "KEYBOARD", expected: [["Interface", ["Keyboard"]]] },
{ query: "dark mode", expected: [["Interface", ["Appearance"]]] },
{ query: "agent credits", expected: [["Server settings", ["Source control"]]] },
{ query: "product analytics", expected: [["Server settings", ["Maintenance"]]] },
{
query: "server settings",
expected: [["Server settings", ["Provider accounts", "Source control"]]],
expected: [["Server settings", ["Provider accounts", "Source control", "Maintenance"]]],
},
{
query: "accounts",
Expand Down
13 changes: 12 additions & 1 deletion apps/mobile/src/features/settings/settings-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,18 @@ const SETTINGS_SEARCH_TERMS = {
"start from remote",
],
SettingsLabs: ["legacy", "plan mode", "beta", "linked environments", "link machine"],
SettingsEnvironmentMaintenance: ["updates", "provider updates", "restart", "manage environments"],
SettingsEnvironmentMaintenance: [
"updates",
"provider updates",
"restart",
"manage environments",
"analytics",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
"share product analytics",
"telemetry",
"privacy",
"opt out",
"PostHog",
],
SettingsAbout: [
"version",
"diagnostics",
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/device/DeviceService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ const fixture = Effect.fn("fixture")(function* (
start: Effect.void,
ready: Effect.void,
getSettings: Ref.get(settings),
telemetryOptOutGeneration: Effect.succeed(0),
updateSettings: (patch) =>
Ref.updateAndGet(settings, (current) => ({
...current,
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/environment/ServerEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export const make = Effect.gen(function* () {
requiredWorktreeBootstrap: true,
threadSettlement: true,
threadAutoSettlement: true,
productAnalyticsConsent: true,
storageCleanup: true,
storageCleanupRun: true,
databaseStorage: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ const makeHarness = Effect.fn("makeThreadSettlementHarness")(function* (options:
start: Effect.void,
ready: Effect.void,
getSettings: Ref.get(settings),
telemetryOptOutGeneration: Effect.succeed(0),
updateSettings,
updateProviderInstance: () => Effect.die("Unexpected provider mutation"),
withSettingsSnapshot: (use) => Ref.get(settings).pipe(Effect.flatMap(use)),
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/provider/ProviderRegistry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ function makeMutableServerSettingsService(
return next;
}),
withSettingsSnapshot: (use) => Ref.get(settingsRef).pipe(Effect.flatMap(use)),
telemetryOptOutGeneration: Effect.succeed(0),
get streamChanges() {
return Stream.fromPubSub(changes);
},
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ const layerRuntimeDependencies = layerRuntimeCoreDependencies.pipe(
Layer.provideMerge(layerResourceDiagnostics),
Layer.provideMerge(TraceDiagnostics.layer),
Layer.provideMerge(TriageService.layer.pipe(Layer.provide(GitVcsDriver.layer))),
Layer.provideMerge(AnalyticsService.layer),
Layer.provideMerge(AnalyticsService.layer.pipe(Layer.provide(layerServerSettings))),
Layer.provideMerge(ExternalLauncher.layer),
Layer.provideMerge(RemoteOpenTargets.layer),
Layer.provideMerge(DirectEndpoints.layer),
Expand Down
8 changes: 8 additions & 0 deletions apps/server/src/serverRuntimeStartup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { resolveProjectSettings } from "@t3tools/shared/projectSettings";
import * as Cause from "effect/Cause";
import * as Console from "effect/Console";
import * as Config from "effect/Config";
import * as Context from "effect/Context";
import * as Crypto from "effect/Crypto";
import * as DateTime from "effect/DateTime";
Expand Down Expand Up @@ -147,6 +148,13 @@ export const makeCommandGate = Effect.gen(function* () {
});

const recordStartupHeartbeat = Effect.gen(function* () {
const settings = yield* ServerSettings.ServerSettingsService;
const consent = yield* settings.getSettings.pipe(
Effect.map((snapshot) => snapshot.telemetryEnabled),
Effect.orElseSucceed(() => false),
);
const enabled = yield* Config.Boolean("T3CODE_TELEMETRY_ENABLED").pipe(Config.withDefault(true));
if (!consent || !enabled) return;
const analytics = yield* AnalyticsService.AnalyticsService;
const projects = yield* ProjectService.ProjectService;
const threads = yield* ThreadManagement.ThreadManagementService;
Expand Down
14 changes: 13 additions & 1 deletion apps/server/src/serverSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,16 @@ it.layer(NodeServices.layer)("server settings", (it) => {
assert.deepEqual(settings.providerModelPreferences?.[provider]?.modelOrder, ["luna", "sol"]);
}).pipe(Effect.provide(layerServerSettings())),
);
it.effect("persists and broadcasts model preferences to other connected clients", () =>
it.effect("persists and broadcasts model preferences and analytics consent", () =>
Effect.scoped(
Effect.gen(function* () {
const service = yield* ServerSettingsModule.ServerSettingsService;
const config = yield* ServerConfig.ServerConfig;
const fs = yield* FileSystem.FileSystem;
const provider = ProviderInstanceId.make("codex_work");
assert.isTrue((yield* service.getSettings).telemetryEnabled);
const patch = {
telemetryEnabled: true,
favorites: [{ provider, model: "sol" }],
providerModelPreferences: {
[provider]: { hiddenModels: ["astra"], modelOrder: ["sol"] },
Expand All @@ -145,12 +147,21 @@ it.layer(NodeServices.layer)("server settings", (it) => {
const changes = yield* service.subscribeChanges;
yield* service.updateSettings(patch);
const received = Option.getOrThrow(yield* Stream.runHead(changes));
assert.isTrue(received.telemetryEnabled);
assert.deepEqual(received.favorites, patch.favorites);
assert.deepEqual(received.providerModelPreferences, patch.providerModelPreferences);
const saved = yield* decodeServerSettingsJson(
yield* fs.readFileString(config.settingsPath),
);
assert.deepEqual(saved.favorites, patch.favorites);
assert.isTrue(saved.telemetryEnabled);
const generation = yield* service.telemetryOptOutGeneration;
yield* service.updateSettings({ telemetryEnabled: false });
assert.isAbove(yield* service.telemetryOptOutGeneration, generation);
const optedOut = yield* decodeServerSettingsJson(
yield* fs.readFileString(config.settingsPath),
);
assert.isFalse(optedOut.telemetryEnabled);
assert.deepEqual(saved.providerModelPreferences, patch.providerModelPreferences);
const hidden = yield* service.updateSettings({
setModelsHidden: [{ provider, model: "sol", hidden: true }],
Expand Down Expand Up @@ -1007,6 +1018,7 @@ it.layer(NodeServices.layer)("server settings", (it) => {
});

assert.isFalse(settings.continueThreadsAfterServerUpdate);
assert.isFalse(settings.telemetryEnabled);
assert.equal(yield* fileSystem.readFileString(serverConfig.settingsPath), raw);
}).pipe(Effect.provide(layerServerSettings())),
);
Expand Down
Loading
Loading