Repository navigation
fix: persist errorMessage on non-throwing turn failure and shorten summary (fixes #757) #763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -399,7 +399,8 @@ async function executeReviewRun(request) { | |
| turnId: result.turnId, | ||
| payload, | ||
| rendered, | ||
| summary: firstMeaningfulLine(result.reviewText, `${reviewName} completed.`), | ||
| summary: shorten(firstMeaningfulLine(result.reviewText, `${reviewName} completed.`), 96), | ||
| errorMessage: result.error?.message ?? result.stderr ?? null, | ||
| jobTitle: `Codex ${reviewName}`, | ||
| jobClass: "review", | ||
| targetLabel: target.label | ||
|
|
@@ -419,6 +420,7 @@ async function executeReviewRun(request) { | |
| status: result.status, | ||
| failureMessage: result.error?.message ?? result.stderr | ||
| }); | ||
| const failureMessage = result.error?.message ?? result.stderr ?? parsed.parseError ?? ""; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an adversarial review returns malformed structured output without an app-server error, Useful? React with 👍 / 👎. |
||
| const payload = { | ||
| review: reviewName, | ||
| target, | ||
|
|
@@ -450,7 +452,8 @@ async function executeReviewRun(request) { | |
| targetLabel: context.target.label, | ||
| reasoningSummary: result.reasoningSummary | ||
| }), | ||
| summary: parsed.parsed?.summary ?? parsed.parseError ?? firstMeaningfulLine(result.finalMessage, `${reviewName} finished.`), | ||
| summary: parsed.parsed?.summary ?? shorten(firstMeaningfulLine(failureMessage || result.finalMessage, `${reviewName} finished.`), 96), | ||
| errorMessage: failureMessage || null, | ||
| jobTitle: `Codex ${reviewName}`, | ||
| jobClass: "review", | ||
| targetLabel: context.target.label | ||
|
|
@@ -515,14 +518,19 @@ async function executeTaskRun(request) { | |
| touchedFiles: result.touchedFiles, | ||
| reasoningSummary: result.reasoningSummary | ||
| }; | ||
| const summary = shorten( | ||
| firstMeaningfulLine(failureMessage || rawOutput, `${taskMetadata.title} finished.`), | ||
| 96 | ||
| ); | ||
|
|
||
| return { | ||
| exitStatus: result.status, | ||
| threadId: result.threadId, | ||
| turnId: result.turnId, | ||
| payload, | ||
| rendered, | ||
| summary: firstMeaningfulLine(rawOutput, firstMeaningfulLine(failureMessage, `${taskMetadata.title} finished.`)), | ||
| summary, | ||
| errorMessage: failureMessage || null, | ||
| jobTitle: taskMetadata.title, | ||
| jobClass: "task", | ||
| write: Boolean(request.write) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a native
review/startturn finishes with a nonzero status and an error but produces no review text, this still records the summary asReview completed.; if the review text is a formatted error body, it can still record only{. Because/codex:statusrenders this indexed summary rather thanerrorMessage, failed native reviews continue to show a misleading or meaningless summary despite the useful error now being persisted. For failed results, derive the summary fromresult.error?.messageor stderr before consideringreviewText.Useful? React with 👍 / 👎.