Skip to content

fix: skip GitHub dedup for critical errors - #1503

Open
EttyKitty wants to merge 1 commit into
mainfrom
opencode/dispatch-b918c7-20260904015305
Open

fix: skip GitHub dedup for critical errors#1503
EttyKitty wants to merge 1 commit into
mainfrom
opencode/dispatch-b918c7-20260904015305

Conversation

@EttyKitty

@EttyKitty EttyKitty commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Critical errors close the game next frame, so the async GET paginated open-issue lookup never finishes and the report is lost. Discord already avoids this by sending a one-way POST without attaching save/log files. Mirror that behaviour for GitHub: when _error.critical is true, skip the dedup GET and POST the issue directly via createIssue.


Summary by cubic

Fixes critical-error GitHub bug reports being lost because the game closes next frame before the async dedup GET finishes.

  • Critical errors now skip the dedup lookup and create the issue directly via a one-way POST, matching Discord's fire-and-forget handling.
  • Duplicate issues are possible for critical errors since the dedup check is skipped.

Written for commit b3c409b. Summary will update on new commits.

Review in cubic

Critical errors close the game next frame, so the async GET
paginated open-issue lookup never finishes and the report is lost.
Discord already avoids this by sending a one-way POST without
attaching save/log files. Mirror that behaviour for GitHub: when
_error.critical is true, skip the dedup GET and POST the issue
directly via createIssue.
@github-actions github-actions Bot added Size: Tiny Type: Fix This is a fix for a bug labels Sep 4, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 1 file

Confidence score: 5/5

  • scripts/GitHubBugReporter/GitHubBugReporter.gml repeats the same user-facing message, increasing maintenance noise without indicating a functional regression — extract it into a shared string macro or static constant.
  • scripts/GitHubBugReporter/GitHubBugReporter.gml duplicates issue creation and callback wiring already handled by finalize, so future GitHub report changes could diverge — extract the shared create-and-handle flow.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="scripts/GitHubBugReporter/GitHubBugReporter.gml">

<violation number="1" location="scripts/GitHubBugReporter/GitHubBugReporter.gml:32">
P3: The critical path duplicates issue creation and callback wiring already maintained in `finalize`, so future changes to GitHub report handling must be applied twice and can diverge. Extract the shared create-and-handle operation into a helper and call it from both paths.</violation>

<violation number="2" location="scripts/GitHubBugReporter/GitHubBugReporter.gml:36">
P2: Custom agent: **Code Quality Review**

This added literal duplicates the same user-facing message at lines 156 and 166. Extract it into a shared string macro or static constant.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

if (_issue_critical != undefined) {
_issue_critical.setCallback(function(_result, _request) {
LOGGER.debug($"New issue created (critical, no dedup): #{_result.number}.");
show_message_async("Report sent to the Administratum.");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Custom agent: Code Quality Review

This added literal duplicates the same user-facing message at lines 156 and 166. Extract it into a shared string macro or static constant.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/GitHubBugReporter/GitHubBugReporter.gml, line 36:

<comment>This added literal duplicates the same user-facing message at lines 156 and 166. Extract it into a shared string macro or static constant.</comment>

<file context>
@@ -23,6 +23,24 @@ function GitHubBugReporter() constructor {
+            if (_issue_critical != undefined) {
+                _issue_critical.setCallback(function(_result, _request) {
+                    LOGGER.debug($"New issue created (critical, no dedup): #{_result.number}.");
+                    show_message_async("Report sent to the Administratum.");
+                }).setErrorback(function(_result, _request) {
+                    LOGGER.error($"Failed to create issue (critical): {_result}");
</file context>

if (_error.critical) {
var _body_critical = __build_body(_error, _user_text);
var _client_critical = new GitHub(_token);
var _issue_critical = _client_critical.createIssue(GITHUB_ISSUES_OWNER, GITHUB_ISSUES_REPO, new GitHubIssue(_error.report_title, _body_critical));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The critical path duplicates issue creation and callback wiring already maintained in finalize, so future changes to GitHub report handling must be applied twice and can diverge. Extract the shared create-and-handle operation into a helper and call it from both paths.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/GitHubBugReporter/GitHubBugReporter.gml, line 32:

<comment>The critical path duplicates issue creation and callback wiring already maintained in `finalize`, so future changes to GitHub report handling must be applied twice and can diverge. Extract the shared create-and-handle operation into a helper and call it from both paths.</comment>

<file context>
@@ -23,6 +23,24 @@ function GitHubBugReporter() constructor {
+        if (_error.critical) {
+            var _body_critical = __build_body(_error, _user_text);
+            var _client_critical = new GitHub(_token);
+            var _issue_critical = _client_critical.createIssue(GITHUB_ISSUES_OWNER, GITHUB_ISSUES_REPO, new GitHubIssue(_error.report_title, _body_critical));
+            if (_issue_critical != undefined) {
+                _issue_critical.setCallback(function(_result, _request) {
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: Tiny Type: Fix This is a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant