Skip to content

Commit 384e278

Browse files
chore: tighten text generator copy
Rewrites the settings, dialog, error, and user guide copy for text generators: shorter descriptions, "environment" instead of "that server", and errors that say what to check or where to fix it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 76f6356 commit 384e278

12 files changed

Lines changed: 77 additions & 58 deletions

‎apps/server/src/textGeneration/CodexTextGeneration.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,8 @@ it.effect(
736736

737737
// With no agent ready, it says what is missing instead of looking up a provider by that id.
738738
const failure = yield* Effect.flip((yield* serviceWith([])).generateReviewGuide(input));
739-
expect(failure.detail).toMatch(/^Review guides need an agent that can read the checkout/);
739+
expect(failure.detail).toMatch(
740+
/^Review guides need a coding agent that can read the checkout/,
741+
);
740742
}),
741743
);

‎apps/server/src/textGeneration/TextGeneration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const make = Effect.gen(function* () {
146146
return yield* new TextGenerationError({
147147
operation,
148148
detail:
149-
"Review guides need an agent that can read the checkout, such as Codex or Claude, and none is ready. Choose one as the review guide model in Settings → Source control.",
149+
"Review guides need a coding agent that can read the checkout. None is ready. Pick Codex or Claude as the review guide model in Settings → Source control.",
150150
});
151151
}
152152
return yield* resolveInstance(registry, operation, selection.instanceId).pipe(

‎apps/server/src/textGeneration/TextGenerators.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ it.effect("a turned-off text generator fails instead of calling its API", () =>
8888
const failure = yield* Effect.flip(
8989
run!(request).pipe(Effect.provideService(FetchHttpClient.Fetch, upstream)),
9090
);
91-
expect(failure.detail).toBe("OpenRouter is turned off in Settings.");
91+
expect(failure.detail).toBe("OpenRouter is off. Turn it on in Settings → Providers.");
9292
expect(upstream).not.toHaveBeenCalled();
9393
}),
9494
);

