GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): restore fork features lost in the #415 upstream sync (#458) · adampeterhiggins/t3code@5843b00

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps
    • server/src
      • mcp/toolkits
        • core.test.ts
      • orchestration-v2
        • Adapters
          • ClaudeAdapterV2.test.ts
        • ProviderTurnStartService.test.ts
      • project
        • AgentSessionScanner.test.ts
    • web/src/components
      • ChatMarkdown.permissions.browser.test.tsx
      • ChatMarkdown.tsx
      • CommandPalette.tsx
      • CommandPaletteThreadItems.tsx
      • Sidebar.tsx
      • chat
        • ChatComposer.tsx
        • ComposerAttachmentStrip.tsx
        • MarkdownFileLink.tsx
        • MessagesTimeline.browser.test.tsx
        • MessagesTimeline.tsx
        • TimelineToolActivityIcon.tsx
        • TimelineUserMessageRow.tsx
        • TimelineWorkEntryRow.tsx
        • TimelineWorkGroupRows.tsx
        • timelineRowContext.ts
        • useTimelinePositionRestore.ts
      • pullRequest
        • PullRequestActionsMenu.tsx
        • PullRequestDetailCrumbs.tsx
        • PullRequestDetailPanel.tsx
        • PullRequestsColumn.tsx
        • PullRequestsPage.tsx
        • ThreadPullRequestsPanel.tsx
  • packages
    • client-runtime/src
      • t3ToolSummary.test.ts
      • t3ToolSummary.ts
    • shared/src
      • t3McpToolPresentation.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/mcp/toolkits/core.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/mcp/toolkits/core.test.ts
+38Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,21 @@ import * as McpToolAccessTestkit from "../McpToolAccess.testkit.ts";
5858
import { dispatchFailure } from "../threadAccess.ts";
5959
import * as EnvironmentHandlers from "./environment/handlers.ts";
6060
import * as AttachmentHandlers from "./attachment/handlers.ts";
61+
import { ApprovalToolkit } from "./approval/tools.ts";
62+
import { AttachmentToolkit } from "./attachment/tools.ts";
63+
import { DeviceToolkit } from "./device/tools.ts";
64+
import { EnvironmentToolkit } from "./environment/tools.ts";
65+
import { HtmlToolkit } from "./html/tools.ts";
66+
import { IssueLinksToolkit } from "./issueLinks/tools.ts";
67+
import { MessageDraftsToolkit } from "./messageDrafts/tools.ts";
68+
import { OrchestratorToolkit } from "./orchestrator/tools.ts";
69+
import { PreviewToolkit } from "./preview/tools.ts";
70+
import { PreviewControlsToolkit } from "./previewControls/tools.ts";
71+
import { ProjectToolkit } from "./project/tools.ts";
72+
import { PullRequestsToolkit } from "./pullRequests/tools.ts";
73+
import { ThreadToolkit } from "./thread/tools.ts";
74+
import { ThreadDeleteToolkit } from "./threadDelete/tools.ts";
75+
import { WorktreeToolkit } from "./worktree/tools.ts";
6176

