Skip to content

Commit 21cb66a

Browse files
chore: merge upstream T3 Code through 024dba2
The fork's last completed sync ended at 122d3bf; upstream has advanced by 95 commits. Merge the frozen upstream snapshot while preserving the fork's migration receipts, memory and provenance behavior, SSH links, and source-control check identities. Append upstream migrations as fork 129/130, port the old-upgrade JSON guard to 084, and correct the combined SSH revocation, Codex deadline, and pending-context paths. Keep the existing agent-context cap with equivalent PR-tool wording. Implemented with GPT-6 Astra Pro in ChatGPT/Codex, with three parallel workers.
2 parents b7fd440 + 024dba2 commit 21cb66a

347 files changed

Lines changed: 11053 additions & 1904 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.

‎apps/desktop/src/wsl/DesktopWslEnvironment.test.ts‎

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,40 @@ describe("parseResolvedPath", () => {
555555

556556
// Path.layer joins with POSIX separators here, so the test windir is a POSIX path.
557557
const WSL_EXE = "/windows/System32/wsl.exe";
558+
const STORE_SERVICE = "HKLM\\SYSTEM\\CurrentControlSet\\Services\\WSLService";
559+
const INBOX_SERVICE = "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LxssManager";
560+
561+
const registrySpawner = (keys: ReadonlyArray<string>) =>
562+
ChildProcessSpawner.make((command) =>
563+
Effect.succeed(
564+
ChildProcessSpawner.makeHandle({
565+
pid: ChildProcessSpawner.ProcessId(1),
566+
stdout: Stream.empty,
567+
stderr: Stream.empty,
568+
all: Stream.empty,
569+
exitCode: Effect.succeed(
570+
ChildProcessSpawner.ExitCode(
571+
command._tag === "StandardCommand" &&
572+
command.command === "reg.exe" &&
573+
keys.some((key) => command.args.includes(key))
574+
? 0
575+
: 1,
576+
),
577+
),
578+
isRunning: Effect.succeed(false),
579+
kill: () => Effect.void,
580+
stdin: Sink.drain,
581+
getInputFd: () => Sink.drain,
582+
getOutputFd: () => Stream.empty,
583+
unref: Effect.succeed(Effect.void),
584+
}),
585+
),
586+
);
558587

559-
const isAvailable = (policy?: Parameters<typeof DesktopManagedPolicy.layerTest>[0]) =>
588+
const isAvailable = (
589+
policy?: Parameters<typeof DesktopManagedPolicy.layerTest>[0],
590+
serviceKeys: ReadonlyArray<string> = [STORE_SERVICE],
591+
) =>
560592
makeIsAvailable("win32", "/windows").pipe(
561593
Effect.provide(
562594
Layer.mergeAll(
@@ -565,9 +597,17 @@ const isAvailable = (policy?: Parameters<typeof DesktopManagedPolicy.layerTest>[
565597
DesktopManagedPolicy.layerTest(policy),
566598
),
567599
),
600+
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, registrySpawner(serviceKeys)),
568601
);
569602

570603
describe("makeIsAvailable", () => {
604+
it.effect("needs a registered WSL service, not just the System32 install stub", () =>
605+
Effect.gen(function* () {
606+
assert.isFalse(yield* isAvailable(undefined, []));
607+
assert.isTrue(yield* isAvailable(undefined, [INBOX_SERVICE]));
608+
}),
609+
);
610+
571611
it.effect("turns WSL off on a machine with a managed policy, even an invalid one", () =>
572612
Effect.gen(function* () {
573613
assert.isTrue(yield* isAvailable());

‎apps/desktop/src/wsl/DesktopWslEnvironment.ts‎

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,13 +1119,50 @@ const getUserHomeImpl = (
11191119
Effect.orElseSucceed(() => Option.none<string>()),
11201120
);
11211121

1122+
// Store/MSI WSL registers WSLService and inbox WSL registers LxssManager; either key means installed.
1123+
const WSL_SERVICE_KEYS = [
1124+
"HKLM\\SYSTEM\\CurrentControlSet\\Services\\WSLService",
1125+
"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LxssManager",
1126+
] as const;
1127+
const SERVICE_QUERY_TIMEOUT = Duration.seconds(5);
1128+
1129+
const wslServiceRegistered = Effect.scoped(
1130+
Effect.gen(function* () {
1131+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
1132+
const registered = yield* Effect.forEach(
1133+
WSL_SERVICE_KEYS,
1134+
(key) =>
1135+
spawner
1136+
.spawn(
1137+
ChildProcess.make("reg.exe", ["query", key], {
1138+
stdin: "ignore",
1139+
stdout: "ignore",
1140+
stderr: "ignore",
1141+
killSignal: "SIGTERM",
1142+
forceKillAfter: PROCESS_TERMINATE_GRACE,
1143+
}),
1144+
)
1145+
.pipe(Effect.flatMap((handle) => handle.exitCode)),
1146+
{ concurrency: "unbounded" },
1147+
);
1148+
return registered.some((exitCode) => (exitCode as unknown as number) === 0);
1149+
}),
1150+
).pipe(
1151+
Effect.timeoutOption(SERVICE_QUERY_TIMEOUT),
1152+
Effect.map(Option.getOrElse(() => false)),
1153+
Effect.orElseSucceed(() => false),
1154+
);
1155+
11221156
export const makeIsAvailable = Effect.fn("DesktopWslEnvironment.makeIsAvailable")(function* (
11231157
platform: NodeJS.Platform,
11241158
windir: string,
11251159
): Effect.fn.Return<
11261160
boolean,
11271161
never,
1128-
FileSystem.FileSystem | Path.Path | DesktopManagedPolicy.DesktopManagedPolicy
1162+
| FileSystem.FileSystem
1163+
| Path.Path
1164+
| DesktopManagedPolicy.DesktopManagedPolicy
1165+
| ChildProcessSpawner.ChildProcessSpawner
11291166
> {
11301167
if (platform !== "win32") return false;
11311168
const path = yield* Path.Path;
@@ -1134,6 +1171,8 @@ export const makeIsAvailable = Effect.fn("DesktopWslEnvironment.makeIsAvailable"
11341171
if (!(yield* fileSystem.exists(wslExePath).pipe(Effect.orElseSucceed(() => false)))) {
11351172
return false;
11361173
}
1174+
// System32\wsl.exe is also an install stub on Windows without WSL, so check for its service.
1175+
if (!(yield* wslServiceRegistered)) return false;
11371176
// A server in WSL reads Linux's policy, never this machine's, so a managed machine runs none.
11381177
return yield* (yield* DesktopManagedPolicy.DesktopManagedPolicy).read.pipe(
11391178
Effect.map((found) => found === undefined),
@@ -1245,6 +1284,7 @@ export const layer = Layer.effect(
12451284
// Cache availability so synchronous IPC bootstrap can read it without yielding to filesystem I/O.
12461285
const wslAvailable = yield* makeIsAvailable(environment.platform, windir).pipe(
12471286
Effect.provideService(FileSystem.FileSystem, fileSystem),
1287+
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
12481288
Effect.provideService(Path.Path, environment.path),
12491289
Effect.provideService(
12501290
DesktopManagedPolicy.DesktopManagedPolicy,

‎apps/mobile/src/components/ProviderIcon.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ export function ProviderInstanceIcon(props: {
197197
borderRadius: 999,
198198
borderWidth: 1,
199199
...(props.surfaceColor ? { borderColor: props.surfaceColor } : {}),
200-
backgroundColor: accentColor,
200+
// An undefined inline key still overrides the className color when styles merge.
201+
...(accentColor ? { backgroundColor: accentColor } : {}),
201202
alignItems: "center",
202203
justifyContent: "center",
203204
}}
@@ -208,7 +209,7 @@ export function ProviderInstanceIcon(props: {
208209
fontSize: 7,
209210
fontWeight: "600",
210211
lineHeight: 9,
211-
color: accentColor ? providerAccentForegroundColor(accentColor) : undefined,
212+
...(accentColor ? { color: providerAccentForegroundColor(accentColor) } : {}),
212213
}}
213214
>
214215
{providerInstanceInitials(props.displayName)}

‎apps/mobile/src/features/issues/IssueCommentComposer.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ export function IssueCommentComposer(props: {
170170
/>
171171
{/* TalkBack orders siblings by position; outside this row the editor reads after Send. */}
172172
<Animated.View
173-
style={[compactEditor.editorStyle, dictating ? { display: "none" } : undefined]}
173+
style={[
174+
compactEditor.editorStyle,
175+
// iOS destroys a view under display: none; the editor would lose its focus and caret.
176+
Platform.OS === "android" && dictating ? { display: "none" } : undefined,
177+
]}
174178
>
175179
<ComposerEditor
176180
ref={editorRef}

‎apps/mobile/src/features/issues/IssueRouteScreen.tsx‎

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { visibleLinkedThreads } from "@t3tools/client-runtime/state/threads";
77
import type {
88
IssueComment,
99
IssueEvent,
10+
IssueEventReference,
1011
IssueLinkedPullRequest,
1112
IssueReaction,
1213
IssueState,
@@ -404,17 +405,70 @@ function IssueCommentCard(props: {
404405
);
405406
}
406407

407-
function IssueEventRow({ event }: { readonly event: IssueEvent }) {
408+
function IssueEventRow({
409+
params,
410+
event,
411+
}: {
412+
readonly params: IssueParams;
413+
readonly event: IssueEvent;
414+
}) {
408415
const gt = useGT();
409416
const messages = useMessages();
417+
const navigation = useNavigation();
418+
const sentence = issueEventSentence(event, messages);
419+
const source = event.reference;
420+
const at = event.detail === null ? -1 : sentence.indexOf(event.detail);
421+
// Only a git host's tracker shares its host with the change request it links.
422+
const sameHost = sourceControlClients.find(params.tracker) !== undefined;
423+
const openSource = (target: IssueEventReference) => {
424+
const host = params.host ? { host: params.host } : {};
425+
if (target.kind === "issue") {
426+
navigation.dispatch(
427+
StackActions.push("Issue", {
428+
environmentId: params.environmentId,
429+
projectId: params.projectId,
430+
tracker: params.tracker,
431+
...host,
432+
scope: target.repository,
433+
issueKey: String(target.number),
434+
}),
435+
);
436+
} else if (sameHost) {
437+
navigation.dispatch(
438+
StackActions.push("PullRequest", {
439+
environmentId: params.environmentId,
440+
projectId: params.projectId,
441+
repository: target.repository,
442+
number: target.number,
443+
...host,
444+
}),
445+
);
446+
} else {
447+
void tryOpenExternalUrl(target.url);
448+
}
449+
};
410450
return (
411451
<View className="flex-row items-center gap-2 px-1">
412452
<PullRequestAvatar actor={event.actor} size={18} />
413453
<Text className="min-w-0 flex-1 text-xs text-foreground-muted">
414454
<Text className="text-xs font-t3-medium">
415455
{event.actor?.login ?? gt("Someone", { $context: "an unknown person" })}
416456
</Text>{" "}
417-
{issueEventSentence(event, messages)}
457+
{source === undefined || event.detail === null || at < 0 ? (
458+
sentence
459+
) : (
460+
<>
461+
{sentence.slice(0, at)}
462+
<Text
463+
accessibilityRole="link"
464+
className="text-xs font-t3-medium text-primary-text"
465+
onPress={() => openSource(source)}
466+
>
467+
{event.detail}
468+
</Text>
469+
{sentence.slice(at + event.detail.length)}
470+
</>
471+
)}
418472
</Text>
419473
<Text className="text-2xs text-foreground-tertiary">
420474
{relativeTime(event.createdAt, undefined, messages)}
@@ -505,7 +559,7 @@ function IssueRoute({ params }: { readonly params: IssueParams }) {
505559
...detail.events.map((event) => ({
506560
key: `e:${event.id}`,
507561
at: event.createdAt,
508-
content: <IssueEventRow event={event} />,
562+
content: <IssueEventRow params={params} event={event} />,
509563
})),
510564
].sort((left, right) => Date.parse(left.at) - Date.parse(right.at))
511565
: [];

‎apps/mobile/src/features/pull-requests/PullRequestListRow.tsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export const PullRequestListRow = memo(
122122
),
123123
item.title,
124124
status.label,
125+
item.visibility === "private" ? gt("Private") : null,
125126
conflict ? conflict.label.toLowerCase() : null,
126127
gt("by {author}", { author: item.author?.login ?? gt("unknown author") }),
127128
review ? review.accessibleLabel : null,
@@ -178,6 +179,17 @@ export const PullRequestListRow = memo(
178179
<Text className={cn("min-w-0 flex-1 text-xs", mutedForeground)} numberOfLines={1}>
179180
{item.repository} <Text className={tertiaryForeground}>#{item.number}</Text>
180181
</Text>
182+
{item.visibility === "private" ? (
183+
<View>
184+
<SymbolView
185+
name={PullRequestGlyph.private}
186+
size={11}
187+
tintColorClassName={
188+
props.sidebar ? "accent-drawer-foreground-muted" : "accent-foreground-muted"
189+
}
190+
/>
191+
</View>
192+
) : null}
181193
{item.stack ? (
182194
<View className="flex-row items-center gap-1">
183195
<SymbolView

‎apps/mobile/src/features/pull-requests/PullRequestRouteScreen.tsx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ import { useAndroidWorkspaceBack } from "../layout/workspace/useAndroidWorkspace
8686
import { EmptyState } from "../../components/ui/EmptyState";
8787
import { SegmentedControl } from "../../components/ui/SegmentedControl";
8888
import { SymbolView } from "../../components/ui/AppSymbol";
89+
import { PullRequestGlyph } from "./pullRequestGlyphs";
8990
import { ScreenContent } from "../../components/ui/ScreenContent";
9091
import { RelativeTime } from "../../components/RelativeTime";
9192
import { usePullRequestConnected } from "./usePullRequestConnected";
@@ -228,6 +229,16 @@ function PullRequestIdentity(props: {
228229
<Text className={`text-xs font-t3-medium ${status.text}`}>{status.label}</Text>
229230
</View>
230231
)}
232+
{"visibility" in pr && pr.visibility === "private" ? (
233+
<View className="flex-row items-center gap-1">
234+
<SymbolView
235+
name={PullRequestGlyph.private}
236+
size={12}
237+
tintColorClassName="accent-icon-muted"
238+
/>
239+
<Text className="text-xs font-t3-medium text-foreground-muted">{gt("Private")}</Text>
240+
</View>
241+
) : null}
231242
<PullRequestDiffStats additions={pr.additions ?? 0} deletions={pr.deletions ?? 0} compact />
232243
{"changedFiles" in pr && pr.changedFiles !== undefined ? (
233244
<Text className="text-2xs text-foreground-muted">

‎apps/mobile/src/features/pull-requests/pullRequestGlyphs.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export const PullRequestGlyph = {
77
merged: "arrow.triangle.merge",
88
stack: "square.3.layers.3d",
99
conflicting: "exclamationmark.triangle",
10+
private: { ios: "lock.fill", android: "lock" },
1011
} as const satisfies Record<string, AppSymbolName>;

‎apps/mobile/src/features/pull-requests/pullRequestList.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ export function pullRequestListRowsAreEqual(
190190
previous.title === next.title &&
191191
previous.url === next.url &&
192192
previous.state === next.state &&
193+
previous.visibility === next.visibility &&
193194
previous.isDraft === next.isDraft &&
194195
previous.mergeability === next.mergeability &&
195196
previous.baseBranch === next.baseBranch &&

0 commit comments

Comments
 (0)