Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🤖 fix: Accept GitHub App bot commit identities (#16253)

Danny Avila59da55290497
diff --git a/client/src/components/SidePanel/Agents/Code/Settings.tsx b/client/src/components/SidePanel/Agents/Code/Settings.tsx
index 57adc4b139..fb1d973e2f 100644
--- a/client/src/components/SidePanel/Agents/Code/Settings.tsx
+++ b/client/src/components/SidePanel/Agents/Code/Settings.tsx
@@ -356,7 +356,8 @@ export default function CodeSettings() {
validate: validateGitIdentity,
deps: ['git_identity.name'],
})}
- type="email"
+ type="text"
+ inputMode="email"
maxLength={254}
placeholder={localize('com_ui_agent_git_email')}
aria-label={localize('com_ui_agent_git_email')}
diff --git a/client/src/components/SidePanel/Agents/__tests__/CodeSettings.spec.tsx b/client/src/components/SidePanel/Agents/__tests__/CodeSettings.spec.tsx
index 81ef613fa9..f468044403 100644
--- a/client/src/components/SidePanel/Agents/__tests__/CodeSettings.spec.tsx
+++ b/client/src/components/SidePanel/Agents/__tests__/CodeSettings.spec.tsx
@@ -199,6 +199,10 @@ test.each(['Disable code', 'Use managed', 'Disable sessions', 'Toggle Dialog'])(
test.each([
{ name: 'Coding Agent', email: '[email protected]' },
+ {
+ name: 'Lia',
+ email: '328778573+lia-by-librechat[bot]@users.noreply.github.com',
+ },
{ name: '', email: '' },
])('retains a valid identity or explicit clear through panel navigation: %j', async (identity) => {
render(<IdentityForm />);
@@ -208,6 +212,7 @@ test.each([
fireEvent.change(screen.getByLabelText('com_ui_agent_git_email'), {
target: { value: identity.email },
});
+ expect(screen.getByLabelText('com_ui_agent_git_email')).toHaveAttribute('type', 'text');
fireEvent.click(screen.getByText('Toggle Dialog'));
expect(screen.getByTestId('identity')).toHaveTextContent(JSON.stringify(identity));
fireEvent.click(screen.getByText('Toggle Dialog'));
diff --git a/packages/api/openapi/agents.openapi.json b/packages/api/openapi/agents.openapi.json
index d8b8783694..df429025b7 100644
--- a/packages/api/openapi/agents.openapi.json
+++ b/packages/api/openapi/agents.openapi.json
@@ -2154,7 +2154,6 @@
},
"email": {
"type": "string",
- "format": "email",
"maxLength": 254
}
},
@@ -2594,7 +2593,6 @@
},
"email": {
"type": "string",
- "format": "email",
"maxLength": 254
}
},
@@ -3058,7 +3056,6 @@
},
"email": {
"type": "string",
- "format": "email",
"maxLength": 254
}
},
diff --git a/packages/api/src/agents/validation.spec.ts b/packages/api/src/agents/validation.spec.ts
index 3b00381d64..8b3a75637e 100644
--- a/packages/api/src/agents/validation.spec.ts
+++ b/packages/api/src/agents/validation.spec.ts
@@ -27,10 +27,20 @@ describe('agent Git identity validation', () => {
).toEqual({ name: 'Coding Agent', email: '[email protected]' });
});
+ it('accepts a GitHub App bot noreply address for commit attribution', () => {
+ const git_identity = {
+ name: 'Lia',
+ email: '328778573+lia-by-librechat[bot]@users.noreply.github.com',
+ };
+ expect(agentCreateSchema.parse({ ...base, git_identity }).git_identity).toEqual(git_identity);
+ });
+
it.each([
{ name: '', email: '[email protected]' },
{ name: 'Coding Agent\nInjected', email: '[email protected]' },
{ name: 'Coding Agent', email: 'not-an-email' },
+ { name: 'Coding Agent', email: 'lia-by-librechat[bot]@users.noreply.github.com' },
+ { name: 'Coding Agent', email: '328778573+lia-by-librechat[bot]@example.com' },
])('rejects an unsafe or incomplete identity: %j', (git_identity) => {
expect(agentCreateSchema.safeParse({ ...base, git_identity }).success).toBe(false);
});
diff --git a/packages/data-provider/src/types/agents.spec.ts b/packages/data-provider/src/types/agents.spec.ts
new file mode 100644
index 0000000000..779c87d198
--- /dev/null
+++ b/packages/data-provider/src/types/agents.spec.ts
@@ -0,0 +1,23 @@
+import { agentGitIdentitySchema } from './agents';
+
+describe('agentGitIdentitySchema', () => {
+ it('accepts ordinary and GitHub App bot commit identities', () => {
+ expect(
+ agentGitIdentitySchema.safeParse({ name: 'Lia', email: '[email protected]' }).success,
+ ).toBe(true);
+ expect(
+ agentGitIdentitySchema.safeParse({
+ name: 'Lia',
+ email: '328778573+lia-by-librechat[bot]@users.noreply.github.com',
+ }).success,
+ ).toBe(true);
+ });
+
+ it.each([
+ 'lia-by-librechat[bot]@users.noreply.github.com',
+ '328778573+lia-by-librechat[bot]@example.com',
+ '328778573+lia-by-librechat[bot]@users.noreply.github.com\nInjected',
+ ])('rejects an invalid bot address: %s', (email) => {
+ expect(agentGitIdentitySchema.safeParse({ name: 'Lia', email }).success).toBe(false);
+ });
+});
diff --git a/packages/data-provider/src/types/agents.ts b/packages/data-provider/src/types/agents.ts
index 9ee535636a..98f9591cb6 100644
--- a/packages/data-provider/src/types/agents.ts
+++ b/packages/data-provider/src/types/agents.ts
@@ -960,6 +960,11 @@ export type AgentGitIdentity = {
email: string;
};
+// GitHub App bot noreply addresses contain `[bot]`, which Zod's email validator rejects.
+const githubAppBotEmail =
+ /^\d+\+[a-z0-9]+(?:[a-z0-9-]*[a-z0-9])?\[bot\]@users\.noreply\.github\.com$/i;
+const standardGitEmail = z.string().email();
+
export const agentGitIdentitySchema: z.ZodType<AgentGitIdentity | undefined> = z
.object({
name: z
@@ -971,9 +976,12 @@ export const agentGitIdentitySchema: z.ZodType<AgentGitIdentity | undefined> = z
email: z
.string()
.trim()
- .email()
.max(254)
- .refine((value) => !/[\0\r\n]/.test(value)),
+ .refine(
+ (value) =>
+ !/[\0\r\n]/.test(value) &&
+ (standardGitEmail.safeParse(value).success || githubAppBotEmail.test(value)),
+ ),
})
.optional();