Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a445025
fix(codex): Open diff shows every file of a multi-file patch (#40874)
Abhiram-745 Nov 22, 2026
2f19cec
fix(server): ACP startup gives up when the agent never answers the ha…
juliusmarminge Nov 22, 2026
1d02824
fix(server): a branch prefixed with another remote's name publishes u…
Abhiram-745 Nov 22, 2026
f10e1eb
fix(server): list open delegated tasks when task_status or task_cance…
Project516 Nov 22, 2026
2251de4
fix(gitlab): find merge requests opened from a fork (#40894)
Abhiram-745 Nov 22, 2026
2c4310e
fix(web): pasting a chat message with text and a picture keeps both (…
juliusmarminge Nov 22, 2026
344de5f
fix(antigravity): bound silent post-settle background command holds (…
Lokkuchakreshkumar Nov 22, 2026
5ddcc25
fix(desktop): WSL is not offered or started when only the Windows ins…
juliusmarminge Nov 22, 2026
ad44645
fix(server): idle /ws connections behind a reverse proxy no longer dr…
juliusmarminge Nov 22, 2026
cc4bb17
fix(server): thread reads no longer attribute T3 Code's compact-befor…
juliusmarminge Nov 22, 2026
9de4ec1
fix(web,mobile): @-file mentions show by name in message previews, no…
tiliakoos Nov 22, 2026
ec1bd32
fix(web): editing a queued message keeps its attachment chips resolved
smirea-ai Nov 22, 2026
448597f
fix(web): reconcile deleted queued file chips and preserve snapshot s…
smirea-ai Nov 22, 2026
30401dd
fix(web): restore removed queued attachments on undo and same-edit paste
smirea-ai Nov 22, 2026
b712a45
fix(web): remove restored queued images on redo and unit-test paste m…
smirea-ai Nov 22, 2026
eb93331
fix(web): gate queued image redo removal on editor history transactions
smirea-ai Nov 22, 2026
e34e312
fix(web): retain restored queued image history tracking across typing
smirea-ai Nov 22, 2026
27d82b0
fix(web): track queued image paste and row-removal depths in editor h…
smirea-ai Nov 22, 2026
b29eb9c
fix(web): model queued image attachment state per editor history depth
smirea-ai Nov 22, 2026
416c576
fix(web): track queued image history with monotonic ProseMirror revis…
smirea-ai Nov 22, 2026
5f8773d
fix(web): preserve history direction across stale skill chip replacement
smirea-ai Nov 22, 2026
145f1b3
fix(web): scope queued edit restoration and stale skill history direc…
smirea-ai Nov 22, 2026
252f4d8
fix(web): isolate question answer editor undo history from queued edits
smirea-ai Nov 22, 2026
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
42 changes: 41 additions & 1 deletion apps/desktop/src/wsl/DesktopWslEnvironment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,40 @@ describe("parseResolvedPath", () => {

// Path.layer joins with POSIX separators here, so the test windir is a POSIX path.
const WSL_EXE = "/windows/System32/wsl.exe";
const STORE_SERVICE = "HKLM\\SYSTEM\\CurrentControlSet\\Services\\WSLService";
const INBOX_SERVICE = "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LxssManager";

const registrySpawner = (keys: ReadonlyArray<string>) =>
ChildProcessSpawner.make((command) =>
Effect.succeed(
ChildProcessSpawner.makeHandle({
pid: ChildProcessSpawner.ProcessId(1),
stdout: Stream.empty,
stderr: Stream.empty,
all: Stream.empty,
exitCode: Effect.succeed(
ChildProcessSpawner.ExitCode(
command._tag === "StandardCommand" &&
command.command === "reg.exe" &&
keys.some((key) => command.args.includes(key))
? 0
: 1,
),
),
isRunning: Effect.succeed(false),
kill: () => Effect.void,
stdin: Sink.drain,
getInputFd: () => Sink.drain,
getOutputFd: () => Stream.empty,
unref: Effect.succeed(Effect.void),
}),
),
);

const isAvailable = (policy?: Parameters<typeof DesktopManagedPolicy.layerTest>[0]) =>
const isAvailable = (
policy?: Parameters<typeof DesktopManagedPolicy.layerTest>[0],
serviceKeys: ReadonlyArray<string> = [STORE_SERVICE],
) =>
makeIsAvailable("win32", "/windows").pipe(
Effect.provide(
Layer.mergeAll(
Expand All @@ -565,9 +597,17 @@ const isAvailable = (policy?: Parameters<typeof DesktopManagedPolicy.layerTest>[
DesktopManagedPolicy.layerTest(policy),
),
),
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, registrySpawner(serviceKeys)),
);

describe("makeIsAvailable", () => {
it.effect("needs a registered WSL service, not just the System32 install stub", () =>
Effect.gen(function* () {
assert.isFalse(yield* isAvailable(undefined, []));
assert.isTrue(yield* isAvailable(undefined, [INBOX_SERVICE]));
}),
);

it.effect("turns WSL off on a machine with a managed policy, even an invalid one", () =>
Effect.gen(function* () {
assert.isTrue(yield* isAvailable());
Expand Down
42 changes: 41 additions & 1 deletion apps/desktop/src/wsl/DesktopWslEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1119,13 +1119,50 @@ const getUserHomeImpl = (
Effect.orElseSucceed(() => Option.none<string>()),
);

// Store/MSI WSL registers WSLService and inbox WSL registers LxssManager; either key means installed.
const WSL_SERVICE_KEYS = [
"HKLM\\SYSTEM\\CurrentControlSet\\Services\\WSLService",
"HKLM\\SYSTEM\\CurrentControlSet\\Services\\LxssManager",
] as const;
const SERVICE_QUERY_TIMEOUT = Duration.seconds(5);

const wslServiceRegistered = Effect.scoped(
Effect.gen(function* () {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const registered = yield* Effect.forEach(
WSL_SERVICE_KEYS,
(key) =>
spawner
.spawn(
ChildProcess.make("reg.exe", ["query", key], {
stdin: "ignore",
stdout: "ignore",
stderr: "ignore",
killSignal: "SIGTERM",
forceKillAfter: PROCESS_TERMINATE_GRACE,
}),
)
.pipe(Effect.flatMap((handle) => handle.exitCode)),
{ concurrency: "unbounded" },
);
return registered.some((exitCode) => (exitCode as unknown as number) === 0);
}),
).pipe(
Effect.timeoutOption(SERVICE_QUERY_TIMEOUT),
Effect.map(Option.getOrElse(() => false)),
Effect.orElseSucceed(() => false),
);

export const makeIsAvailable = Effect.fn("DesktopWslEnvironment.makeIsAvailable")(function* (
platform: NodeJS.Platform,
windir: string,
): Effect.fn.Return<
boolean,
never,
FileSystem.FileSystem | Path.Path | DesktopManagedPolicy.DesktopManagedPolicy
| FileSystem.FileSystem
| Path.Path
| DesktopManagedPolicy.DesktopManagedPolicy
| ChildProcessSpawner.ChildProcessSpawner
> {
if (platform !== "win32") return false;
const path = yield* Path.Path;
Expand All @@ -1134,6 +1171,8 @@ export const makeIsAvailable = Effect.fn("DesktopWslEnvironment.makeIsAvailable"
if (!(yield* fileSystem.exists(wslExePath).pipe(Effect.orElseSucceed(() => false)))) {
return false;
}
// System32\wsl.exe is also an install stub on Windows without WSL, so check for its service.
if (!(yield* wslServiceRegistered)) return false;
// A server in WSL reads Linux's policy, never this machine's, so a managed machine runs none.
return yield* (yield* DesktopManagedPolicy.DesktopManagedPolicy).read.pipe(
Effect.map((found) => found === undefined),
Expand Down Expand Up @@ -1245,6 +1284,7 @@ export const layer = Layer.effect(
// Cache availability so synchronous IPC bootstrap can read it without yielding to filesystem I/O.
const wslAvailable = yield* makeIsAvailable(environment.platform, windir).pipe(
Effect.provideService(FileSystem.FileSystem, fileSystem),
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
Effect.provideService(Path.Path, environment.path),
Effect.provideService(
DesktopManagedPolicy.DesktopManagedPolicy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
isAttachmentOnlyBootstrapPrompt,
replaceComposerContextReferences,
} from "@t3tools/shared/composerContextReferences";
import { composerFileLinksToPlainText } from "@t3tools/shared/composerInlineTokens";

export const REMOVE_QUEUED_MESSAGE_ACCESSIBILITY_LABEL = msg("Remove queued message");

Expand Down Expand Up @@ -43,7 +44,9 @@ export function resolveThreadQueueRowControls(input: {
displayText: isAttachmentOnlyBootstrapPrompt(input.text)
? ""
: assistantCitationsToPlainText(
replaceComposerContextReferences(input.text, (reference) => reference.label),
composerFileLinksToPlainText(
replaceComposerContextReferences(input.text, (reference) => reference.label),
),
).trim(),
isEditing,
};
Expand Down
7 changes: 6 additions & 1 deletion apps/server/src/cli/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,12 @@ const threadShowCommand = Command.make("show", {
const messages = yield* Effect.forEach(latest, (item) =>
readFullText(tools, threadId, item).pipe(
Effect.map((text) => ({
role: item.type === "user_message" ? "user" : "assistant",
role:
item.type === "assistant_message"
? "assistant"
: item.createdBy === "system"
? "system"
: "user",
runId: item.runId,
text,
})),
Expand Down
129 changes: 129 additions & 0 deletions apps/server/src/mcp/OrchestratorMcpService.activity.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
EnvironmentId,
MessageId,
NodeId,
type OrchestratorMcpThreadReadResult,
type OrchestrationV2ThreadProjection,
Expand Down Expand Up @@ -431,6 +432,134 @@ it("readThread pages cut-off text without splitting an emoji across pages", asyn
}).pipe(Effect.provide(layer), Effect.runPromise);
});

it("readThread does not attribute the /compact T3 Code sends before a stale send to the user", async () => {
const compactRunId = RunId.make("run-mcp-compact-on-return");
const sendRunId = RunId.make("run-mcp-held-send");
const compactMessageId = MessageId.make("message-mcp-compact-on-return");
const sendMessageId = MessageId.make("message-mcp-held-send");
const projection = {
thread: baseThread({
threadId: parentThreadId,
title: "Parent",
instanceId: parentInstanceId,
model: "gpt-5.4",
}),
runs: [
makeRun({ id: compactRunId, ordinal: 1, status: "completed" }),
makeRun({ id: sendRunId, ordinal: 2, status: "completed" }),
],
visibleTurnItems: [],
providerTurns: [],
runtimeRequests: [],
messages: [
{
id: compactMessageId,
threadId: parentThreadId,
runId: compactRunId,
role: "user",
text: "/compact",
attachments: [],
createdBy: "user",
creationSource: "web",
idleCompaction: "onReturn",
},
{
id: sendMessageId,
threadId: parentThreadId,
runId: sendRunId,
role: "user",
text: "use webgpu",
attachments: [],
createdBy: "user",
creationSource: "web",
},
],
contextTransfers: [],
subagents: [],
updatedAt: now,
} as unknown as OrchestrationV2ThreadProjection;
const userRow = (position: number, runId: RunId, messageId: MessageId, text: string) => ({
position,
visibility: "visible",
sourceThreadId: parentThreadId,
sourceItemId: TurnItemId.make(`turn-item-mcp-user-${position}`),
item: {
type: "user_message",
runId,
messageId,
status: "completed",
title: null,
text,
attachments: [],
updatedAt: now,
},
});
const rows = [
userRow(0, compactRunId, compactMessageId, "/compact"),
{
position: 1,
visibility: "visible",
sourceThreadId: parentThreadId,
sourceItemId: TurnItemId.make("turn-item-mcp-compaction"),
item: {
type: "compaction",
runId: compactRunId,
status: "completed",
title: null,
summary: "Context compacted",
updatedAt: now,
},
},
userRow(2, sendRunId, sendMessageId, "use webgpu"),
];

const layer = layerOrchestratorService.pipe(
Layer.provide(
Layer.mergeAll(
Layer.mock(ThreadManagementService.ThreadManagementService)({
getTimelinePage: () =>
Effect.succeed({
items: rows as unknown as OrchestrationV2ThreadProjection["visibleTurnItems"],
totalItems: rows.length,
hasMore: false,
hasEarlier: false,
}),
getThreadRecords: () => Effect.succeed(projection),
getProjectThreadRecords: () => Effect.succeed(projection),
getRunCount: () => Effect.succeed(projection.runs.length),
getThreadShell: () =>
Effect.succeed(projection.thread as unknown as OrchestrationV2ThreadShell),
} satisfies Partial<ThreadManagementService.ThreadManagementService["Service"]>),
ServerSettings.layerTest(),
Layer.mock(ProviderRegistry.ProviderRegistry)({
getProviders: Effect.succeed([]),
} satisfies Partial<ProviderRegistry.ProviderRegistry["Service"]>),
Layer.mock(ProjectService.ProjectService)({}),
Layer.mock(SecretRequests.SecretRequests)({}),
Layer.mock(RemoteDelegation.RemoteDelegation)({}),
Layer.mock(ScheduledTaskService.ScheduledTaskService)({
list: () => Effect.succeed({ tasks: [] }),
} satisfies Partial<ScheduledTaskService.ScheduledTaskService["Service"]>),
Layer.mock(ProviderAdapterRegistry.ProviderAdapterRegistryV2)({
list: () => Effect.succeed([]),
} satisfies Partial<ProviderAdapterRegistry.ProviderAdapterRegistryV2["Service"]>),
NodeCrypto.layer,
),
),
);

await Effect.gen(function* () {
const service = yield* OrchestratorMcpService.OrchestratorMcpService;
for (const view of ["activity", "messages"] as const) {
const result = yield* service.readThread(makeScope(), { threadId: parentThreadId, view });
const fromUser = result.items.filter(
(item) => item.type === "user_message" && item.createdBy === "user",
);
expect(fromUser.map((item) => item.text)).toEqual(["use webgpu"]);
}
}).pipe(Effect.provide(layer), Effect.runPromise);
});

it("readThread returns the newest items that fit the response budget", async () => {
const projection = {
thread: baseThread({
Expand Down
8 changes: 8 additions & 0 deletions apps/server/src/mcp/OrchestratorMcpService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ describe("OrchestratorMcpService", () => {
threadId: parentThreadId,
origin: "app_owned",
childThreadId,
title: "Merge",
driver: "codex",
model: "gpt-5.6-terra",
result: "terminal result",
Expand Down Expand Up @@ -252,6 +253,13 @@ describe("OrchestratorMcpService", () => {
const commandIds = yield* Ref.get(acknowledgementCommandIds);
assert.equal(commandIds.length, 2);
assert.notEqual(commandIds[0], commandIds[1]);

const missing = yield* service
.taskStatus(scope, NodeId.make("node:mcp-ack-missing"))
.pipe(Effect.flip);
assert.equal(missing.code, "task_not_found");
assert.include(missing.message, "No delegated task with id node:mcp-ack-missing");
assert.include(missing.message, `${taskId} (Merge)`);
}).pipe(Effect.provide(layerOrchestratorService.pipe(Layer.provide(layerDependencies))));
}),
);
Expand Down
Loading
Loading