Skip to content

Commit fe4ab0d

Browse files
authored
[Cleanup] Remove rolled out feature flags (#856)
Cleaned up a bunch of feature flags that have been rolled out in prod for months.
1 parent 730ef5f commit fe4ab0d

File tree

9 files changed

+18
-77
lines changed

9 files changed

+18
-77
lines changed

app/components/chat/Chat.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,10 @@ export const Chat = memo(
138138
};
139139
const {
140140
recordRawPromptsForDebugging,
141-
smallFiles,
142141
maxCollapsedMessagesSize,
143142
maxRelevantFilesSize,
144143
minCollapsedMessagesSize,
145144
useGeminiAuto,
146-
enablePreciseEdits,
147-
enableEnvironmentVariables,
148145
enableResend,
149146
useAnthropicFraction,
150147
} = useLaunchDarkly();
@@ -368,9 +365,6 @@ export const Chat = memo(
368365
collapsedMessages,
369366
promptCharacterCounts: characterCounts,
370367
featureFlags: {
371-
enablePreciseEdits,
372-
smallFiles,
373-
enableEnvironmentVariables,
374368
enableResend,
375369
},
376370
};

app/lib/.server/chat.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,10 @@ export async function chatAction({ request }: ActionFunctionArgs) {
6565
| { preference: 'always' | 'quotaExhausted'; value?: string; openai?: string; xai?: string; google?: string }
6666
| undefined;
6767
shouldDisableTools: boolean;
68-
smallFiles: boolean;
6968
recordRawPromptsForDebugging?: boolean;
7069
collapsedMessages: boolean;
7170
promptCharacterCounts?: PromptCharacterCounts;
7271
featureFlags: {
73-
enablePreciseEdits: boolean;
74-
smallFiles: boolean;
75-
enableEnvironmentVariables?: boolean;
7672
enableResend?: boolean;
7773
};
7874
};
@@ -184,9 +180,6 @@ export async function chatAction({ request }: ActionFunctionArgs) {
184180
collapsedMessages: body.collapsedMessages,
185181
promptCharacterCounts: body.promptCharacterCounts,
186182
featureFlags: {
187-
enablePreciseEdits: body.featureFlags.enablePreciseEdits,
188-
smallFiles: body.featureFlags.smallFiles,
189-
enableEnvironmentVariables: body.featureFlags.enableEnvironmentVariables ?? false,
190183
enableResend: body.featureFlags.enableResend ?? false,
191184
},
192185
});

