🏷️ refactor: Rename Code Interpreter Labels To Run Code (#13071)

* fix: Rename Code Interpreter UI to Run Code

* fix: Remove unused Run Code i18n keys

* fix: Restore tool call labels

* fix: Keep assistant Code Interpreter copy

* fix: Update agent code environment copy

* fix: Update code environment upload copy

* fix: Use fresh run code locale keys

* fix: Update code environment test copy

* fix: Sort upload translation test keys
This commit is contained in:
Danny Avila 2026-05-11 16:24:33 -04:00 committed by GitHub
parent c385f2ba88
commit 36e95353ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 26 additions and 34 deletions

View file

@ -25,7 +25,7 @@ function CodeInterpreter() {
className="max-w-fit"
checked={runCode}
setValue={debouncedChange}
label={localize('com_assistants_code_interpreter')}
label={localize('com_ui_run_code')}
isCheckedClassName="border-purple-600/40 bg-purple-500/10 hover:bg-purple-700/10"
icon={<TerminalSquareIcon className="icon-md" aria-hidden="true" />}
/>

View file

@ -222,7 +222,7 @@ const AttachFileMenu = ({
if (capabilities.codeEnabled && codeAllowedByAgent) {
items.push({
label: localize('com_ui_upload_code_files'),
label: localize('com_ui_upload_code_environment'),
onClick: () => {
setToolResource(EToolResources.execute_code);
setEphemeralAgent((prev) => ({

View file

@ -125,7 +125,7 @@ const DragDropModal = ({ onOptionSelect, setShowModal, files, isVisible }: DragD
}
if (capabilities.codeEnabled && codeAllowedByAgent) {
_options.push({
label: localize('com_ui_upload_code_files'),
label: localize('com_ui_upload_code_environment'),
value: EToolResources.execute_code,
icon: <TerminalSquareIcon className="icon-md" />,
});

View file

@ -95,13 +95,13 @@ const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false
function setupMocks(overrides: { provider?: string } = {}) {
const translations: Record<string, string> = {
com_ui_upload_provider: 'Upload to Provider',
com_files_upload_sharepoint: 'Upload from SharePoint',
com_sidepanel_attach_files: 'Attach Files',
com_ui_upload_code_environment: 'Upload to Code Environment',
com_ui_upload_file_search: 'Upload for File Search',
com_ui_upload_image_input: 'Upload Image',
com_ui_upload_ocr_text: 'Upload as Text',
com_ui_upload_file_search: 'Upload for File Search',
com_ui_upload_code_files: 'Upload Code Files',
com_sidepanel_attach_files: 'Attach Files',
com_files_upload_sharepoint: 'Upload from SharePoint',
com_ui_upload_provider: 'Upload to Provider',
};
mockUseLocalize.mockReturnValue((key: string) => translations[key] || key);
mockUseAgentCapabilities.mockReturnValue({
@ -320,7 +320,7 @@ describe('AttachFileMenu', () => {
});
renderMenu({ endpointType: EModelEndpoint.openAI });
openMenu();
expect(screen.getByText('Upload Code Files')).toBeInTheDocument();
expect(screen.getByText('Upload to Code Environment')).toBeInTheDocument();
});
it('shows all options when all capabilities are enabled', () => {
@ -340,7 +340,7 @@ describe('AttachFileMenu', () => {
expect(screen.getByText('Upload to Provider')).toBeInTheDocument();
expect(screen.getByText('Upload as Text')).toBeInTheDocument();
expect(screen.getByText('Upload for File Search')).toBeInTheDocument();
expect(screen.getByText('Upload Code Files')).toBeInTheDocument();
expect(screen.getByText('Upload to Code Environment')).toBeInTheDocument();
});
it('passes File Search resource when the file input changes before React state commits', () => {

View file

@ -261,7 +261,7 @@ const ToolsDropdown = ({ disabled }: ToolsDropdownProps) => {
<div {...props}>
<div className="flex items-center gap-2">
<TerminalSquareIcon className="icon-md" aria-hidden="true" />
<span>{localize('com_assistants_code_interpreter')}</span>
<span>{localize('com_ui_run_code')}</span>
</div>
<div className="flex items-center gap-1">
<button

View file

@ -49,7 +49,7 @@ export default function Action() {
<button
type="button"
className="inline-flex items-center"
aria-label={localize('com_agents_code_interpreter')}
aria-label={localize('com_ui_run_code')}
>
<CircleHelpIcon className="h-4 w-4 text-text-tertiary" />
</button>
@ -58,9 +58,7 @@ export default function Action() {
<HoverCardPortal>
<HoverCardContent side={ESide.Top} className="w-80">
<div className="space-y-2">
<p className="text-sm text-text-secondary">
{localize('com_agents_code_interpreter')}
</p>
<p className="text-sm text-text-secondary">{localize('com_agents_run_code_info')}</p>
</div>
</HoverCardContent>
</HoverCardPortal>

View file

@ -63,7 +63,7 @@ function Files({
<div className="mb-2 w-full">
<div className="flex flex-col gap-3">
<div className="rounded-lg text-xs text-text-secondary">
{localize('com_assistants_code_interpreter_files')}
{localize('com_agents_run_code_files')}
</div>
<FileRow
files={files}
@ -91,7 +91,7 @@ function Files({
onChange={handleFileChange}
/>
<AttachmentIcon className="text-token-text-primary h-4 w-4" />
{localize('com_ui_upload_code_files')}
{localize('com_ui_upload_code_environment')}
</div>
</button>
</div>

View file

@ -15,16 +15,9 @@ export default function CodeForm({
return (
<div className="w-full">
<div className="mb-1.5 flex items-center gap-2">
<div className="flex flex-row items-center gap-1">
<div className="flex items-center gap-1">
<span className="text-token-text-primary block text-sm font-medium">
{localize('com_agents_code_interpreter_title')}
</span>
<span className="text-xs text-text-secondary">
{localize('com_agents_by_librechat')}
</span>
</div>
</div>
<span className="text-token-text-primary block text-sm font-medium">
{localize('com_ui_run_code')}
</span>
</div>
<div className="flex flex-col items-start gap-2">
<Action />

View file

@ -56,7 +56,7 @@ describe('Code/Files', () => {
<Files agent_id="agent-1" />
</Wrapper>,
);
expect(screen.getByText('com_assistants_code_interpreter_files')).toBeInTheDocument();
expect(screen.getByText('com_agents_run_code_files')).toBeInTheDocument();
});
it('returns null when file config is disabled for provider', () => {
@ -133,6 +133,6 @@ describe('Code/Files', () => {
<Files agent_id="agent-1" />
</Wrapper>,
);
expect(screen.getByText('com_assistants_code_interpreter_files')).toBeInTheDocument();
expect(screen.getByText('com_agents_run_code_files')).toBeInTheDocument();
});
});

View file

@ -19,6 +19,7 @@ import type {
} from 'librechat-data-provider';
import useBuildMessageTree from '~/hooks/Messages/useBuildMessageTree';
import { useScreenshot } from '~/hooks/ScreenshotContext';
import { useLocalize } from '~/hooks';
import { cleanupPreset } from '~/utils';
type ExportValues = {
@ -45,6 +46,7 @@ export default function useExportConversation({
const queryClient = useQueryClient();
const { captureScreenshot } = useScreenshot();
const buildMessageTree = useBuildMessageTree();
const localize = useLocalize();
const { conversationId: paramId } = useParams();
@ -119,7 +121,7 @@ export default function useExportConversation({
// CODE_INTERPRETER
const toolCall = content[ContentTypes.TOOL_CALL];
const code_interpreter = toolCall[ToolCallTypes.CODE_INTERPRETER];
return ['Code Interpreter', JSON.stringify(code_interpreter)];
return [localize('com_ui_run_code'), JSON.stringify(code_interpreter)];
}
if (type === ToolCallTypes.RETRIEVAL) {

View file

@ -14,7 +14,6 @@
"com_agents_all_category": "All",
"com_agents_all_description": "Browse all shared agents across all categories",
"com_agents_avatar_upload_error": "Failed to upload agent avatar",
"com_agents_by_librechat": "by LibreChat",
"com_agents_category_aftersales": "After Sales",
"com_agents_category_aftersales_description": "Agents specialized in post-sale support, maintenance, and customer service",
"com_agents_category_empty": "No agents found in the {{category}} category",
@ -34,8 +33,6 @@
"com_agents_category_tabs_label": "Agent Categories",
"com_agents_chat_with": "Chat with {{name}}",
"com_agents_clear_search": "Clear search",
"com_agents_code_interpreter": "When enabled, allows your agent to leverage the LibreChat Code Interpreter API to run generated code, including file processing, securely. Requires a valid API key.",
"com_agents_code_interpreter_title": "Code Interpreter API",
"com_agents_contact": "Contact",
"com_agents_copy_link": "Copy Link",
"com_agents_create_error": "There was an error creating your agent.",
@ -93,6 +90,8 @@
"com_agents_not_available": "Agent Not Available",
"com_agents_recommended": "Our recommended agents",
"com_agents_results_for": "Results for '{{query}}'",
"com_agents_run_code_files": "Files below are for Code Environment only:",
"com_agents_run_code_info": "When enabled, allows your agent to run generated code securely, including file processing.",
"com_agents_search_aria": "Search for agents",
"com_agents_search_empty_heading": "No search results",
"com_agents_search_info": "When enabled, allows your agent to search the web for up-to-date information. Requires a valid API key.",
@ -1644,7 +1643,7 @@
"com_ui_upload_agent_avatar": "Successfully updated agent avatar",
"com_ui_upload_agent_avatar_label": "Upload agent avatar image",
"com_ui_upload_avatar_label": "Upload avatar image",
"com_ui_upload_code_files": "Upload for Code Interpreter",
"com_ui_upload_code_environment": "Upload to Code Environment",
"com_ui_upload_delay": "Uploading \"{{0}}\" is taking more time than anticipated. Please wait while the file finishes indexing for retrieval.",
"com_ui_upload_error": "There was an error uploading your file",
"com_ui_upload_file_context": "Upload File Context",