fix: avoid duplicate gh view bodies

This commit is contained in:
Codex
2026-07-10 06:27:46 +02:00
parent 0addf8d3b9
commit 0fc0fb7336
7 changed files with 25 additions and 4 deletions
+9 -1
View File
@@ -128,7 +128,9 @@ export function selectedIssueJson(issue: GitHubIssue, comments: GitHubComment[]
const summary = issueSummary(issue);
const selected: Record<string, unknown> = {};
for (const field of fields) {
if (field === "comments") {
if (field === "body") {
continue;
} else if (field === "comments") {
selected.comments = (comments ?? []).map(options.includeFullCommentBodies === true ? commentSummary : compactIssueViewCommentSummary);
} else {
selected[field] = summary[field];
@@ -189,7 +191,13 @@ export async function issueRead(repo: string, token: string, issueNumber: number
json: selectedIssueJson(issue, comments, jsonFields, { includeFullCommentBodies }),
compatibility: {
legacyJsonBodyPath: includeBody ? ".data.issue.body" : null,
bodyPath: includeBody ? ".data.issue.body" : null,
omittedDuplicateBodyPath: includeBody ? ".data.json.body" : null,
duplicateBodyOmitted: includeBody,
bodyOmitted: !includeBody,
bodyMigrationHint: includeBody
? "Read the full body from .data.issue.body; .data.json.body is intentionally omitted so large bodies are emitted only once."
: null,
...commentsCompatibility,
readCommands: {
...(includeBody ? {} : issueBodyReadCommands(repo, issueNumber)),