Skip to content

Commit f2a9496

Browse files
committed
style(cdk): extract MAX_HINTED_ATTACHMENT_TITLES const in linear-issue-context-probe
The attachments-probe file was authored before deploy/247-dev flipped no-magic-numbers to error; the inline 5s (title-list cap) now trip eslint. Name the constant. No behavior change.
1 parent 69d1898 commit f2a9496

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

cdk/src/handlers/shared/linear-issue-context-probe.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ import { logger } from './logger';
3636
const LINEAR_GRAPHQL_URL = 'https://api.linear.app/graphql';
3737
const REQUEST_TIMEOUT_MS = 5000;
3838

39+
/**
40+
* Cap on attachment titles listed inline in the task-description hint; any
41+
* beyond this are summarized as "(+N more)" so the prepended hint stays short.
42+
*/
43+
const MAX_HINTED_ATTACHMENT_TITLES = 5;
44+
3945
const ISSUE_CONTEXT_QUERY = `
4046
query IssueContext($id: String!) {
4147
issue(id: $id) {
@@ -150,8 +156,10 @@ export async function probeLinearIssueContext(
150156
export function renderIssueContextHint(probe: LinearIssueContextProbe): string {
151157
const bits: string[] = [];
152158
if (probe.attachmentTitles.length > 0) {
153-
const titles = probe.attachmentTitles.slice(0, 5).map((t) => `"${t}"`).join(', ');
154-
const more = probe.attachmentTitles.length > 5 ? ` (+${probe.attachmentTitles.length - 5} more)` : '';
159+
const titles = probe.attachmentTitles
160+
.slice(0, MAX_HINTED_ATTACHMENT_TITLES).map((t) => `"${t}"`).join(', ');
161+
const more = probe.attachmentTitles.length > MAX_HINTED_ATTACHMENT_TITLES
162+
? ` (+${probe.attachmentTitles.length - MAX_HINTED_ATTACHMENT_TITLES} more)` : '';
155163
bits.push(`paperclip attachments — ${titles}${more} (fetch via \`mcp__linear-server__get_issue\` then \`mcp__linear-server__get_attachment\`)`);
156164
}
157165
if (probe.projectHasDocuments && probe.projectName) {

0 commit comments

Comments
 (0)