‎apps/server/src/textGeneration/TextGenerators.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ export const make = Effect.gen(function* () {
5454

5555
const readConfig = Effect.fn("TextGenerators.readConfig")(function* (id: ProviderInstanceId) {
5656
const settings = yield* settingsService.getSettings.pipe(
57-
Effect.mapError(() => new TextGeneratorRequestError({ detail: "Could not read settings." })),
57+
Effect.mapError(
58+
() =>
59+
new TextGeneratorRequestError({ detail: "Couldn't read this environment's settings." }),
60+
),
5861
);
5962
return textGeneratorForSelection(settings, id);
6063
});
@@ -97,7 +100,7 @@ export const make = Effect.gen(function* () {
97100
Effect.fail(
98101
new TextGenerationError({
99102
operation: request.operation,
100-
detail: `${label} is turned off in Settings.`,
103+
detail: `${label} is off. Turn it on in Settings → Providers.`,
101104
}),
102105
)) satisfies TextGenerationOperations.Runner;
103106
}
@@ -108,7 +111,9 @@ export const make = Effect.gen(function* () {
108111
function* (input: ListTextGeneratorModelsInput) {
109112
const config = yield* readConfig(input.id);
110113
if (config === undefined) {
111-
return yield* new TextGeneratorRequestError({ detail: "No such text generator." });
114+
return yield* new TextGeneratorRequestError({
115+
detail: "That text generator no longer exists.",
116+
});
112117
}
113118
const cached = (yield* Ref.get(modelCache)).get(input.id);
114119
// Keyed on the whole config so a changed URL or key never serves another API's list.

‎apps/server/src/textGeneration/textGeneratorDrivers.ts‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ const describeStatus = (label: string, status: number, message: string | undefin
5151
status === 401 || status === 403
5252
? "rejected the API key"
5353
: status === 404
54-
? "has no such model or endpoint"
54+
? "couldn't find that model or endpoint"
5555
: status === 429
56-
? "is rate limiting requests"
56+
? "is rate-limiting requests"
5757
: `returned HTTP ${status}`;
5858
const detail = message?.trim().slice(0, 300);
5959
return `${label} ${reason}${detail ? `: ${detail}` : "."}`;
@@ -74,7 +74,11 @@ const sendJson = Effect.fn("TextGenerator.sendJson")(function* <S extends Schema
7474
Effect.provideService(FetchHttpClient.RequestInit, { redirect: "error" }),
7575
Effect.provideService(HttpClient.TracerPropagationEnabled, false),
7676
Effect.mapError(
77-
(cause) => new TextGeneratorRequestError({ detail: `Could not reach ${label}.`, cause }),
77+
(cause) =>
78+
new TextGeneratorRequestError({
79+
detail: `Couldn't reach ${label}. Check the base URL and your connection.`,
80+
cause,
81+
}),
7882
),
7983
);
8084
const body = yield* response.json.pipe(Effect.orElseSucceed((): unknown => undefined));
@@ -89,7 +93,10 @@ const sendJson = Effect.fn("TextGenerator.sendJson")(function* <S extends Schema
8993
return yield* Schema.decodeUnknownEffect(schema)(body).pipe(
9094
Effect.mapError(
9195
(cause) =>
92-
new TextGeneratorRequestError({ detail: `${label} sent an unexpected reply.`, cause }),
96+
new TextGeneratorRequestError({
97+
detail: `${label} returned a reply T3 Code couldn't read.`,
98+
cause,
99+
}),
93100
),
94101
);
95102
});
@@ -102,7 +109,7 @@ const withTimeout =
102109
duration,
103110
orElse: () =>
104111
Effect.fail(
105-
new TextGeneratorRequestError({ detail: `${label} did not answer in time.` }),
112+
new TextGeneratorRequestError({ detail: `${label} took too long to respond.` }),
106113
),
107114
}),
108115
);
@@ -129,7 +136,7 @@ const OpenAIModelList = Schema.Struct({
129136

130137
const openAICompatible: TextGeneratorDriver = {
131138
kind: "openaiCompatible",
132-
label: "The model API",
139+
label: "This model API",
133140
generate: (connection, model, prompt) => {
134141
const label = openAICompatible.label;
135142
let request = HttpClientRequest.post(endpoint(connection, "/chat/completions")).pipe(
@@ -142,7 +149,7 @@ const openAICompatible: TextGeneratorDriver = {
142149
const text = choice?.message.content?.trim();
143150
if (choice?.finish_reason === "length") {
144151
return Effect.fail(
145-
new TextGeneratorRequestError({ detail: `${label} stopped at its output limit.` }),
152+
new TextGeneratorRequestError({ detail: `${label} reached its output limit.` }),
146153
);
147154
}
148155
return text
@@ -203,7 +210,7 @@ const anthropic: TextGeneratorDriver = {
203210
Effect.flatMap((message) => {
204211
if (message.stop_reason === "max_tokens") {
205212
return Effect.fail(
206-
new TextGeneratorRequestError({ detail: `${label} stopped at its output limit.` }),
213+
new TextGeneratorRequestError({ detail: `${label} reached its output limit.` }),
207214
);
208215
}
209216
const text = message.content

‎apps/web/src/components/settings/SettingsPanels.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ export function ThreadsSettingsPanel() {
17631763
serverScoped
17641764
settingKeys={["textGenerationModelSelection"]}
17651765
{...searchableSetting("text-generation-model")}
1766-
description="Used for thread titles and other generated text on connected devices with this provider. Source control can override it. Add a model API as a text generator in Providers."
1766+
description="For thread titles and other generated text. Source control has its own setting. Text generators from Providers also appear here."
17671767
resetAction={
17681768
hasServerTargets && isTextGenerationModelDirty ? (
17691769
<SettingResetButton

‎apps/web/src/components/settings/SourceControlWritingSettings.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export function SourceControlWritingSettingsSection() {
327327
serverScoped
328328
settingKeys={["reviewGuideModelSelection"]}
329329
{...searchableSetting("review-guide-model")}
330-
description="Agent that reads a pull request over many steps to write its review guide; a stronger model helps. Off uses the source control writer model, or Codex or Claude when that is a text generator."
330+
description="Must be a coding agent: it reads the pull request over many steps. Off uses the writer model, or Codex or Claude if that model is a text generator."
331331
control={
332332
!hasServerTargets ? (
333333
<span className="text-sm text-muted-foreground">

‎apps/web/src/components/settings/TextGeneratorsSettings.tsx‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ export function TextGeneratorsSettings({
8686
!readOnly ? (
8787
<Button size="xs" variant="outline" onClick={() => setEditing("new")}>
8888
<PlusIcon className="size-3" aria-hidden />
89-
Add API
89+
Add generator
9090
</Button>
9191
) : null
9292
}
9393
>
9494
{generators.length === 0 ? (
9595
<SettingsRow
96-
title="No text generators configured."
97-
description="Model APIs that write titles, commit messages, and other text, but can't run agents."
96+
title="No text generators yet"
97+
description="Add a model API to write thread titles, commit messages, and other short text without starting a coding agent."
9898
/>
9999
) : null}
100100
{generators.map(([id, config]) => {
@@ -116,7 +116,7 @@ export function TextGeneratorsSettings({
116116
description={
117117
<span className="break-all">
118118
{KIND_LABELS[config.kind]}
119-
{config.enabled ? "" : " · Disabled"} · {config.baseUrl}
119+
{config.enabled ? "" : " · Off"} · {config.baseUrl}
120120
</span>
121121
}
122122
control={
@@ -154,7 +154,6 @@ export function TextGeneratorsSettings({
154154
{editing !== null ? (
155155
<TextGeneratorDialog
156156
environmentId={environmentId}
157-
environmentLabel={environmentLabel}
158157
editing={editing}
159158
onClose={() => setEditing(null)}
160159
onSave={(id, config) => {
@@ -176,8 +175,8 @@ export function TextGeneratorsSettings({
176175
Remove {removingConfig ? textGeneratorDisplayName(removingConfig) : ""}?
177176
</AlertDialogTitle>
178177
<AlertDialogDescription>
179-
Its API key is deleted from {environmentLabel}. Text it was chosen to write falls back
180-
to the text generation model.
178+
This deletes the API key stored on {environmentLabel}. Anything set to use this
179+
generator falls back to the text generation model.
181180
</AlertDialogDescription>
182181
</AlertDialogHeader>
183182
<AlertDialogFooter>
@@ -201,14 +200,12 @@ export function TextGeneratorsSettings({
201200
/** The key goes once to the server's secret storage; settings keep only a redaction marker. */
202201
function TextGeneratorDialog({
203202
environmentId,
204-
environmentLabel,
205203
editing,
206204
onClose,
207205
onSave,
208206
newId,
209207
}: {
210208
readonly environmentId: EnvironmentId;
211-
readonly environmentLabel: string;
212209
readonly editing: Editing;
213210
readonly onClose: () => void;
214211
readonly onSave: (id: ProviderInstanceId, config: TextGeneratorConfig) => void;
@@ -255,8 +252,9 @@ function TextGeneratorDialog({
255252
{existing ? `Edit ${textGeneratorDisplayName(existing)}` : "Add a text generator"}
256253
</DialogTitle>
257254
<DialogDescription>
258-
Choose it for thread titles, commit messages, and other generated text on{" "}
259-
{environmentLabel}. The key stays on that server.
255+
{existing
256+
? "Your API key is stored on this environment. Changes apply wherever this generator is picked."
257+
: "For thread titles, commit messages, and other short text, without starting a coding agent. Your API key is stored on this environment."}
260258
</DialogDescription>
261259
</DialogHeader>
262260
<DialogPanel>
@@ -323,10 +321,16 @@ function TextGeneratorDialog({
323321
/>
324322
</div>
325323
<div className="grid gap-1.5">
326-
<Label htmlFor="text-generator-label">Label (optional)</Label>
324+
<Label htmlFor="text-generator-label">Name (optional)</Label>
327325
<Input
328326
id="text-generator-label"
329-
placeholder={existing === null ? preset.label : "Defaults to the service name"}
327+
placeholder={
328+
existing !== null
329+
? textGeneratorDisplayName(existing)
330+
: preset.id === "custom"
331+
? "e.g. My local model"
332+
: preset.label
333+
}
330334
value={label}
331335
onChange={(event) => setLabel(event.target.value)}
332336
/>

‎apps/web/src/components/settings/settingsSearch.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ export const SETTINGS_SEARCH_ITEMS = [
949949
title: "Text generators",
950950
to: "/settings/providers",
951951
searchTerms: [
952-
"model api key openai openrouter anthropic ollama lm studio openai-compatible base url text generation titles commit messages add remove refresh models",
952+
"model api api key openai openrouter anthropic ollama lm studio custom endpoint base url thread titles commit messages",
953953
],
954954
providerSettingsOnly: true,
955955
},

‎apps/web/src/textGenerators.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const TEXT_GENERATOR_PRESETS: ReadonlyArray<TextGeneratorPreset> = [
4949
kind: "anthropic",
5050
baseUrl: "https://api.anthropic.com/v1",
5151
},
52-
{ id: "custom", label: "OpenAI-compatible", kind: "openaiCompatible", baseUrl: "" },
52+
{ id: "custom", label: "Custom (OpenAI-compatible)", kind: "openaiCompatible", baseUrl: "" },
5353
];
5454

5555
export function textGeneratorDisplayName(config: TextGeneratorConfig): string {

0 commit comments

Comments
 (0)