Skip to content

Commit 8fc1a32

Browse files
fix(mention): parse hyphenated Codex headers and keep Jira drafts
Allow hyphenated and quoted keys in Codex MCP sub-tables, silence globalJsonInEffect for opaque JSON-RPC framing, and treat Jira/Figma contexts as user content during draft migration. Co-authored-by: Cursor <[email protected]>
1 parent 729f3f0 commit 8fc1a32

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎apps/server/src/mention/MentionIndexMcpClient.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Short-lived MCP sessions for mention indexing; JSON-RPC payloads stay opaque.
2-
// @effect-diagnostics nodeBuiltinImport:off preferSchemaOverJson:off globalErrorInEffectFailure:off globalErrorInEffectCatch:off globalFetchInEffect:off tryCatchInEffectGen:off effectFnOpportunity:off
2+
// @effect-diagnostics nodeBuiltinImport:off preferSchemaOverJson:off globalJsonInEffect:off globalErrorInEffectFailure:off globalErrorInEffectCatch:off globalFetchInEffect:off tryCatchInEffectGen:off effectFnOpportunity:off
33
import * as NodeChildProcess from "node:child_process";
44
import * as NodeReadline from "node:readline";
55

@@ -349,9 +349,9 @@ export function parseCodexMcpServers(raw: string): ReadonlyArray<MentionMcpServe
349349
continue;
350350
}
351351
if (current === null) continue;
352-
const field = line.match(/^([A-Za-z0-9_]+)\s*=\s*(.+?)\s*$/u);
352+
const field = line.match(/^("[^"]+"|'[^']+'|[A-Za-z0-9_-]+)\s*=\s*(.+?)\s*$/u);
353353
if (!field) continue;
354-
const key = field[1]!;
354+
const key = unquoteToml(field[1]!);
355355
const value = unquoteToml(field[2]!);
356356
if (current.activeTable !== null) {
357357
current.tables[current.activeTable] ??= {};

‎apps/server/src/mention/MentionIndexMcpSyncers.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ url = "https://mcp.figma.com/mcp"
7676
bearer_token_env_var = "FIGMA_TOKEN"
7777
http_headers = { "X-Region" = "us" }
7878
79+
[mcp_servers.figma.http_headers]
80+
X-Figma-Region = "us-east-1"
81+
82+
[mcp_servers.figma.env_http_headers]
83+
"X-Api-Key" = "FIGMA_TOKEN"
84+
7985
[profiles.default]
8086
command = "should-not-leak"
8187
@@ -102,6 +108,8 @@ command = "should-not-overwrite-stdio-env"
102108
url: "https://mcp.figma.com/mcp",
103109
headers: {
104110
"X-Region": "us",
111+
"X-Figma-Region": "us-east-1",
112+
"X-Api-Key": "secret-token",
105113
Authorization: "Bearer secret-token",
106114
},
107115
});

‎apps/web/src/composerDraftStore.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,9 @@ function persistedComposerDraftHasUserContent(draft: PersistedComposerThreadDraf
20852085
(draft.previewAnnotations?.length ?? 0) > 0 ||
20862086
(draft.reviewComments?.length ?? 0) > 0 ||
20872087
(draft.threadContexts?.length ?? 0) > 0 ||
2088-
(draft.environmentContexts?.length ?? 0) > 0
2088+
(draft.environmentContexts?.length ?? 0) > 0 ||
2089+
(draft.jiraContexts?.length ?? 0) > 0 ||
2090+
(draft.figmaContexts?.length ?? 0) > 0
20892091
);
20902092
}
20912093

0 commit comments

Comments
 (0)