Skip to content

Commit 91e294f

Browse files
committed
fix: tighten Slack manual PR artifact detection (#24)
* refactor: isolate github provider factory and push-spec builders * feat: align create-pr branch flow with pushed branch * fix: tighten slack manual-pr artifact detection
1 parent c6195ba commit 91e294f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/slack-bot/src/completion/blocks.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44

55
import type { AgentResponse, CallbackContext } from "../types";
6+
import type { ManualPullRequestArtifactMetadata } from "@open-inspect/shared";
67

78
/**
89
* Slack Block Kit block type (subset).
@@ -143,11 +144,13 @@ function getManualCreatePrUrl(artifacts: AgentResponse["artifacts"]): string | n
143144
if (!artifact.metadata || typeof artifact.metadata !== "object") {
144145
return false;
145146
}
146-
if (artifact.metadata.mode === "manual_pr") {
147+
const metadata = artifact.metadata as Partial<ManualPullRequestArtifactMetadata> &
148+
Record<string, unknown>;
149+
if (metadata.mode === "manual_pr") {
147150
return true;
148151
}
149152
// Backward-compatible fallback for older artifacts that may not include mode.
150-
return artifact.metadata.mode == null && typeof artifact.metadata.createPrUrl === "string";
153+
return metadata.mode == null && typeof metadata.createPrUrl === "string";
151154
});
152155

153156
if (!manualBranchArtifact) {

0 commit comments

Comments
 (0)