Repository navigation
Description
CLI Version:
@salesforce/cli/2.149.9
Architecture:
win32-arm64
Node Version:
node-v24.14.1
Plugin Version:
@oclif/plugin-autocomplete 3.2.56 (core)
@oclif/plugin-commands 4.1.63 (core)
@oclif/plugin-help 6.2.58 (core)
@oclif/plugin-not-found 3.2.93 (core)
@oclif/plugin-plugins 5.4.87 (core)
@oclif/plugin-search 1.2.54 (core)
@oclif/plugin-update 4.7.59 (core)
@oclif/plugin-version 2.2.57 (core)
@oclif/plugin-warn-if-update-available 3.1.73 (core)
@oclif/plugin-which 3.2.61 (core)
@salesforce/cli 2.149.9 (core)
agent 2.0.5 (user)
apex 4.1.0 (core)
api 2.0.9 (core)
auth 5.0.6 (core)
code-analyzer 5.12.0 (user)
data 5.1.5 (core)
deploy-retrieve 4.1.2 (core)
info 4.0.9 (core)
limits 4.0.3 (core)
marketplace 2.0.5 (core)
org 6.0.9 (core)
packaging 3.0.5 (core)
schema 4.0.5 (core)
settings 3.0.5 (core)
sobject 2.0.5 (core)
telemetry 4.0.5 (core)
templates 57.0.9 (core)
trust 4.0.9 (core)
user 5.0.1 (core)
OS and Version:
Windows_NT 10.0.26200
Shell:
powershell
Title: agent publish authoring-bundle fails with bare "TypeError: fetch
failed" — endpoint fallback targets internal-only hosts
(test.api/dev.api.salesforce.com)
Summary
sf agent publish authoring-bundle fails with an unactionable
TypeError: fetch failed (UND_ERR_CONNECT_TIMEOUT). Root cause is a
combination of three behaviors in @salesforce/agents
(lib/utils.js → requestWithEndpointFallback, used by
lib/agents/scriptAgentPublisher.js):
POST https://api.salesforce.com/einstein/ai-agent/v1.1/authoring/agents
returns 404 with an empty body for my org (an Agentforce Developer
Edition on anorgfarm-*.develop.my.salesforce.cominstance). Notably,
the same org succeeds against
POST https://api.salesforce.com/einstein/ai-agent/v1.1/authoring/scripts
(sf agent validate authoring-bundlepasses) — so prod SFAP serves the
/scriptsroute but 404s the/agentsroute for this org, which looks
like a routing/provisioning inconsistency rather than a wholly
unprovisioned org.- On the 404, the library falls back to
test.api.salesforce.com. That
hostname publicly resolves to an internal-only ingress:
test.api.salesforce.com→ CNAME
ingress-internal.core4.test1-uswest2.aws.sfdc.cl→
34.210.29.116 / 44.228.60.86 / 34.213.108.10, none of which accept
connections from the public internet (connect timeout, verified with
curl).dev.api.salesforce.comis the same:
ingress-internal.core002.dev1-uswest2.aws.sfdc.cl. - The fallback loop throws immediately on any non-404 error, so the
connect timeout ontest.aborts the chain beforedev.is attempted —
and the user receives a raw undicifetch failedwith no indication of
which endpoint failed or why.
Net effect: for any org whose /authoring/agents route isn't served by prod
SFAP, an external user gets a dead-end fallback chain that cannot succeed
from outside Salesforce's network, surfaced as a generic fetch error.
Steps to reproduce
From a fresh Agentforce Developer Edition (signup via the Agentforce DE form;
Einstein + Agentforce enabled in Setup), in an SFDX project:
sf agent generate agent-spec -o <alias> --type customer --role "..." --company-name "..." --company-description "..." --max-topics 3 --output-file specs/agentSpec.yaml
sf agent generate authoring-bundle -o <alias> -f specs/agentSpec.yaml -n "Test Agent" --api-name Test_Agent
sf agent validate authoring-bundle --api-name Test_Agent -o <alias> # succeeds
sf agent publish authoring-bundle --api-name Test_Agent -o <alias> # fails
Actual result
TypeError: fetch failed
[cause]: ConnectTimeoutError: Connect Timeout Error
(attempted addresses: 34.210.29.116:443, 44.228.60.86:443, 34.213.108.10:443, timeout: 10000ms)
code: 'UND_ERR_CONNECT_TIMEOUT'
Trace-level logs show the sequence: POST to
api.salesforce.com/einstein/ai-agent/v1.1/authoring/agents (404), then POST
to test.api.salesforce.com/... (connect timeout, command dies).
Expected result
Any of:
- prod
api.salesforce.comserves/authoring/agentsfor orgs it already
serves/authoring/scriptsfor; or - the fallback treats a connect timeout as fall-through rather than fatal,
and reports which endpoints were attempted; or - a clear error such as "the agent authoring API is not available for this
org type" instead of a raw fetch failure.
Diagnostics already ruled out
- Not local DNS/network in general:
api.salesforce.comresolves correctly
(155.226.144.x) and connects fine via both curl and Node's resolver; the
org's My Domain connects fine;validate authoring-bundlesucceeds. - Not fixed by upgrading: reproduced on
@salesforce/plugin-agent2.0.3
(CLI-bundled) and 2.0.5 (user-installed). - The 404 reproduces outside the CLI:
curl -X POSTto the/authoring/agents
URL with a valid org access token returns 404 withcontent-length: 0.
Environment
- sf CLI: <paste
sf version --verboseoutput> @salesforce/plugin-agent: 2.0.3 and 2.0.5 (both reproduce)- OS: Windows 11 Pro (10.0.26200)
- Org: Agentforce Developer Edition,
orgfarm-*.develop.my.salesforce.com
instance, Einstein and Agentforce enabled in Setup
Workaround
The non-Agent-Script path works against the same org: sf agent create --spec specs/agentSpec.yaml ... creates the agent via the org's own API and
retrieves its metadata normally. Only the Agent Script
publish flow is affected.
Activity
github-actions commentedon Aug 28, 2026
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
git2gus commentedon Aug 28, 2026
This issue has been linked to a new work item: W-24023175
k80bowman commentedon Aug 28, 2026
Thanks @jimnovakoff!! I've queued a ticket for this, we'll get it fixed.
nobodybeatstheviz commentedon Sep 10, 2026
Second confirmed reproduction, this time from a scratch org (not an Agentforce DE), so the scope is wider than the original report.
Environment
@salesforce/cli2.149.9 ·agentplugin 2.0.3 ·@salesforce/agents2.0.4 · node v22.19.0 · Windows 11 (10.0.26200)*.scratch.my.salesforce.com), API 67.0, Agentforce enabled via aSettings:EinsteinCopilotmetadata deploy.AgentforceAiAssistisn't available on this org type, sosf agent createis walled and Agent Script publish is the only creation path.What happens
sf agent validate authoring-bundle→ passes (the/scriptsroute on prodapi.salesforce.comanswers; it returned a real 400 on a schema error earlier the same day, then OK after the fix).sf agent publish authoring-bundle --api-name <name> -o <scratch-alias>→ hangs, thenTypeError: fetch failed/UND_ERR_CONNECT_TIMEOUT.Measured independently of the CLI
POST https://api.salesforce.com/einstein/ai-agent/v1.1/authoring/agents→ 404, empty body (connect 0.1 s).test.api.salesforce.com→ CNAMEingress-internal.core4.test1-uswest2.aws.sfdc.cl→ 34.210.29.116 / 44.228.60.86 / 34.213.108.10: TCP:443 silently dropped (8–12 s connect timeout, no RST) from home broadband, a second broadband, 5G cellular, and an unrelated external HTTP fetcher. Persistent 2026-09-06 → 2026-09-09, with 0 active incidents on the Trust API.dev.api.salesforce.com(44.225.5.181): same silent drop.api.salesforce.com404/200, the scratch org's My Domain host 200,s3.us-west-2.amazonaws.comconnects. So it isn't an AWS-region or ISP issue, only those ingress IPs.Reading
lib/utils.jsrequestWithEndpointFallbackin@salesforce/agents2.0.4 matches the original analysis: the fallback only advances on a 404, so the connect timeout ontest.throws beforedev.is ever tried, and neither host is reachable from outside Salesforce's network anyway.Happy to run any diagnostic against this org while it's alive (it expires 2026-10-03). Thanks for picking this up.
nobodybeatstheviz commentedon Sep 10, 2026
Follow-up that narrows the cause, same machine, same CLI/plugin versions, same authoring bundle, ~2 hours later:
sf agent publish authoring-bundleagainst an Agentforce Developer Edition (orgfarm-*.develop.my.salesforce.com, Agentforce licensed) → succeeds in 18 s. So prodapi.salesforce.comdoes serve/authoring/agentsfor at least some DEs, and the public-ingress problem never enters the picture there.Einstein1AIPlatformfeature (definition had onlyEnableSetPasswordInApi). It has no Agentforce permission-set license,Settings:AgentPlatformis an unknown type there, and Setup's Agentforce toggle shows "You don't have the required permissions" even for a System Administrator. DeployingSettings:EinsteinCopilot(enableEinsteinGptCopilot=true) had surfaced theBot/GenAi*metadata types and letsf agent validatepass, which made the org look Agentforce-capable when it wasn't.So in my case the prod 404 means "this org isn't entitled to the authoring API," and the fallback chain converts that into a connect timeout on an internal host plus a bare
fetch failed. Two things would have saved a day here: (1) the fallback treating a connect timeout ontest./dev.as terminal with a message naming the host and suggesting the org may lack the Agentforce feature/license, and (2)sf agent publishdoing a cheap entitlement check first (e.g. thePermissionSetLicenseor theAgentPlatformsettings type existing) rather than relying on the 404.The original report's DE 404 may still be a separate routing issue; I can't reproduce that half.
OPS-21: publish spike results - every agent-graph save returns 401, n…