Tool-request prompts fail closed on installability

TOOL_REQUESTED now carries the registry's verdict (installable/version/summary).
GUI offers Install only when the event says a pinned build exists.
This commit is contained in:
Rohit C Prasad
2026-08-14 23:25:21 -07:00
committed by Rohit P
parent c041ed64a5
commit 25d32891d3
5 changed files with 71 additions and 6 deletions
+10
View File
@@ -610,6 +610,16 @@ export async function mockApi(page: import("@playwright/test").Page) {
});
return; // suspended on the approval
}
// The pre-fix payload shape (owner-hit 2026-08-14): no installable/version/summary
// — an older sidecar, or any surface that forgets the field. Must render NOT
// installable, never a guessed Install offer.
if (/request an unpinned tool/i.test(msg.text)) {
send("tool_requested", {
name: "somescanner",
reason: "scan the Terraform for misconfigurations",
});
return; // suspended on the tool request
}
// OPE-85: the agent hits a missing scanner and asks instead of skipping the check.
if (/scan for secrets/i.test(msg.text)) {
send("tool_requested", {
+15
View File
@@ -23,6 +23,21 @@ test("request_tool surfaces a card naming the tool, the reason and the pinned ve
await expect(card.getByTestId("toolreq-skip")).toBeVisible();
});
test("an event without install metadata fails CLOSED — Install disabled, skip offered", async ({
page,
}) => {
// Owner-hit 2026-08-14: the card offered "pinned build, checksum-verified" for a tool
// with no pinned build; approval could only produce an error. Absence of metadata is NO.
await page.goto("/");
await page.getByPlaceholder(/Ask the coworker/).fill("request an unpinned tool");
await page.getByRole("button", { name: "Send" }).click();
const card = page.locator(".dirreq-card");
await expect(card).toContainText("somescanner");
await expect(card).toContainText(/no verified build/i);
await expect(card.getByTestId("toolreq-install")).toBeDisabled();
await expect(card.getByTestId("toolreq-skip")).toBeEnabled();
});
test("installing runs the check; skipping still reports coverage", async ({ page }) => {
await ask(page);
await page.getByTestId("toolreq-install").click();
+2 -1
View File
@@ -737,7 +737,8 @@ export function App() {
kind: "toolreq",
tool: d.name || "",
reason: d.reason || "",
installable: d.installable !== false,
// Fail CLOSED: only offer Install when the event says a pinned build exists.
installable: d.installable === true,
version: d.version || "",
summary: d.summary || "",
},