Objective
Fix the resolve_pull_request_review_thread safe output handler so it does not reject calls when an explicit thread_id is provided but the workflow was not triggered by a pull request event.
Context
From discussion #26222 (Safe Output Health Report 2026-04-14):
The Smoke Claude workflow runs on a schedule trigger (not a PR event). When it calls resolve_pull_request_review_thread with an explicit thread_id, the handler fails with:
Cannot resolve review threads outside of a pull request context
The handler correctly resolves the thread's PR number and repo from the GraphQL API (via getThreadPullRequestInfo), but then falls into the default/legacy mode branch which requires triggeringPRNumber — a value only available in PR-triggered workflows.
Root Cause
In actions/setup/js/resolve_pr_review_thread.cjs, the default (legacy) mode path (lines ~217–233) always requires triggeringPRNumber:
} else {
// Default (legacy) mode: scope to triggering PR only
if (!triggeringPRNumber) {
core.warning("Cannot resolve review thread: not running in a pull request context");
return {
success: false,
error: "Cannot resolve review threads outside of a pull request context",
};
}
// ...
}
When no triggeringPRNumber exists (schedule/manual triggers), the handler rejects the call even though it already has all the information needed to resolve the thread (the explicit thread_id maps to a specific PR via the API).
Fix
File: actions/setup/js/resolve_pr_review_thread.cjs
In the default/legacy mode branch, when triggeringPRNumber is not available, allow the resolution to proceed if a valid thread_id was provided and the thread was successfully resolved to a specific PR via getThreadPullRequestInfo. The guard should only block when there is no thread_id AND no triggering PR context (which is already handled earlier by the thread_id validation at the top of the handler).
Specifically, in the else (default legacy) block:
- If
triggeringPRNumber is null/undefined, emit an info log (not an error) noting that there is no triggering PR, but still allow the resolve to proceed since the explicit thread_id was resolved to threadPRNumber via the API.
- Only fail if the matching check is needed and
threadPRNumber !== triggeringPRNumber (i.e., skip the PR number check entirely when there is no triggering PR).
Files to Modify
actions/setup/js/resolve_pr_review_thread.cjs — fix the default/legacy context check
actions/setup/js/resolve_pr_review_thread.test.cjs — add/update test covering schedule-triggered context (no triggering PR, explicit thread_id provided)
Acceptance Criteria
References
Generated by Plan Command for issue #discussion #26222 · ● 287.1K · ◷
Objective
Fix the
resolve_pull_request_review_threadsafe output handler so it does not reject calls when an explicitthread_idis provided but the workflow was not triggered by a pull request event.Context
From discussion #26222 (Safe Output Health Report 2026-04-14):
The Smoke Claude workflow runs on a
scheduletrigger (not a PR event). When it callsresolve_pull_request_review_threadwith an explicitthread_id, the handler fails with:The handler correctly resolves the thread's PR number and repo from the GraphQL API (via
getThreadPullRequestInfo), but then falls into the default/legacy mode branch which requirestriggeringPRNumber— a value only available in PR-triggered workflows.Root Cause
In
actions/setup/js/resolve_pr_review_thread.cjs, the default (legacy) mode path (lines ~217–233) always requirestriggeringPRNumber:When no
triggeringPRNumberexists (schedule/manual triggers), the handler rejects the call even though it already has all the information needed to resolve the thread (the explicitthread_idmaps to a specific PR via the API).Fix
File:
actions/setup/js/resolve_pr_review_thread.cjsIn the default/legacy mode branch, when
triggeringPRNumberis not available, allow the resolution to proceed if a validthread_idwas provided and the thread was successfully resolved to a specific PR viagetThreadPullRequestInfo. The guard should only block when there is nothread_idAND no triggering PR context (which is already handled earlier by thethread_idvalidation at the top of the handler).Specifically, in the
else(default legacy) block:triggeringPRNumberis null/undefined, emit aninfolog (not an error) noting that there is no triggering PR, but still allow the resolve to proceed since the explicitthread_idwas resolved tothreadPRNumbervia the API.threadPRNumber !== triggeringPRNumber(i.e., skip the PR number check entirely when there is no triggering PR).Files to Modify
actions/setup/js/resolve_pr_review_thread.cjs— fix the default/legacy context checkactions/setup/js/resolve_pr_review_thread.test.cjs— add/update test covering schedule-triggered context (no triggering PR, explicitthread_idprovided)Acceptance Criteria
resolve_pull_request_review_threadsucceeds whenthread_idis explicitly provided, even if the workflow was not triggered by a PR event (e.g.,scheduletrigger)thread_idis missing or invalidthread_id)References