Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hooks/core/routing.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ const TOOL_ALIASES = {
"view": "Read",
"grep": "Grep",
"fetch": "WebFetch",
"webfetch": "WebFetch",
"agent": "Agent",
// Codex CLI
"shell": "Bash",
Expand Down
16 changes: 16 additions & 0 deletions tests/hooks/core-routing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,22 @@ describe("routePreToolUse", () => {
expect(subagent.status).toBe(0);
expect(subagent.stdout).toBe("");
});

it("treats opencode webfetch as WebFetch and blocks it (#1052)", () => {
const url = "https://example.com";
const result = routePreToolUse(
"webfetch",
{ url },
undefined,
"opencode",
"opencode-webfetch",
);
expect(result).not.toBeNull();
expect(result!.action).toBe("deny");
expect(result!.reason).toContain("WebFetch redirected");
expect(result!.reason).toContain("fetch_and_index");
expect(result!.reason).toContain("ctx_search");
});
});

// ─── MCP readiness: all redirects degrade gracefully (#230) ───
Expand Down