6277
const layerOrchestratorToolkit = McpHttpServer.layerOrchestratorToolkit.pipe(
6378
Layer.provide(Layer.mock(ThreadLaunchService.ThreadLaunchService)({})),
@@ -95,6 +110,29 @@ const layerThreadToolkitWith = (
95110
);
96111
const layerThreadToolkit = layerThreadToolkitWith(layerThreadMoveServices);
97112

113+
// All toolkits share one MCP server, so a duplicate name silently shadows a tool.
114+
it("publishes unique tool names across every toolkit", () => {
115+
const names = [
116+
ApprovalToolkit,
117+
AttachmentToolkit,
118+
DeviceToolkit,
119+
EnvironmentToolkit,
120+
HtmlToolkit,
121+
IssueLinksToolkit,
122+
MessageDraftsToolkit,
123+
OrchestratorToolkit,
124+
PreviewToolkit,
125+
PreviewControlsToolkit,
126+
ProjectToolkit,
127+
PullRequestsToolkit,
128+
ThreadToolkit,
129+
ThreadDeleteToolkit,
130+
WorktreeToolkit,
131+
].flatMap((toolkit) => Object.values(toolkit.tools).map((tool) => tool.name));
132+
expect(names.filter((name, index) => names.indexOf(name) !== index)).toEqual([]);
133+
expect(names).toEqual(expect.arrayContaining(["link_linear_issue", "t3_draft_create"]));
134+
});
135+
98136
const threadId = ThreadId.make("mcp-core-thread");
99137
const scope: McpInvocationContext.McpInvocationScope = {
100138
environmentId: EnvironmentId.make("mcp-core-environment"),
Collapse file

‎apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+51Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4224,6 +4224,57 @@ describe("ClaudeAdapterV2 background wake turns", () => {
42244224
),
42254225
);
42264226

4227+
it.effect("keeps usage warnings and provisioned overage silent", () =>
4228+
Effect.gen(function* () {
4229+
const harness = yield* makeWakeHarness;
4230+
const now = yield* DateTime.now;
4231+
yield* harness.runtime.startTurn(
4232+
makeClaudeTestTurnInput({
4233+
threadId: harness.threadId,
4234+
providerThread: harness.providerThread,
4235+
now,
4236+
attemptId: RunAttemptId.make("attempt-claude-overage"),
4237+
text: "Continue.",
4238+
attachments: [],
4239+
}),
4240+
);
4241+
for (const rate_limit_info of [
4242+
{ status: "allowed_warning" },
4243+
{ status: "rejected", overageStatus: "allowed" },
4244+
{ status: "rejected", overageStatus: "allowed_warning" },
4245+
{ status: "rejected", isUsingOverage: true },
4246+
{ status: "rejected", overageInUse: true },
4247+
]) {
4248+
yield* Queue.offer(
4249+
harness.sdkMessages,
4250+
claudeSdkFrame({
4251+
type: "rate_limit_event",
4252+
rate_limit_info,
4253+
session_id: WAKE_NATIVE_SESSION,
4254+
uuid: "00000000-0000-4000-8000-000000000604",
4255+
}),
4256+
);
4257+
}
4258+
yield* Queue.offer(
4259+
harness.sdkMessages,
4260+
makeResultFrame({
4261+
uuid: "00000000-0000-4000-8000-000000000605",
4262+
result: "Done.",
4263+
}),
4264+
);
4265+
yield* Queue.take(harness.terminalReceipts);
4266+
assert.isFalse(
4267+
harness.events.some(
4268+
(event) => event.type === "turn_item.updated" && event.turnItem.type === "system_notice",
4269+
),
4270+
);
4271+
}).pipe(
4272+
Effect.provide(
4273+
Layer.mergeAll(IdAllocator.layer, McpProviderSessions.layer, NodeServices.layer),
4274+
),
4275+
),
4276+
);
4277+
42274278
it.effect("keeps a later future-window event-supplied Claude reset over the embedded reset", () =>
42284279
Effect.gen(function* () {
42294280
const harness = yield* makeWakeHarness;
Collapse file

‎apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,31 @@ effectIt.effect("does not mistake a failed state read for a superseded run", ()
10281028
}),
10291029
);
10301030

1031+
effectIt.effect("resumes an imported native session on its first T3 turn", () =>
1032+
Effect.gen(function* () {
1033+
const firstTurnFor = (marked: boolean) =>
1034+
Effect.gen(function* () {
1035+
const harness = makeLocalCommandHarness({
1036+
text: "Continue",
1037+
existingClaudeSession: { marked },
1038+
});
1039+
yield* harness.start;
1040+
expect(harness.startRootRun).toHaveBeenCalledOnce();
1041+
return harness.startRootRun.mock.calls[0]![0];
1042+
});
1043+
1044+
// Claude creates the session on a first turn without prior native turns,
1045+
// which the CLI rejects for an imported session id that already exists.
1046+
const imported = yield* firstTurnFor(true);
1047+
expect(imported.providerTurnOrdinal).toBe(1);
1048+
expect(imported.nativeThreadHasTurns).toBe(true);
1049+
1050+
const unmarked = yield* firstTurnFor(false);
1051+
expect(unmarked.providerTurnOrdinal).toBe(1);
1052+
expect(unmarked.nativeThreadHasTurns).toBe(false);
1053+
}),
1054+
);
1055+
10311056
effectIt.effect(
10321057
"signs out the existing native provider before opening the newly selected provider",
10331058
() =>
Collapse file

‎apps/server/src/project/AgentSessionScanner.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/project/AgentSessionScanner.test.ts
+49Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,55 @@ it.layer(NodeServices.layer)("AgentSessionScanner", (it) => {
11561156
}),
11571157
);
11581158

1159+
it.effect("imports sessions started in a subfolder unless a nested project owns it", () =>
1160+
Effect.gen(function* () {
1161+
const fileSystem = yield* FileSystem.FileSystem;
1162+
const path = yield* Path.Path;
1163+
const nowMs = Date.parse("2026-08-24T12:00:00.000Z");
1164+
yield* TestClock.setTime(nowMs);
1165+
const claudeHomePath = yield* makeTempDir("t3code-claude-home-");
1166+
const codexHomePath = yield* makeTempDir("t3code-codex-home-");
1167+
const workspace = yield* makeTempDir("t3code-workspace-");
1168+
const subfolder = path.join(workspace, "functions", "billing");
1169+
const nestedProject = path.join(workspace, "nested");
1170+
yield* fileSystem.makeDirectory(subfolder, { recursive: true });
1171+
yield* fileSystem.makeDirectory(path.join(nestedProject, "src"), { recursive: true });
1172+
1173+
const writeSession = (cwd: string, sessionId: string, ageMs: number) =>
1174+
writeTranscript({
1175+
filePath: path.join(claudeHomePath, "projects", `-${sessionId}`, `${sessionId}.jsonl`),
1176+
contents: `${JSON.stringify({
1177+
type: "user",
1178+
cwd,
1179+
sessionId,
1180+
timestamp: "2026-08-23T12:00:00.000Z",
1181+
message: { role: "user", content: "Fix the project" },
1182+
})}\n`,
1183+
mtimeMs: nowMs - ageMs,
1184+
});
1185+
yield* writeSession(workspace, "at-root", 1_000);
1186+
yield* writeSession(subfolder, "in-subfolder", 2_000);
1187+
yield* writeSession(path.join(subfolder, "deleted"), "in-deleted-folder", 3_000);
1188+
yield* writeSession(path.join(nestedProject, "src"), "in-nested-project", 4_000);
1189+
yield* writeSession(path.dirname(workspace), "above-root", 5_000);
1190+
1191+
const sessionIds = (workspaceRoot: string) =>
1192+
runRecentThreads({
1193+
claudeHomePath,
1194+
codexHomePath,
1195+
workspaceRoot,
1196+
importedWorkspaceRoots: [workspace, nestedProject],
1197+
}).pipe(Effect.map((threads) => threads.map((thread) => thread.providerSessionId)));
1198+
1199+
expect(yield* sessionIds(workspace)).toEqual([
1200+
"at-root",
1201+
"in-subfolder",
1202+
"in-deleted-folder",
1203+
]);
1204+
expect(yield* sessionIds(nestedProject)).toEqual(["in-nested-project"]);
1205+
}),
1206+
);
1207+
11591208
it.effect("keeps the provider instance that owns a custom session home", () =>
11601209
Effect.gen(function* () {
11611210
const path = yield* Path.Path;
Collapse file

‎apps/web/src/components/ChatMarkdown.permissions.browser.test.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/ChatMarkdown.permissions.browser.test.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ it("removes host actions after revocation while keeping file preview and copying
189189
using _setup = setup();
190190
await using screen = await renderMarkdown("[Readme](docs/readme.md)");
191191
await screen.openContextMenu();
192-
expect(offeredActions()).toEqual(["open", "reveal", "copy-relative", "copy-full"]);
192+
expect(offeredActions()).toEqual(["open", "open-with", "reveal", "copy-relative", "copy-full"]);
193193
await setAllowed(false);
194194
state.choose.mockResolvedValue("copy-full");
195195
await screen.openContextMenu();
Collapse file

‎apps/web/src/components/ChatMarkdown.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/ChatMarkdown.tsx
+49-3Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ import {
3838
import {
3939
AssetWorkspaceAssetNotFoundError,
4040
AuthPreviewOperateScope,
41+
DEFAULT_SERVER_SETTINGS,
42+
EDITORS,
43+
resolveFileOpenTarget,
4144
type EditorId,
4245
type EnvironmentId,
4346
type ServerConfig,
@@ -426,10 +429,23 @@ type MarkdownServerConfigFields = ReturnType<typeof markdownServerConfigFields>;
426429

427430
/** The server config fields markdown reads. */
428431
function markdownServerConfigFields(config: ServerConfig | null) {
432+
const settings = config?.settings ?? DEFAULT_SERVER_SETTINGS;
433+
const availableEditors = config?.availableEditors ?? NO_MARKDOWN_EDITORS;
429434
return {
430435
pullRequestsEnabled: config?.environment.capabilities.pullRequests === true,
431436
threadPullRequestsEnabled: config?.environment.capabilities.threadPullRequests === true,
432-
availableEditors: config?.availableEditors ?? NO_MARKDOWN_EDITORS,
437+
availableEditors,
438+
// Fork: file links follow Settings → Open in (default target, extension rules, custom apps).
439+
fileOpenSettings: {
440+
fileOpenDefault: settings.fileOpenDefault,
441+
fileOpenRules: settings.fileOpenRules,
442+
},
443+
openWithEditors: [
444+
...EDITORS.filter(
445+
(editor) => editor.id !== "file-manager" && availableEditors.includes(editor.id),
446+
),
447+
...settings.customEditors,
448+
].map(({ id, label }) => ({ id, label })),
433449
revealInFileManagerLabel:
434450
config?.shellRevealInFileManager === true && config.availableEditors.includes("file-manager")
435451
? config.shellRevealInFileManagerKind === undefined
@@ -448,7 +464,18 @@ function markdownServerConfigFieldsEqual(
448464
previous.threadPullRequestsEnabled === next.threadPullRequestsEnabled &&
449465
previous.revealInFileManagerLabel === next.revealInFileManagerLabel &&
450466
previous.availableEditors.length === next.availableEditors.length &&
451-
previous.availableEditors.every((editor, index) => editor === next.availableEditors[index])
467+
previous.availableEditors.every((editor, index) => editor === next.availableEditors[index]) &&
468+
previous.fileOpenSettings.fileOpenDefault === next.fileOpenSettings.fileOpenDefault &&
469+
previous.fileOpenSettings.fileOpenRules.length === next.fileOpenSettings.fileOpenRules.length &&
470+
previous.fileOpenSettings.fileOpenRules.every((rule, index) => {
471+
const nextRule = next.fileOpenSettings.fileOpenRules[index];
472+
return rule.extension === nextRule?.extension && rule.target === nextRule.target;
473+
}) &&
474+
previous.openWithEditors.length === next.openWithEditors.length &&
475+
previous.openWithEditors.every((editor, index) => {
476+
const nextEditor = next.openWithEditors[index];
477+
return editor.id === nextEditor?.id && editor.label === nextEditor.label;
478+
})
452479
);
453480
}
454481

@@ -609,11 +636,17 @@ function useChatMarkdownState({
609636
pullRequestsEnabled,
610637
threadPullRequestsEnabled,
611638
availableEditors,
639+
fileOpenSettings,
640+
openWithEditors,
612641
revealInFileManagerLabel,
613642
} = useAtomValue(markdownServerConfigFieldsAtom(environmentId));
614643
const projects = useProjects();
615644
const [preferredEditor] = usePreferredEditor(availableEditors);
616-
const preferredEditorMenuLabel = openInEditorMenuLabel(preferredEditor);
645+
const customEditorLabel = openWithEditors.find((editor) => editor.id === preferredEditor)?.label;
646+
const preferredEditorMenuLabel =
647+
customEditorLabel !== undefined && !EDITORS.some((editor) => editor.id === preferredEditor)
648+
? `Open in ${customEditorLabel}`
649+
: openInEditorMenuLabel(preferredEditor);
617650
const openInPreferredEditor = useOpenInPreferredEditor(environmentId, availableEditors);
618651
const openInEditor = useAtomCommand(shellEnvironment.openInEditor, {
619652
reportFailure: false,
@@ -856,6 +889,7 @@ function useChatMarkdownState({
856889
fileLinkMeta.workspaceRelativePath ??
857890
(!canPreviewMedia && isHostPath(fileLinkMeta.filePath) ? fileLinkMeta.filePath : null);
858891

892+
const fileOpenTarget = resolveFileOpenTarget(fileLinkMeta.filePath, fileOpenSettings);
859893
return (
860894
<MarkdownFileLink
861895
environmentId={environmentId}
@@ -881,6 +915,18 @@ function useChatMarkdownState({
881915
? async () =>
882916
openInPreferredEditor(
883917
markdownFileEditorTarget(fileLinkMeta, await resolveHostPath()),
918+
fileOpenTarget === "t3" ? undefined : fileOpenTarget,
919+
)
920+
: undefined
921+
}
922+
openExternally={fileOpenTarget !== "t3"}
923+
openWithEditors={openWithEditors}
924+
onOpenWith={
925+
canUseShellActions
926+
? async (editor: EditorId) =>
927+
openInPreferredEditor(
928+
markdownFileEditorTarget(fileLinkMeta, await resolveHostPath()),
929+
editor,
884930
)
885931
: undefined
886932
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.