app/lib/.server/llm/convex-agent.ts

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ export async function convexAgent(args: {
5656
collapsedMessages: boolean;
5757
promptCharacterCounts?: PromptCharacterCounts;
5858
featureFlags: {
59-
enablePreciseEdits: boolean;
60-
smallFiles: boolean;
61-
enableEnvironmentVariables: boolean;
6259
enableResend: boolean;
6360
};
6461
}) {
@@ -88,13 +85,11 @@ export async function convexAgent(args: {
8885
const provider = getProvider(userApiKey, modelProvider, modelChoice);
8986
const opts: SystemPromptOptions = {
9087
enableBulkEdits: true,
91-
enablePreciseEdits: featureFlags.enablePreciseEdits,
9288
includeTemplate: true,
9389
openaiProxyEnabled: getEnv('OPENAI_PROXY_ENABLED') == '1',
9490
usingOpenAi: modelProvider == 'OpenAI',
9591
usingGoogle: modelProvider == 'Google',
9692
resendProxyEnabled: getEnv('RESEND_PROXY_ENABLED') == '1',
97-
smallFiles: featureFlags.smallFiles,
9893
enableResend: featureFlags.enableResend,
9994
};
10095
const tools: ConvexToolSet = {
@@ -103,13 +98,9 @@ export async function convexAgent(args: {
10398
lookupDocs: lookupDocsTool(),
10499
getConvexDeploymentName: getConvexDeploymentNameTool,
105100
};
106-
if (featureFlags.enableEnvironmentVariables) {
107-
tools.addEnvironmentVariables = addEnvironmentVariablesTool();
108-
}
109-
if (opts.enablePreciseEdits) {
110-
tools.view = viewTool;
111-
tools.edit = editTool;
112-
}
101+
tools.addEnvironmentVariables = addEnvironmentVariablesTool();
102+
tools.view = viewTool;
103+
tools.edit = editTool;
113104

114105
const messagesForDataStream: CoreMessage[] = [
115106
{
@@ -160,7 +151,6 @@ export async function convexAgent(args: {
160151
_startTime: startTime,
161152
_firstResponseTime: firstResponseTime,
162153
providerModel: provider.model.modelId,
163-
featureFlags,
164154
});
165155
},
166156
onError({ error }) {
@@ -229,7 +219,6 @@ async function onFinishHandler({
229219
_startTime,
230220
_firstResponseTime,
231221
providerModel,
232-
featureFlags,
233222
}: {
234223
dataStream: DataStreamWriter;
235224
messages: Messages;
@@ -250,12 +239,6 @@ async function onFinishHandler({
250239
_startTime: number;
251240
_firstResponseTime: number | null;
252241
providerModel: string;
253-
featureFlags: {
254-
enablePreciseEdits: boolean;
255-
smallFiles: boolean;
256-
enableEnvironmentVariables: boolean;
257-
enableResend: boolean;
258-
};
259242
}) {
260243
const { providerMetadata } = result;
261244
// This usage accumulates accross multiple /api/chat calls until finishReason of 'stop'.
@@ -277,9 +260,6 @@ async function onFinishHandler({
277260
span.setAttribute('usage.completionTokens', usage.completionTokens);
278261
span.setAttribute('usage.promptTokens', usage.promptTokens);
279262
span.setAttribute('usage.totalTokens', usage.totalTokens);
280-
span.setAttribute('featureFlags.smallFiles', featureFlags.smallFiles);
281-
span.setAttribute('featureFlags.enablePreciseEdits', featureFlags.enablePreciseEdits);
282-
span.setAttribute('featureFlags.enableEnvironmentVariables', featureFlags.enableEnvironmentVariables);
283263
span.setAttribute('collapsedMessages', collapsedMessages);
284264
span.setAttribute('model', providerModel);
285265

app/lib/common/prompts/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export interface SystemPromptOptions {
22
enableBulkEdits: boolean;
3-
enablePreciseEdits: boolean;
43
includeTemplate: boolean;
54
openaiProxyEnabled: boolean;
65
usingOpenAi: boolean;

app/lib/hooks/useLaunchDarkly.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ import { kebabCase } from 'lodash';
44
const flagDefaults: {
55
maintenanceMode: boolean;
66
showUsageAnnotations: boolean;
7-
smallFiles: boolean;
87
recordRawPromptsForDebugging: boolean;
98
maxCollapsedMessagesSize: number;
109
maxRelevantFilesSize: number;
1110
minCollapsedMessagesSize: number;
1211
useGeminiAuto: boolean;
1312
notionClonePrompt: boolean;
14-
enablePreciseEdits: boolean;
15-
enableEnvironmentVariables: boolean;
1613
newChatFeature: boolean;
1714
minMessagesForNudge: number;
1815
enableResend: boolean;
@@ -21,15 +18,12 @@ const flagDefaults: {
2118
} = {
2219
maintenanceMode: false,
2320
showUsageAnnotations: false,
24-
smallFiles: true,
2521
recordRawPromptsForDebugging: false,
2622
maxCollapsedMessagesSize: 65536,
2723
maxRelevantFilesSize: 8192,
2824
minCollapsedMessagesSize: 8192,
2925
useGeminiAuto: false,
3026
notionClonePrompt: false,
31-
enablePreciseEdits: false,
32-
enableEnvironmentVariables: false,
3327
newChatFeature: false,
3428
minMessagesForNudge: 40,
3529
enableResend: false,

chef-agent/prompts/outputInstructions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,12 @@ function toolsInstructions(options: SystemPromptOptions) {
201201
message so that the user has time to add the environment variables before the next message.
202202
</addEnvironmentVariables_tool>
203203
204-
${options.enablePreciseEdits ? preciseToolInstructions(options) : ''}
204+
${preciseToolInstructions()}
205205
</tools>
206206
`;
207207
}
208208

209-
function preciseToolInstructions(_options: SystemPromptOptions) {
209+
function preciseToolInstructions() {
210210
return stripIndents`
211211
<view_tool>
212212
The environment automatically provides relevant files, but you can ask to see particular files by using the view

chef-agent/prompts/solutionConstraints.ts

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function solutionConstraints(options: SystemPromptOptions) {
66
return stripIndents`
77
<solution_constraints>
88
9-
${options.includeTemplate ? templateInfo(options) : ''}
9+
${options.includeTemplate ? templateInfo() : ''}
1010
1111
<convex_guidelines>
1212
You MUST use Convex for the database, realtime, file storage, functions, scheduling, HTTP handlers,
@@ -176,27 +176,7 @@ export function solutionConstraints(options: SystemPromptOptions) {
176176
`;
177177
}
178178

179-
function appTsxInstructions(systemPromptOptions: SystemPromptOptions) {
180-
const { smallFiles } = systemPromptOptions;
181-
return smallFiles
182-
? stripIndents`
183-
<file path="src/App.tsx">
184-
This is the main React component for the app. It starts with a simple login form and a button to add a
185-
random number to a list. It uses "src/SignInForm.tsx" and "src/SignOutButton.tsx" for the login and
186-
logout functionality. Add new React components to their own files in the 'src' directory to avoid
187-
cluttering the main file.
188-
</file>
189-
`
190-
: stripIndents`
191-
<file path="src/App.tsx">
192-
This is the main React component for the app. It starts with a simple login form and a button to add a
193-
random number to a list. It uses "src/SignInForm.tsx" and "src/SignOutButton.tsx" for the login and
194-
logout functionality.
195-
</file>
196-
`;
197-
}
198-
199-
function templateInfo(systemPromptOptions: SystemPromptOptions) {
179+
function templateInfo() {
200180
return stripIndents`
201181
<template_info>
202182
The Chef WebContainer environment starts with a full-stack app template fully loaded at '/home/project',
@@ -241,7 +221,13 @@ function templateInfo(systemPromptOptions: SystemPromptOptions) {
241221
this file. The \`authTables\` object is imported with \`import { authTables } from "@convex-dev/auth/server";\`.
242222
</file>
243223
244-
${appTsxInstructions(systemPromptOptions)}
224+
<file path="src/App.tsx">
225+
This is the main React component for the app. It starts with a simple login form and a button to add a
226+
random number to a list. It uses "src/SignInForm.tsx" and "src/SignOutButton.tsx" for the login and
227+
logout functionality. Add new React components to their own files in the 'src' directory to avoid
228+
cluttering the main file.
229+
</file>
230+
245231
<file path="src/main.tsx">
246232
This file is the entry point for the app and sets up the 'ConvexAuthProvider'.
247233

chef-agent/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ export type ConvexProject = {
1919

2020
export interface SystemPromptOptions {
2121
enableBulkEdits: boolean;
22-
enablePreciseEdits: boolean;
2322
includeTemplate: boolean;
2423
openaiProxyEnabled: boolean;
2524
usingOpenAi: boolean;
2625
usingGoogle: boolean;
2726
resendProxyEnabled: boolean;
28-
smallFiles: boolean;
2927
enableResend: boolean;
3028
}
3129

test-kitchen/chefTask.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ export async function chefTask(model: ChefModel, outputDir: string, userMessage:
9797
};
9898
const opts: SystemPromptOptions = {
9999
enableBulkEdits: true,
100-
enablePreciseEdits: true,
101100
includeTemplate: true,
102101
usingOpenAi: model.name.startsWith('gpt-'),
103102
usingGoogle: model.name.startsWith('gemini-'),
@@ -108,7 +107,7 @@ export async function chefTask(model: ChefModel, outputDir: string, userMessage:
108107
// proxies should never be used in the test kitchen.
109108
openaiProxyEnabled: true,
110109
resendProxyEnabled: true,
111-
smallFiles: true,
110+
enableResend: false,
112111
};
113112
const assistantMessage: UIMessage = {
114113
id: generateId(),
@@ -119,7 +118,7 @@ export async function chefTask(model: ChefModel, outputDir: string, userMessage:
119118
let numDeploys = 0;
120119
let success: boolean;
121120
let lastDeploySuccess = false;
122-
let totalUsage: LanguageModelUsage = {
121+
const totalUsage: LanguageModelUsage = {
123122
promptTokens: 0,
124123
completionTokens: 0,
125124
totalTokens: 0,
@@ -409,10 +408,8 @@ async function invokeGenerateText(model: ChefModel, opts: SystemPromptOptions, c
409408
lookupDocs: lookupDocsTool(),
410409
getConvexDeploymentName: getConvexDeploymentNameTool,
411410
};
412-
if (opts.enablePreciseEdits) {
413-
tools.view = viewTool;
414-
tools.edit = editTool;
415-
}
411+
tools.view = viewTool;
412+
tools.edit = editTool;
416413
const result = await generateText({
417414
model: model.ai,
418415
maxTokens: model.maxTokens,

0 commit comments

Comments
 (0)