Skip to content

Commit b3c8914

Browse files
committed
fix(server): address review feedback on the fx provider
Read fx skills from the real directory name, use a fixed fx snapshot error detail, document fx's official install command, wrap long harness labels on the marketing grid, drop exports nothing else uses, and apply the repo formatter.
1 parent dc050d1 commit b3c8914

13 files changed

Lines changed: 161 additions & 62 deletions

File tree

‎apps/marketing/src/pages/index.astro‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,10 +840,12 @@ const mobileEndorsementRows = [
840840
.harness-name {
841841
font-size: 14px; font-weight: 500;
842842
letter-spacing: -0.01em; margin-bottom: 2px;
843+
overflow-wrap: anywhere;
843844
}
844845
.harness-tag {
845846
font-family: var(--font-mono);
846847
font-size: 11px; color: var(--fg-dim);
848+
overflow-wrap: anywhere;
847849
}
848850

849851
.harness-footer {

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

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ function withCurrent(
6565
base: ReadonlyArray<EffectAcpSchema.SessionConfigOption> = recordedConfigOptions,
6666
): ReadonlyArray<EffectAcpSchema.SessionConfigOption> {
6767
return base.map((option) =>
68-
option.id === configId && option.type === "select" ? { ...option, currentValue: value } : option,
68+
option.id === configId && option.type === "select"
69+
? { ...option, currentValue: value }
70+
: option,
6971
);
7072
}
7173

@@ -229,7 +231,11 @@ describe("FxAdapterV2", () => {
229231
value: "medium",
230232
}),
231233
answer("session/set_config_option", {
232-
configOptions: withCurrent("effort", "medium", withCurrent("model", "anthropic/claude-sonnet-5.5")),
234+
configOptions: withCurrent(
235+
"effort",
236+
"medium",
237+
withCurrent("model", "anthropic/claude-sonnet-5.5"),
238+
),
233239
}),
234240
outbound("session/set_config_option", {
235241
sessionId: "fx-session",
@@ -261,7 +267,11 @@ describe("FxAdapterV2", () => {
261267
value: "anthropic/claude-sonnet-5.5",
262268
}),
263269
answer("session/set_config_option", {
264-
configOptions: withCurrent("model", "anthropic/claude-sonnet-5.5", withCurrent("effort", "medium")),
270+
configOptions: withCurrent(
271+
"model",
272+
"anthropic/claude-sonnet-5.5",
273+
withCurrent("effort", "medium"),
274+
),
265275
}),
266276
outbound("session/set_config_option", {
267277
sessionId: "fx-session",
@@ -298,7 +308,11 @@ describe("FxAdapterV2", () => {
298308
value: "medium",
299309
}),
300310
answer("session/set_config_option", {
301-
configOptions: withCurrent("effort", "medium", withCurrent("model", "anthropic/claude-sonnet-5.5")),
311+
configOptions: withCurrent(
312+
"effort",
313+
"medium",
314+
withCurrent("model", "anthropic/claude-sonnet-5.5"),
315+
),
302316
}),
303317
outbound("session/set_config_option", {
304318
sessionId: "fx-session",
@@ -331,7 +345,11 @@ describe("FxAdapterV2", () => {
331345
value: "anthropic/claude-sonnet-5.5",
332346
}),
333347
answer("session/set_config_option", {
334-
configOptions: withCurrent("model", "anthropic/claude-sonnet-5.5", withCurrent("effort", "high")),
348+
configOptions: withCurrent(
349+
"model",
350+
"anthropic/claude-sonnet-5.5",
351+
withCurrent("effort", "high"),
352+
),
335353
}),
336354
outbound("session/set_config_option", {
337355
sessionId: "fx-session",
@@ -449,7 +467,11 @@ describe("FxAdapterV2", () => {
449467
value: "anthropic/claude-sonnet-5.5",
450468
}),
451469
answer("session/set_config_option", {
452-
configOptions: withCurrent("model", "anthropic/claude-sonnet-5.5", withCurrent("effort", "medium")),
470+
configOptions: withCurrent(
471+
"model",
472+
"anthropic/claude-sonnet-5.5",
473+
withCurrent("effort", "medium"),
474+
),
453475
}),
454476
outbound("session/set_config_option", {
455477
sessionId: "fx-session",
@@ -511,7 +533,11 @@ describe("FxAdapterV2", () => {
511533
outbound("session/new"),
512534
answer("session/new", {
513535
sessionId: "fx-session",
514-
configOptions: withModeAdvertisement("auto", post1189ModeValues, withCurrent("effort", "medium")),
536+
configOptions: withModeAdvertisement(
537+
"auto",
538+
post1189ModeValues,
539+
withCurrent("effort", "medium"),
540+
),
515541
}),
516542
outbound("session/set_config_option", {
517543
sessionId: "fx-session",

‎apps/server/src/orchestration-v2/Adapters/FxAdapterV2.ts‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ export const FxProviderCapabilitiesV2 = {
3333
},
3434
threads: { ...AcpProviderCapabilitiesV2.threads, canReadThreadSnapshot: true },
3535
tools: { ...AcpProviderCapabilitiesV2.tools, supportsMcpTools: true },
36-
checkpointing: { ...AcpProviderCapabilitiesV2.checkpointing, providerCanReadConversationSnapshot: true },
36+
checkpointing: {
37+
...AcpProviderCapabilitiesV2.checkpointing,
38+
providerCanReadConversationSnapshot: true,
39+
},
3740
turns: {
3841
...AcpProviderCapabilitiesV2.turns,
3942
supportsActiveSteering: false,
@@ -56,20 +59,22 @@ export interface FxAdapterV2Options {
5659
readonly makeRuntime?: AcpAdapterV2Flavor["makeRuntime"];
5760
}
5861

59-
export function makeFxAcpAdapterFlavor(options: FxAdapterV2Options): AcpAdapterV2Flavor {
62+
function makeFxAcpAdapterFlavor(options: FxAdapterV2Options): AcpAdapterV2Flavor {
6063
return {
6164
driver: FX_DRIVER_KIND,
6265
runtimeHarness: "fx",
6366
capabilities: FxProviderCapabilitiesV2,
6467
makeRuntime: (input: AcpAdapterV2RuntimeInput) =>
65-
(options.makeRuntime ??
68+
(
69+
options.makeRuntime ??
6670
(({ runtimePolicy: _runtimePolicy, ...runtimeInput }: AcpAdapterV2RuntimeInput) =>
6771
makeFxAcpRuntime({
6872
...runtimeInput,
6973
fxSettings: options.settings,
7074
environment: options.environment,
7175
childProcessSpawner: options.childProcessSpawner,
72-
})))(input).pipe(Effect.map(withFxSessionModeAlwaysWritten)),
76+
}))
77+
)(input).pipe(Effect.map(withFxSessionModeAlwaysWritten)),
7378
applyModelSelection: ({ runtime, modelSelection }) =>
7479
Effect.gen(function* () {
7580
const fxDefaultModel = yield* options.currentFxDefaultModel;
@@ -80,8 +85,9 @@ export function makeFxAcpAdapterFlavor(options: FxAdapterV2Options): AcpAdapterV
8085
});
8186
yield* applyFxEffortSelection({
8287
runtime,
83-
requestedEffort: modelSelection.options?.find((option) => option.id === FX_EFFORT_CONFIG_ID)
84-
?.value,
88+
requestedEffort: modelSelection.options?.find(
89+
(option) => option.id === FX_EFFORT_CONFIG_ID,
90+
)?.value,
8591
});
8692
return applied;
8793
}),

‎apps/server/src/provider/Drivers/FxDriver.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ import * as ProviderEventLoggers from "../ProviderEventLoggers.ts";
2222
import { FxDriver } from "./FxDriver.ts";
2323

2424
const fixturesDir = NodePath.join(NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)), "..");
25-
const SIGNED_IN_STATUS = NodeFS.readFileSync(NodePath.join(fixturesDir, "fx-status-signed-in.json"), "utf8");
25+
const SIGNED_IN_STATUS = NodeFS.readFileSync(
26+
NodePath.join(fixturesDir, "fx-status-signed-in.json"),
27+
"utf8",
28+
);
2629
const MODELS_JSON = NodeFS.readFileSync(NodePath.join(fixturesDir, "fx-models.json"), "utf8");
2730

2831
const testLayer = ServerConfig.layerTest(process.cwd(), {

‎apps/server/src/provider/Drivers/FxDriver.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export const FxDriver: ProviderDriver<FxSettings, FxDriverEnv> = {
205205
new ProviderDriverError({
206206
driver: FX_DRIVER_KIND,
207207
instanceId,
208-
detail: `Failed to build fx snapshot: ${cause.message ?? String(cause)}`,
208+
detail: "Failed to build the fx provider snapshot.",
209209
cause,
210210
}),
211211
),
@@ -216,7 +216,9 @@ export const FxDriver: ProviderDriver<FxSettings, FxDriverEnv> = {
216216
? snapshot.getSnapshot
217217
: Effect.all([
218218
snapshot.getSnapshot,
219-
provideSkillDiscovery(discoverFxSkills({ cwd: workspaceCwd, environment: processEnv })),
219+
provideSkillDiscovery(
220+
discoverFxSkills({ cwd: workspaceCwd, environment: processEnv }),
221+
),
220222
]).pipe(Effect.map(([machineSnapshot, skills]) => ({ ...machineSnapshot, skills })));
221223

222224
return {

‎apps/server/src/provider/Drivers/FxSkills.test.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,27 @@ it.layer(NodeServices.layer)("discoverFxSkills", (it) => {
136136
}).pipe(Effect.scoped),
137137
);
138138

139+
it.effect("reads a skill whose directory name has surrounding spaces", () =>
140+
Effect.gen(function* () {
141+
const fs = yield* FileSystem.FileSystem;
142+
const path = yield* Path.Path;
143+
const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-fx-skills-" });
144+
const home = path.join(tempDir, "home");
145+
yield* writeSkill(path.join(home, ".fx", "skills"), "spaced-skill ", "# No frontmatter\n");
146+
147+
const skills = yield* discoverFxSkills({ environment: { HOME: home } });
148+
149+
expect(skills).toEqual([
150+
{
151+
name: "spaced-skill",
152+
path: path.join(home, ".fx", "skills", "spaced-skill ", "SKILL.md"),
153+
scope: "user",
154+
enabled: true,
155+
},
156+
]);
157+
}).pipe(Effect.scoped),
158+
);
159+
139160
it.effect("keeps the nearer skill when names collide", () =>
140161
Effect.gen(function* () {
141162
const fs = yield* FileSystem.FileSystem;

‎apps/server/src/provider/Drivers/FxSkills.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const discoverSkillsInRoot = Effect.fn("discoverFxSkillsInRoot")(function* (inpu
127127
if (!directoryName) {
128128
continue;
129129
}
130-
const candidate = path.join(input.directory, directoryName);
130+
const candidate = path.join(input.directory, entry);
131131
const candidateInfo = yield* skipPath(candidate, fileSystem.stat(candidate));
132132
if (candidateInfo?.type !== "Directory") {
133133
continue;

‎apps/server/src/provider/FxProvider.test.ts‎

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ import {
2121

2222
const decodeFxSettings = Schema.decodeSync(FxSettings);
2323
const fixturesDir = NodePath.dirname(NodeURL.fileURLToPath(import.meta.url));
24-
const SIGNED_IN_STATUS = NodeFS.readFileSync(NodePath.join(fixturesDir, "fx-status-signed-in.json"), "utf8");
25-
const SIGNED_OUT_STATUS = NodeFS.readFileSync(NodePath.join(fixturesDir, "fx-status-signed-out.json"), "utf8");
24+
const SIGNED_IN_STATUS = NodeFS.readFileSync(
25+
NodePath.join(fixturesDir, "fx-status-signed-in.json"),
26+
"utf8",
27+
);
28+
const SIGNED_OUT_STATUS = NodeFS.readFileSync(
29+
NodePath.join(fixturesDir, "fx-status-signed-out.json"),
30+
"utf8",
31+
);
2632
const MODELS_JSON = NodeFS.readFileSync(NodePath.join(fixturesDir, "fx-models.json"), "utf8");
2733

2834
describe("parseFxStatusJson", () => {
@@ -98,13 +104,17 @@ describe("buildFxModels", () => {
98104
defaultModel: "anthropic/claude-opus-5.5",
99105
customModels: ["my-fx-model"],
100106
});
101-
expect(models.map((model) => [model.slug, model.name, model.isCustom, model.isDefault ?? false])).toEqual([
107+
expect(
108+
models.map((model) => [model.slug, model.name, model.isCustom, model.isDefault ?? false]),
109+
).toEqual([
102110
["default", "Default (anthropic/claude-opus-5.5)", false, true],
103111
["anthropic/claude-opus-5.5", "anthropic/claude-opus-5.5", false, false],
104112
["openai/gpt-5.6-sol", "openai/gpt-5.6-sol", false, false],
105113
["my-fx-model", "my-fx-model", true, false],
106114
]);
107-
expect(models[0]?.capabilities?.optionDescriptors?.map((option) => option.id)).toEqual(["effort"]);
115+
expect(models[0]?.capabilities?.optionDescriptors?.map((option) => option.id)).toEqual([
116+
"effort",
117+
]);
108118
});
109119
});
110120

@@ -196,7 +206,9 @@ it.layer(NodeServices.layer)("checkFxProviderStatus", (it) => {
196206
const probe = yield* Effect.scoped(
197207
Effect.gen(function* () {
198208
const fxPath = yield* writeFakeFxCli({});
199-
return yield* checkFxProviderStatus(decodeFxSettings({ enabled: true, binaryPath: fxPath }));
209+
return yield* checkFxProviderStatus(
210+
decodeFxSettings({ enabled: true, binaryPath: fxPath }),
211+
);
200212
}),
201213
);
202214
expect(probe.defaultModel).toBe("anthropic/claude-opus-5.5");
@@ -219,7 +231,9 @@ it.layer(NodeServices.layer)("checkFxProviderStatus", (it) => {
219231
const probe = yield* Effect.scoped(
220232
Effect.gen(function* () {
221233
const fxPath = yield* writeFakeFxCli({ statusJson: SIGNED_OUT_STATUS });
222-
return yield* checkFxProviderStatus(decodeFxSettings({ enabled: true, binaryPath: fxPath }));
234+
return yield* checkFxProviderStatus(
235+
decodeFxSettings({ enabled: true, binaryPath: fxPath }),
236+
);
223237
}),
224238
);
225239
expect(probe.draft.status).toBe("error");
@@ -235,7 +249,9 @@ it.layer(NodeServices.layer)("checkFxProviderStatus", (it) => {
235249
const probe = yield* Effect.scoped(
236250
Effect.gen(function* () {
237251
const fxPath = yield* writeFakeFxCli({ statusJson: "not-json" });
238-
return yield* checkFxProviderStatus(decodeFxSettings({ enabled: true, binaryPath: fxPath }));
252+
return yield* checkFxProviderStatus(
253+
decodeFxSettings({ enabled: true, binaryPath: fxPath }),
254+
);
239255
}),
240256
);
241257
expect(probe.draft.status).toBe("warning");

‎apps/server/src/provider/FxProvider.ts‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
type ProviderMaintenanceCapabilities,
3737
} from "./providerMaintenance.ts";
3838

39-
export const FX_PRESENTATION = {
39+
const FX_PRESENTATION = {
4040
displayName: "fx",
4141
showInteractionModeToggle: false,
4242
supportedRuntimeModes: FX_SUPPORTED_RUNTIME_MODES,
@@ -153,7 +153,11 @@ export function buildFxModels(input: {
153153
capabilities: FX_MODEL_CAPABILITIES,
154154
});
155155
}
156-
return providerModelsFromSettings([defaultEntry, ...catalog], input.customModels, FX_MODEL_CAPABILITIES);
156+
return providerModelsFromSettings(
157+
[defaultEntry, ...catalog],
158+
input.customModels,
159+
FX_MODEL_CAPABILITIES,
160+
);
157161
}
158162

159163
const runFxCliCommand = (
@@ -201,10 +205,7 @@ export function buildInitialFxProviderSnapshot(
201205
});
202206
}
203207

204-
function fxDisabledDraft(
205-
settings: FxSettings,
206-
checkedAt: string,
207-
): ServerProviderDraft {
208+
function fxDisabledDraft(settings: FxSettings, checkedAt: string): ServerProviderDraft {
208209
return buildServerProvider({
209210
presentation: FX_PRESENTATION,
210211
enabled: false,
@@ -401,7 +402,9 @@ export const checkFxProviderStatus = Effect.fn("checkFxProviderStatus")(function
401402
status: modelsFailed ? "warning" : "ready",
402403
auth,
403404
...(modelsFailed
404-
? { message: "fx is installed but model listing failed. Model options may be incomplete." }
405+
? {
406+
message: "fx is installed but model listing failed. Model options may be incomplete.",
407+
}
405408
: {}),
406409
},
407410
}),

0 commit comments

Comments
 (0)