From 39754650c94f74398d2faba90503da2d9fd365c3 Mon Sep 17 00:00:00 2001 From: "jfrog-skills-release-bot[bot]" <276080306+jfrog-skills-release-bot[bot]@users.noreply.github.com> Date: Sun, 15 Nov 2026 14:43:33 +0000 Subject: [PATCH 1/4] [patch] chore: sync modules to v0.16.2 --- .codex-plugin/plugin.json | 2 +- .github/scripts/sync-modules-vendor.json | 2 +- modules/core/jf-user-agent.mjs | 2 +- modules/core/proxy-fetch.mjs | 72 ++++++++++++++++-------- modules/core/telemetry-worker.mjs | 3 +- package.json | 2 +- 6 files changed, 53 insertions(+), 30 deletions(-) diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index abfb999..aeaf5bf 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jfrog", - "version": "0.1.17", + "version": "0.1.18", "description": "JFrog skills and the JFrog MCP server for Codex \u2014 interact with the JFrog Platform.", "author": { "name": "JFrog", diff --git a/.github/scripts/sync-modules-vendor.json b/.github/scripts/sync-modules-vendor.json index 53e14a9..33b2f3f 100644 --- a/.github/scripts/sync-modules-vendor.json +++ b/.github/scripts/sync-modules-vendor.json @@ -1,6 +1,6 @@ { "repo": "JFROG/jfrog-agent-hooks", - "pin": "jfrog-agent-hooks/v0.16.1", + "pin": "jfrog-agent-hooks/v0.16.2", "paths": [ "modules" ] diff --git a/modules/core/jf-user-agent.mjs b/modules/core/jf-user-agent.mjs index 6e4f1fb..7719c6f 100644 --- a/modules/core/jf-user-agent.mjs +++ b/modules/core/jf-user-agent.mjs @@ -20,7 +20,7 @@ import { spawnJfSync } from "./jf-process.mjs"; // Plugin sync stamps this literal with the release semver (jfrog-sync-modules.py // stamp). Only `modules/` is vendored, so nothing outside this tree is readable // at runtime. Unstamped trees (this repo, local dev) report 0.0.0. -const PKG_VERSION = "0.16.1"; +const PKG_VERSION = "0.16.2"; /** Hooks release semver stamped at plugin sync ("0.0.0" when unstamped). */ export function hooksPackageVersion() { diff --git a/modules/core/proxy-fetch.mjs b/modules/core/proxy-fetch.mjs index 00e624c..7589b70 100644 --- a/modules/core/proxy-fetch.mjs +++ b/modules/core/proxy-fetch.mjs @@ -7,14 +7,16 @@ // (no socks, PAC or NTLM); anything else goes direct, as plain fetch did. Like // jf, loopback hosts always go direct, and NO_PROXY takes names, IPs and CIDR. // -// When the proxy fails before the JPD answers (refused, unreachable, slow to -// open the tunnel, TLS rejected), the call goes direct, as it did before proxy -// support: a JPD that was reachable directly keeps working. +// When the proxy fails before the JPD answers (refused, unreachable, CONNECT +// answered with an error such as 407, slow to open the tunnel, TLS rejected), +// the call goes direct, as it did before proxy support: a JPD that was +// reachable directly keeps working. Once a body was sent, it isn't sent again. import { request as httpRequest } from "node:http"; import { request as httpsRequest } from "node:https"; import { BlockList, isIP } from "node:net"; import process from "node:process"; +import { Readable } from "node:stream"; const unbracket = (host) => host.replace(/^\[|\]$/g, ""); @@ -89,12 +91,13 @@ export function proxyFor(target, env = process.env) { } /** - * GET `url` like fetch(url, init), through the proxy the environment names. - * Only `headers` and `signal` are used, and through a proxy the Response has - * just a status and a body (no redirects, headers or url): the hooks' callers - * read only `ok`, `status` and `json()`. + * fetch(url, init) through the proxy the environment names. Only `method`, + * `headers`, a string `body` and `signal` are used, and through a proxy the + * Response has just a status, headers and a streamed body (no redirects or url): the + * hooks' callers read only `ok`, `status`, `json()` and, for telemetry, the + * Retry-After header. * @param {string} url - * @param {{ headers?: Record, signal?: AbortSignal }} [init] + * @param {{ method?: string, headers?: Record, body?: string, signal?: AbortSignal }} [init] * @returns {Promise} */ export async function proxyFetch(url, init = {}) { @@ -102,14 +105,14 @@ export async function proxyFetch(url, init = {}) { const proxy = proxyFor(target); if (!proxy) return fetch(url, init); try { - return await getViaProxy(target, proxy, init); + return await sendViaProxy(target, proxy, init); } catch (err) { if (!err?.beforeAnswer) throw err; // after an answer, or the caller's time is up return fetch(url, init); } } -function getViaProxy(target, proxy, { headers = {}, signal }) { +function sendViaProxy(target, proxy, { method, headers = {}, body, signal }) { return new Promise((resolve, reject) => { let answered = false; let connectTimer; @@ -154,6 +157,7 @@ function getViaProxy(target, proxy, { headers = {}, signal }) { req = httpsRequest({ host: unbracket(target.hostname), port: target.port || 443, + method, path: `${target.pathname}${target.search}`, // Unlike fetch, nothing here decompresses: ask for the plain body. headers: { ...headers, "Accept-Encoding": "identity" }, @@ -169,23 +173,41 @@ function getViaProxy(target, proxy, { headers = {}, signal }) { req.on("error", fail); req.on("response", (answer) => { answered = true; - const chunks = []; - answer.on("data", (chunk) => chunks.push(chunk)); answer.on("error", fail); - answer.on("end", () => { - const empty = [204, 205, 304].includes(answer.statusCode); - try { - resolve( - new Response(empty ? null : Buffer.concat(chunks), { - status: answer.statusCode, - }), - ); - } catch (err) { - fail(err); // a status Response rejects, e.g. 999 - } - }); + // Like fetch: answer once the status and headers are in and stream the + // body, so a 429's Retry-After counts even if its body stalls. + const empty = [204, 205, 304].includes(answer.statusCode); + let res; + try { + // From the raw pairs, so repeated headers stay separate. + const headers = new Headers(); + for (let i = 0; i < answer.rawHeaders.length; i += 2) + headers.append(answer.rawHeaders[i], answer.rawHeaders[i + 1]); + res = new Response(empty ? null : Readable.toWeb(answer), { + status: answer.statusCode, + headers, + }); + } catch (err) { + answer.destroy(); + fail(err); // a status Response rejects, e.g. 999 + return; + } + if (empty) answer.resume(); + // Time up while the body streams: reading it rejects with the + // signal's reason, as in fetch. + const onAbort = () => answer.destroy(signal.reason); + signal?.addEventListener("abort", onAbort, { once: true }); + answer.once("close", () => + signal?.removeEventListener("abort", onAbort), + ); + resolve(res); + }); + // With a body, Node sends its Content-Length. Once the body is written + // the target may already have it, so a later failure is not resent + // direct: a POST, unlike a GET, isn't safe to send twice. + req.end(body, () => { + if (body != null) answered = true; }); - req.end(); }); tunnel.end(); }); diff --git a/modules/core/telemetry-worker.mjs b/modules/core/telemetry-worker.mjs index f5eb6d8..f5b33a8 100644 --- a/modules/core/telemetry-worker.mjs +++ b/modules/core/telemetry-worker.mjs @@ -38,6 +38,7 @@ import { getAgentsConfigSection } from "./agents-config.mjs"; import { isMainEntry } from "./entry.mjs"; import { parseHttpStatus, runJf } from "./jpd-get.mjs"; import { createLogger, setLogContext } from "./logger.mjs"; +import { proxyFetch } from "./proxy-fetch.mjs"; import { hooksPackageVersion, skillsProductUserAgent, @@ -912,7 +913,7 @@ export async function runWorker(opts) { env = process.env, dir = telemetryDir(), timeoutMs = SEND_TIMEOUT_MS, - fetchFn = fetch, + fetchFn = proxyFetch, now = Date.now, pluginDir, jitterMs = 0, diff --git a/package.json b/package.json index ac2bafc..92bb8ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codex-plugin", - "version": "0.1.17", + "version": "0.1.18", "private": true, "type": "module", "description": "JFrog skills and MCP server plugin for OpenAI Codex.", From 888016d7c2ef3eb3a891b0e33ca6146d40cd80c2 Mon Sep 17 00:00:00 2001 From: Tal Amram Date: Sun, 15 Nov 2026 16:59:06 +0200 Subject: [PATCH 2/4] Port the telemetry proxy note for agent-hooks v0.16.2 Anonymous plugin telemetry now documents HTTPS_PROXY and NO_PROXY. Keep each plugin's own guide links. --- docs/plugin-telemetry.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/plugin-telemetry.md b/docs/plugin-telemetry.md index 8a9b9dd..f7ee918 100644 --- a/docs/plugin-telemetry.md +++ b/docs/plugin-telemetry.md @@ -14,6 +14,7 @@ Plugin telemetry is separate from JFrog CLI usage reporting: each product has it - **Not sent:** prompts, code, file paths, usernames, emails or tokens in the event. (The authenticated send below lets the JFrog CLI add its own credential, to your JFrog Platform only.) - **Authenticated:** when the URL found is `https` and the JFrog CLI (2.100.0 or later) has a server for it (same scheme, host and port), the event is first sent through the JFrog CLI (`jf api`) with that server's credentials (never to the JFrog endpoint below), and your JFrog Platform stores a hashed user ID with it, the same one it stores for MCP usage. The plugin never reads those credentials. If the JFrog CLI is missing or gives no answer within 3 s, or your JFrog Platform answers with anything other than a success, 400, 408, 413, 422 or 429 (for example 401 for an expired credential, or 404 when it doesn't have the authenticated route yet), the event is sent again without them. Without such a server, the event is sent without credentials (anonymous). A JFrog CLI server saved with a path in its URL (for example `https://acme.jfrog.io/artifactory/`) isn't used for this; save it as `https://acme.jfrog.io/`. - **Where:** your JFrog Platform, at the first URL found (see [Point events at your JFrog Platform](#point-events-at-your-jfrog-platform)). When none is found, the one found isn't an `http(s)` URL, or your JFrog Platform can't be reached or turns the event away, a JFrog endpoint in the EU (`https://pluginmetrics.jfrog.io`). If your JFrog Platform rejects the event itself (400, 413, 422 or 429), nothing is sent to that endpoint for the session. +- **Through a proxy:** the send without credentials honors `HTTPS_PROXY` and `NO_PROXY`: an `http://` proxy, with or without a user and password in its URL (no SOCKS, PAC, NTLM or Kerberos). Only `https` URLs are proxied: an `http://` JFrog Platform URL is sent directly (`HTTP_PROXY` isn't read). `localhost` and loopback addresses are never proxied, and `NO_PROXY` takes host names, IP addresses and CIDR ranges; if your JFrog Platform is reachable only without the proxy, add it to `NO_PROXY`. If the proxy can't be reached, refuses the connection, asks for other credentials (407), doesn't connect within 1.5 s, or its TLS certificate isn't trusted, the event is sent directly instead. To send through a proxy that inspects TLS traffic, add its CA certificate to `NODE_EXTRA_CA_CERTS`. The authenticated send goes through the JFrog CLI, which uses its own proxy settings. - **Local files:** `~/.jfrog/telemetry/` holds the install ID (`install-id-v1.json`), one receipt per harness and, while a harness waits after a 429 or 5xx, its `backoff--v1.json`. Nothing is written there when telemetry is off. --- From d5d56b1490eda55539fd78ef472fee056dc5125d Mon Sep 17 00:00:00 2001 From: Tal Amram Date: Sun, 15 Nov 2026 17:08:21 +0200 Subject: [PATCH 3/4] Revert "Port the telemetry proxy note for agent-hooks v0.16.2" This reverts commit 888016d7c2ef3eb3a891b0e33ca6146d40cd80c2. --- docs/plugin-telemetry.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/plugin-telemetry.md b/docs/plugin-telemetry.md index f7ee918..8a9b9dd 100644 --- a/docs/plugin-telemetry.md +++ b/docs/plugin-telemetry.md @@ -14,7 +14,6 @@ Plugin telemetry is separate from JFrog CLI usage reporting: each product has it - **Not sent:** prompts, code, file paths, usernames, emails or tokens in the event. (The authenticated send below lets the JFrog CLI add its own credential, to your JFrog Platform only.) - **Authenticated:** when the URL found is `https` and the JFrog CLI (2.100.0 or later) has a server for it (same scheme, host and port), the event is first sent through the JFrog CLI (`jf api`) with that server's credentials (never to the JFrog endpoint below), and your JFrog Platform stores a hashed user ID with it, the same one it stores for MCP usage. The plugin never reads those credentials. If the JFrog CLI is missing or gives no answer within 3 s, or your JFrog Platform answers with anything other than a success, 400, 408, 413, 422 or 429 (for example 401 for an expired credential, or 404 when it doesn't have the authenticated route yet), the event is sent again without them. Without such a server, the event is sent without credentials (anonymous). A JFrog CLI server saved with a path in its URL (for example `https://acme.jfrog.io/artifactory/`) isn't used for this; save it as `https://acme.jfrog.io/`. - **Where:** your JFrog Platform, at the first URL found (see [Point events at your JFrog Platform](#point-events-at-your-jfrog-platform)). When none is found, the one found isn't an `http(s)` URL, or your JFrog Platform can't be reached or turns the event away, a JFrog endpoint in the EU (`https://pluginmetrics.jfrog.io`). If your JFrog Platform rejects the event itself (400, 413, 422 or 429), nothing is sent to that endpoint for the session. -- **Through a proxy:** the send without credentials honors `HTTPS_PROXY` and `NO_PROXY`: an `http://` proxy, with or without a user and password in its URL (no SOCKS, PAC, NTLM or Kerberos). Only `https` URLs are proxied: an `http://` JFrog Platform URL is sent directly (`HTTP_PROXY` isn't read). `localhost` and loopback addresses are never proxied, and `NO_PROXY` takes host names, IP addresses and CIDR ranges; if your JFrog Platform is reachable only without the proxy, add it to `NO_PROXY`. If the proxy can't be reached, refuses the connection, asks for other credentials (407), doesn't connect within 1.5 s, or its TLS certificate isn't trusted, the event is sent directly instead. To send through a proxy that inspects TLS traffic, add its CA certificate to `NODE_EXTRA_CA_CERTS`. The authenticated send goes through the JFrog CLI, which uses its own proxy settings. - **Local files:** `~/.jfrog/telemetry/` holds the install ID (`install-id-v1.json`), one receipt per harness and, while a harness waits after a 429 or 5xx, its `backoff--v1.json`. Nothing is written there when telemetry is off. --- From a270170b847bf5b6978c6640a759ee57e2c64e26 Mon Sep 17 00:00:00 2001 From: Tal Amram Date: Sun, 15 Nov 2026 16:59:06 +0200 Subject: [PATCH 4/4] Port the telemetry proxy note for agent-hooks v0.16.2 Anonymous plugin telemetry now documents HTTPS_PROXY and NO_PROXY. Keep each plugin's own guide links. --- docs/plugin-telemetry.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/plugin-telemetry.md b/docs/plugin-telemetry.md index 8a9b9dd..f7ee918 100644 --- a/docs/plugin-telemetry.md +++ b/docs/plugin-telemetry.md @@ -14,6 +14,7 @@ Plugin telemetry is separate from JFrog CLI usage reporting: each product has it - **Not sent:** prompts, code, file paths, usernames, emails or tokens in the event. (The authenticated send below lets the JFrog CLI add its own credential, to your JFrog Platform only.) - **Authenticated:** when the URL found is `https` and the JFrog CLI (2.100.0 or later) has a server for it (same scheme, host and port), the event is first sent through the JFrog CLI (`jf api`) with that server's credentials (never to the JFrog endpoint below), and your JFrog Platform stores a hashed user ID with it, the same one it stores for MCP usage. The plugin never reads those credentials. If the JFrog CLI is missing or gives no answer within 3 s, or your JFrog Platform answers with anything other than a success, 400, 408, 413, 422 or 429 (for example 401 for an expired credential, or 404 when it doesn't have the authenticated route yet), the event is sent again without them. Without such a server, the event is sent without credentials (anonymous). A JFrog CLI server saved with a path in its URL (for example `https://acme.jfrog.io/artifactory/`) isn't used for this; save it as `https://acme.jfrog.io/`. - **Where:** your JFrog Platform, at the first URL found (see [Point events at your JFrog Platform](#point-events-at-your-jfrog-platform)). When none is found, the one found isn't an `http(s)` URL, or your JFrog Platform can't be reached or turns the event away, a JFrog endpoint in the EU (`https://pluginmetrics.jfrog.io`). If your JFrog Platform rejects the event itself (400, 413, 422 or 429), nothing is sent to that endpoint for the session. +- **Through a proxy:** the send without credentials honors `HTTPS_PROXY` and `NO_PROXY`: an `http://` proxy, with or without a user and password in its URL (no SOCKS, PAC, NTLM or Kerberos). Only `https` URLs are proxied: an `http://` JFrog Platform URL is sent directly (`HTTP_PROXY` isn't read). `localhost` and loopback addresses are never proxied, and `NO_PROXY` takes host names, IP addresses and CIDR ranges; if your JFrog Platform is reachable only without the proxy, add it to `NO_PROXY`. If the proxy can't be reached, refuses the connection, asks for other credentials (407), doesn't connect within 1.5 s, or its TLS certificate isn't trusted, the event is sent directly instead. To send through a proxy that inspects TLS traffic, add its CA certificate to `NODE_EXTRA_CA_CERTS`. The authenticated send goes through the JFrog CLI, which uses its own proxy settings. - **Local files:** `~/.jfrog/telemetry/` holds the install ID (`install-id-v1.json`), one receipt per harness and, while a harness waits after a 429 or 5xx, its `backoff--v1.json`. Nothing is written there when telemetry is off. ---