Skip to content
This repository was archived by the owner on Oct 21, 2026. It is now read-only.

Commit cd084e4

Browse files
committed
Merge upstream/main into main
2 parents 7b1eabe + b91e466 commit cd084e4

113 files changed

Lines changed: 3300 additions & 3756 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.

‎.agents/skills/test-t3-mobile/SKILL.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Start `vp run dev:client` from `apps/mobile`, or reuse a healthy Metro belonging
4141
to this checkout. Open its printed development-client URL with AgentDevice
4242
`open com.t3tools.t3code.dev <url>` and all returned target arguments.
4343
The device must be able to reach both Metro and the isolated backend.
44+
Append `&disableAutoLaunch=1&disableFab=1` to the development-client URL query
45+
when developer chrome would obscure screenshots or taps; the SDK 58 dev client
46+
applies these preferences before the app loads.
4447

4548
## Pair and verify
4649

177 KB
Loading

‎apps/marketing/src/layouts/Layout.astro‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import { getImage, Image } from "astro:assets";
33
import appIcon from "../assets/icon.webp";
4-
import desktopScreenshot from "../assets/app-desktop.webp";
4+
import socialCard from "../assets/social-card.webp";
55
import dmSansLatinUrl from "../assets/fonts/dm-sans-latin.woff2?url";
66
import "../styles/fonts.css";
77
import {
@@ -23,19 +23,19 @@ const {
2323
pageClass,
2424
} = Astro.props;
2525
26-
// Social preview card. Link unfurlers (Instagram, iMessage, X, Slack) want a
27-
// 1200x630 jpg or png at an absolute URL. Built from the hero screenshot so it
28-
// stays in sync with the homepage.
26+
// Social preview card, shared by og:image and twitter:image. Link unfurlers
27+
// (Instagram, iMessage, X, Slack) want a 1200x630 jpg or png at an absolute URL.
28+
// The source is a 2x export so the downscale stays sharp.
2929
const socialImage = await getImage({
30-
src: desktopScreenshot,
30+
src: socialCard,
3131
width: 1200,
3232
height: 630,
33-
fit: "cover",
34-
position: "top",
3533
format: "jpg",
3634
quality: 90,
3735
});
3836
const socialImageUrl = new URL(socialImage.src, Astro.site);
37+
const socialImageAlt =
38+
"T3 Code: the open-source control plane for coding agents, with Claude Code, Codex, Cursor, OpenCode, Grok and Antigravity.";
3939
const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
4040
---
4141

@@ -53,12 +53,13 @@ const canonicalUrl = new URL(Astro.url.pathname, Astro.site);
5353
<meta property="og:image" content={socialImageUrl} />
5454
<meta property="og:image:width" content="1200" />
5555
<meta property="og:image:height" content="630" />
56-
<meta property="og:image:alt" content="The T3 Code desktop app with a thread open." />
56+
<meta property="og:image:alt" content={socialImageAlt} />
5757
<meta name="twitter:card" content="summary_large_image" />
5858
<meta name="twitter:site" content="@t3dotgg" />
5959
<meta name="twitter:title" content={title} />
6060
<meta name="twitter:description" content={description} />
6161
<meta name="twitter:image" content={socialImageUrl} />
62+
<meta name="twitter:image:alt" content={socialImageAlt} />
6263
<link
6364
rel="preload"
6465
href={dmSansLatinUrl}

‎apps/mobile/app.config.ts‎

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -129,51 +129,66 @@ const widgetsPlugin: NonNullable<ExpoConfig["plugins"]>[number] = [
129129
// Agent activity can update many times an hour; without the
130130
// frequent-updates entitlement iOS throttles the update budget sooner.
131131
frequentUpdates: true,
132+
enableAndroid: true,
132133
widgets: [
133134
{
134135
name: "SubscriptionUsage",
135136
displayName: "Subscription usage",
136137
description: "Subscription quotas from your connected T3 Code environments.",
137-
configuration: {
138-
title: "Subscription usage",
139-
description:
140-
"Both shows Session and Weekly when available. The Lock Screen shows the tightest selected limit.",
141-
parameters: {
142-
codexPeriod: {
143-
title: "Codex limits",
144-
type: "enum",
145-
default: "auto",
146-
values: [
147-
{ name: "Both", value: "auto" },
148-
{ name: "Session", value: "session" },
149-
{ name: "Weekly", value: "weekly" },
150-
],
151-
},
152-
claudePeriod: {
153-
title: "Claude limits",
154-
type: "enum",
155-
default: "auto",
156-
values: [
157-
{ name: "Both", value: "auto" },
158-
{ name: "Session", value: "session" },
159-
{ name: "Weekly", value: "weekly" },
160-
],
138+
ios: {
139+
configuration: {
140+
title: "Subscription usage",
141+
description:
142+
"Both shows Session and Weekly when available. The Lock Screen shows the tightest selected limit.",
143+
parameters: {
144+
codexPeriod: {
145+
title: "Codex limits",
146+
type: "enum",
147+
default: "auto",
148+
values: [
149+
{ name: "Both", value: "auto" },
150+
{ name: "Session", value: "session" },
151+
{ name: "Weekly", value: "weekly" },
152+
],
153+
},
154+
claudePeriod: {
155+
title: "Claude limits",
156+
type: "enum",
157+
default: "auto",
158+
values: [
159+
{ name: "Both", value: "auto" },
160+
{ name: "Session", value: "session" },
161+
{ name: "Weekly", value: "weekly" },
162+
],
163+
},
161164
},
162165
},
166+
supportedFamilies: [
167+
"systemSmall",
168+
"systemMedium",
169+
"systemLarge",
170+
"systemExtraLarge",
171+
"accessoryRectangular",
172+
],
173+
},
174+
android: {
175+
minWidth: 250,
176+
minHeight: 180,
177+
targetCellWidth: 4,
178+
targetCellHeight: 3,
179+
resizeMode: "both",
180+
// Embeds the layout in the APK so the widget renders before the app
181+
// has run once; the app replaces it with stored props on publish.
182+
initialLayout: "./src/widgets/SubscriptionUsage.android.tsx",
163183
},
164-
supportedFamilies: [
165-
"systemSmall",
166-
"systemMedium",
167-
"systemLarge",
168-
"systemExtraLarge",
169-
"accessoryRectangular",
170-
],
171184
},
172185
{
173186
name: "AgentActivity",
174187
displayName: "Agent Activity",
175188
description: "Shows the current state of active T3 Code agents.",
176-
supportedFamilies: ["systemSmall", "systemMedium", "accessoryRectangular"],
189+
// Live Activity companion; there is no Android presentation for it.
190+
android: null,
191+
ios: { supportedFamilies: ["systemSmall", "systemMedium", "accessoryRectangular"] },
177192
},
178193
],
179194
},
@@ -401,6 +416,9 @@ const config: ExpoConfig = {
401416
android: {
402417
// Keep the supported floor explicit and covered by native notification tests.
403418
minSdkVersion: 24,
419+
// kotlinx-io uses Kotlin 2.3's return-value checker annotation, while
420+
// SDK 58 builds with Kotlin 2.2. It has no runtime behavior.
421+
extraProguardRules: "-dontwarn kotlin.MustUseReturnValues",
404422
},
405423
ios: {
406424
deploymentTarget: "18.0",
@@ -419,7 +437,6 @@ const config: ExpoConfig = {
419437
// would delete the asset catalog) and its xcodeproj mod creates the widget
420438
// target (which must exist before the compile phase can be attached).
421439
...(!isIosPersonalTeamBuild ? ["./plugins/withWidgetLogoAsset.cjs", widgetsPlugin] : []),
422-
"./plugins/withIosSceneLifecycle.cjs",
423440
"./plugins/withAndroidCleartextTraffic.cjs",
424441
"./plugins/withAndroidGradleHeap.cjs",
425442
"./plugins/withAndroidInputBackground.cjs",

‎apps/mobile/modules/t3-agent-notifications/android/src/main/java/expo/modules/t3agentnotifications/AgentNotifications.kt‎

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,20 @@ object AgentNotifications {
8484
cancelActivity(context)
8585
context.getSharedPreferences(STORE, Context.MODE_PRIVATE).edit().clear().apply()
8686
val manager = manager(context)
87-
manager.activeNotifications.filter { it.tag == ACTIVITY_TAG || it.tag == ALERT_TAG }
87+
manager.activeNotifications.filter {
88+
it.tag == ACTIVITY_TAG || it.tag == ALERT_TAG ||
89+
it.tag?.startsWith("$ALERT_TAG-summary:") == true
90+
}
8891
.forEach { manager.cancel(it.tag, it.id) }
8992
}
9093

94+
/** Records the thread route the app is showing, or null when none is open. */
95+
@Volatile private var threadOnScreen: String? = null
96+
97+
fun setThreadOnScreen(path: String?) {
98+
threadOnScreen = path
99+
}
100+
91101
@Synchronized
92102
fun dismiss(context: Context) {
93103
context.getSharedPreferences(
@@ -135,9 +145,13 @@ object AgentNotifications {
135145
val seen = prefs.getString("seenAlertsOrdered", null)?.split('\n')
136146
?: prefs.getStringSet("seenAlerts", emptySet()).orEmpty().toList()
137147
if (alertId != null && alertId !in seen) {
138-
// Match iOS foreground presentation. Consume suppressed alerts as well,
139-
// so a delivery retry cannot surface them after the app backgrounds.
140-
if (!ProcessLifecycleOwner.get().lifecycle.currentState.isAtLeast(Lifecycle.State.RESUMED)) {
148+
// Consume suppressed alerts so retries cannot resurface them later.
149+
val resumed = ProcessLifecycleOwner.get().lifecycle.currentState.isAtLeast(
150+
Lifecycle.State.RESUMED
151+
)
152+
val visibleThread = threadOnScreen
153+
val onScreen = resumed && visibleThread != null && data["alert_path"] == visibleThread
154+
if (!onScreen) {
141155
postAlert(context, scheme, data, alertId)
142156
}
143157
prefs.edit().remove("seenAlerts").putString(
@@ -157,13 +171,35 @@ object AgentNotifications {
157171
// Grouped alerts list up to five 120-character thread titles.
158172
val body = data["alert_body"].orEmpty().take(608)
159173
val id = alertId.hashCode()
174+
val group = data["alert_group"]?.takeIf { it.isNotBlank() } ?: ALERT_TAG
160175
val notification = base(context, ALERT_CHANNEL)
161176
.setContentTitle(title).setContentText(body)
162177
.setStyle(NotificationCompat.BigTextStyle().bigText(body))
163178
.setAutoCancel(true)
179+
.setGroup(group)
164180
.setContentIntent(contentIntent(context, scheme, data["alert_path"], id))
165181
.build()
166182
manager(context).notify(ALERT_TAG, id, notification)
183+
val children = manager(context).activeNotifications.filter {
184+
it.tag == ALERT_TAG && it.notification.group == group
185+
}
186+
if (children.size > 1) {
187+
val style = NotificationCompat.InboxStyle()
188+
children.forEach {
189+
style.addLine(it.notification.extras.getCharSequence(android.app.Notification.EXTRA_TEXT))
190+
}
191+
val summary = base(context, ALERT_CHANNEL)
192+
.setContentTitle(title)
193+
.setContentText(body)
194+
.setStyle(style)
195+
.setGroup(group)
196+
.setGroupSummary(true)
197+
.setSilent(true)
198+
.setAutoCancel(true)
199+
.setContentIntent(contentIntent(context, scheme, data["alert_path"], 0))
200+
.build()
201+
manager(context).notify("$ALERT_TAG-summary:$group", 0, summary)
202+
}
167203
}
168204

169205
/**

‎apps/mobile/modules/t3-agent-notifications/android/src/main/java/expo/modules/t3agentnotifications/T3AgentNotificationsModule.kt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class T3AgentNotificationsModule : Module() {
3030
appContext.reactContext?.let { AgentNotifications.showcase(it, scheme, data) }
3131
}
3232

33+
Function("setThreadOnScreen") { path: String? ->
34+
AgentNotifications.setThreadOnScreen(path)
35+
}
36+
3337
Function("openLiveUpdateSettings") {
3438
val context = appContext.reactContext
3539
if (context == null || Build.VERSION.SDK_INT < 36) {

‎apps/mobile/modules/t3-agent-notifications/android/src/test/java/expo/modules/t3agentnotifications/AgentNotificationsTest.kt‎

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ class AgentNotificationsTest {
4949
)
5050
AgentNotifications.clear(context)
5151
AgentNotifications.configure(context, "device", "user", "t3code-dev", true)
52+
// The fixtures alert for this thread; a resumed app is showing it.
53+
AgentNotifications.setThreadOnScreen("/threads/environment/thread")
5254
}
5355

5456
private fun update(alertId: String, active: Boolean) = mapOf(
@@ -60,6 +62,7 @@ class AgentNotificationsTest {
6062
"activity_body" to "Test thread · Working",
6163
"activity_path" to "/threads/environment/thread",
6264
"alert_id" to alertId,
65+
"alert_group" to "environment/thread",
6366
"alert_title" to "Test thread",
6467
"alert_body" to "Done: Test project",
6568
"alert_path" to "/threads/environment/thread",
@@ -76,6 +79,12 @@ class AgentNotificationsTest {
7679
assertEquals("alert-0".hashCode(), manager.activeNotifications.single().id)
7780
}
7881

82+
@Test
83+
fun alertsStackByThreadGroup() {
84+
AgentNotifications.receive(context, update("grouped", false))
85+
assertEquals("environment/thread", manager.activeNotifications.single().notification.group)
86+
}
87+
7988
@Test
8089
fun missingLauncherDoesNotDiscardTheAlert() {
8190
shadowOf(context.packageManager).removeActivity(ComponentName(context, Activity::class.java))
@@ -86,6 +95,14 @@ class AgentNotificationsTest {
8695
)
8796
}
8897

98+
@Test
99+
fun foregroundAlertsForThreadsThatAreNotOnScreen() {
100+
lifecycle.currentState = Lifecycle.State.RESUMED
101+
AgentNotifications.setThreadOnScreen("/threads/environment/other")
102+
AgentNotifications.receive(context, update("elsewhere", false))
103+
assertEquals("t3-agent-alert", manager.activeNotifications.single().tag)
104+
}
105+
89106
@Test
90107
fun foregroundSuppressesAlertsWhileOngoingActivityStillUpdatesAndClears() {
91108
lifecycle.currentState = Lifecycle.State.RESUMED
@@ -142,6 +159,22 @@ class AgentNotificationsTest {
142159
assertEquals("background-completion".hashCode(), manager.activeNotifications.single().id)
143160
}
144161

162+
@Test
163+
fun repeatedThreadAlertsHaveOneSilentSummaryAndClearTogether() {
164+
AgentNotifications.receive(context, update("first", false) + ("alert_group" to "thread-group"))
165+
AgentNotifications.receive(context, update("second", false) + ("alert_group" to "thread-group"))
166+
167+
val summary = manager.activeNotifications.single {
168+
it.notification.flags and Notification.FLAG_GROUP_SUMMARY != 0
169+
}
170+
assertEquals("thread-group", summary.notification.group)
171+
assertEquals(3, manager.activeNotifications.size)
172+
assertEquals(null, summary.notification.sound)
173+
174+
AgentNotifications.clear(context)
175+
assertTrue(manager.activeNotifications.isEmpty())
176+
}
177+
145178
@Test
146179
fun groupedAlertDisplaysEveryThreadAndRetriesStaySilent() {
147180
val titles = (1..5).map { "Thread $it " + "x".repeat(111) }.joinToString(", ")
@@ -164,18 +197,21 @@ class AgentNotificationsTest {
164197
}
165198

166199
@Test
167-
fun foregroundSuppressedGroupCannotAppearOnBackgroundRetry() {
200+
fun foregroundGroupForOtherThreadsAlertsOnceAcrossBackgroundRetry() {
168201
val grouped = update("group-attention", true) + mapOf(
169202
"alert_title" to "2 agents need attention",
170203
"alert_body" to "First thread, Second thread",
171204
"alert_path" to "/",
172205
)
173206
lifecycle.currentState = Lifecycle.State.RESUMED
174207
AgentNotifications.receive(context, grouped)
208+
assertEquals(1, manager.activeNotifications.count { it.tag == "t3-agent-alert" })
175209
lifecycle.currentState = Lifecycle.State.CREATED
176210
AgentNotifications.receive(context, grouped)
177211

178-
assertEquals("t3-agent-activity", manager.activeNotifications.single().tag)
212+
assertEquals(2, manager.activeNotifications.size)
213+
assertEquals(1, manager.activeNotifications.count { it.tag == "t3-agent-activity" })
214+
assertEquals(1, manager.activeNotifications.count { it.tag == "t3-agent-alert" })
179215
}
180216

181217
@Test
@@ -286,11 +322,11 @@ class AgentNotificationsTest {
286322
context,
287323
update("older-alert", false) + ("updated_at" to (now - 1000).toString())
288324
)
289-
assertEquals(3, manager.activeNotifications.size)
325+
assertEquals(4, manager.activeNotifications.size)
290326
assertEquals(1, manager.activeNotifications.count { it.tag == "t3-agent-activity" })
291327
shadowOf(manager).setNotificationsEnabled(false)
292328
AgentNotifications.receive(context, update("revoked-permission", true))
293-
assertEquals(3, manager.activeNotifications.size)
329+
assertEquals(4, manager.activeNotifications.size)
294330
}
295331

296332
@Test
@@ -503,7 +539,8 @@ class AgentNotificationsTest {
503539
AgentNotifications.expire(context, expiresAt + 60_000)
504540
assertEquals(1, manager.activeNotifications.count { it.tag == "t3-agent-activity" })
505541
AgentNotifications.expire(context, expiresAt + 2 * 60 * 60 * 1000L)
506-
assertTrue(manager.activeNotifications.all { it.tag == "t3-agent-alert" })
542+
assertEquals(2, manager.activeNotifications.count { it.tag == "t3-agent-alert" })
543+
assertTrue(manager.activeNotifications.none { it.tag == "t3-agent-activity" })
507544
assertTrue(alarms.scheduledAlarms.isEmpty())
508545
}
509546

0 commit comments

Comments
 (0)