Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

[codex] fix codex linear issue render (#16646)

Arvin Xudefc5f3b5001
diff --git a/packages/builtin-tools/src/codex/mcpToolUtils.test.ts b/packages/builtin-tools/src/codex/mcpToolUtils.test.ts
index 86cdf588cc7..59ede3455d1 100644
--- a/packages/builtin-tools/src/codex/mcpToolUtils.test.ts
+++ b/packages/builtin-tools/src/codex/mcpToolUtils.test.ts
@@ -43,6 +43,30 @@ describe('getCodexLinearMcpApiName', () => {
expect(getCodexLinearMcpApiName({ toolName: 'server_linear_get_issue' })).toBe('get_issue');
});
+ it('normalizes Codex Apps dotted Linear tool names', () => {
+ expect(
+ getCodexLinearMcpApiName({
+ input: { id: 'LOBE-11078' },
+ server: 'codex_apps',
+ toolName: 'linear.get_issue',
+ }),
+ ).toBe('get_issue');
+ expect(
+ getCodexLinearMcpApiName({
+ input: { id: 'issue:TEST-0000' },
+ server: 'codex_apps',
+ toolName: 'linear.fetch',
+ }),
+ ).toBe('get_issue');
+ expect(
+ getCodexLinearMcpApiName({
+ input: { query: 'agent runtime' },
+ server: 'codex_apps',
+ toolName: 'linear.search',
+ }),
+ ).toBe('search');
+ });
+
it('treats bare issue identifiers as issue fetch calls', () => {
expect(getCodexLinearMcpApiName({ input: { id: 'TEST-0000' }, toolName: 'linear_fetch' })).toBe(
'get_issue',
diff --git a/packages/builtin-tools/src/codex/mcpToolUtils.ts b/packages/builtin-tools/src/codex/mcpToolUtils.ts
index ae23064f9f0..598af0f5775 100644
--- a/packages/builtin-tools/src/codex/mcpToolUtils.ts
+++ b/packages/builtin-tools/src/codex/mcpToolUtils.ts
@@ -94,7 +94,11 @@ export const getMcpInputRecord = (
const normalizeCodexLinearToolName = (toolName: string) => {
if (!toolName) return { apiName: '', hasLinearPrefix: false };
- let apiName = toolName.trim();
+ let apiName = toolName
+ .trim()
+ .replaceAll(/([a-z0-9])([A-Z])/g, '$1_$2')
+ .replaceAll(/[.\-\s]+/g, '_')
+ .toLowerCase();
let hasLinearPrefix = false;
let changed = true;