Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

sf agent test run fails with "RETRY" enum error during status polling

Open
#3,523 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
node.js, typescript
Domain
cli, testing-qa

Research direction

Start with @salesforce/agents/src/types.ts and inspect the TestStatus definition used by AgentTester.results during polling. Reproduce the documented sf agent test run --wait command, then verify that a RETRY status is handled and polling returns test results without the enum error.

Written by the indexing model from the issue text.

Description

area:afdx bug owned by another team
Summary

sf agent test run --wait fails during status polling with:
INTERNAL_SERVER_ERROR: The specified enum type has no constant with the specified name: RETRY

Steps To Reproduce
  1. sf agent test create --spec specs/test.yaml --api-name MyTest -o <org>
  2. sf agent test run --api-name MyTest -o <org> --wait 5 --json
Expected result

Test polls and returns results

Actual result

Crashes with RETRY enum error

Additional information

Stack trace

{
"name": "INTERNAL_SERVER_ERROR",
"message": "The specified enum type has no constant with the specified name: RETRY",
"exitCode": 1,
"context": "AgentTestRun",
"data": {
"errorCode": "INTERNAL_SERVER_ERROR",
"message": "The specified enum type has no constant with the specified name: RETRY"
},
"stack": "INTERNAL_SERVER_ERROR: The specified enum type has no constant with the specified name: RETRY\n at SfCommandError.from (file:///opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/SfCommandError.js:48:16)\n at AgentTestRun.catch (file:///opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/sfCommand.js:332:47)\n at AgentTestRun.catch (file:///opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@salesforce/plugin-agent/lib/commands/agent/test/run.js:117:27)\n at AgentTestRun._run (/opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/command.js:186:29)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Config.runCommand (/opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/config/config.js:446:25)\n at async run (/opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/main.js:97:16)\n at async file:///opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/bin/run.js:15:1",
"cause": "INTERNAL_SERVER_ERROR: The specified enum type has no constant with the specified name: RETRY\n at HttpApi.getError (/opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@jsforce/jsforce-node/lib/http-api.js:315:15)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async /opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@jsforce/jsforce-node/lib/http-api.js:127:33\n at async AgentTester.results (/opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@salesforce/agents/lib/agentTester.js:127:25)\n at async Object.poll (/opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@salesforce/agents/lib/agentTester.js:89:45)\n at async doPoll (/opt/atlassian/pipelines/agent/build/node_modules/@salesforce/cli/node_modules/@salesforce/core/lib/status/pollingClient.js:62:26) {\n data: {\n errorCode: 'INTERNAL_SERVER_ERROR',\n message: 'The specified enum type has no constant with the specified name: RETRY'\n },\n errorCode: 'INTERNAL_SERVER_ERROR'\n}",
"warnings": [],
"code": "1",
"status": 1,
"commandName": "AgentTestRun"
}

Root Cause

TestStatus type in @salesforce/agents/src/types.ts doesn't include 'RETRY':
type TestStatus = 'NEW' | 'IN_PROGRESS' | 'COMPLETED' | 'ERROR' | 'TERMINATED'

But the API returns status: "RETRY" during polling.

Impact
  • Blocks ALL agent testing via CLI
  • No workaround available
  • Affects both stable and nightly builds
  • --api-version flag doesn't help
System Information
CLI:
@salesforce/cli/2.129.2 darwin-x64 node-v20.19.3

Plugin Version:
@oclif/plugin-autocomplete 3.2.41 (core)
@oclif/plugin-commands 4.1.40 (core)
@oclif/plugin-help 6.2.38 (core)
@oclif/plugin-not-found 3.2.75 (core)
@oclif/plugin-plugins 5.4.59 (core)
@oclif/plugin-search 1.2.39 (core)
@oclif/plugin-update 4.7.23 (core)
@oclif/plugin-version 2.2.38 (core)
@oclif/plugin-warn-if-update-available 3.1.55 (core)
@oclif/plugin-which 3.2.44 (core)
@salesforce/cli 2.129.2 (core)
agent 1.32.5 (core)
apex 3.9.13 (core)
api 1.3.11 (core)
auth 4.3.1 (core)
code-analyzer 5.10.2 (user)
data 4.0.80 (core)
deploy-retrieve 3.24.16 (core)
info 3.4.111 (core)
limits 3.3.80 (core)
marketplace 1.3.10 (core)
org 5.9.72 (core)
packaging 2.25.10 (core)
schema 3.3.98 (core)
settings 2.4.60 (core)
signups 2.6.56 (user)
sobject 1.4.86 (core)
telemetry 3.8.3 (core)
templates 56.11.0 (core)
trust 3.7.114 (core)
user 3.8.0 (core)
asp 0.0.0 (link) /Users/gimli/Documents/dev/workspace/altify-qa-deployment/asp
SF ENV. VARS.
SF_AUTOUPDATE_DISABLE,true
SF_DISABLE_AUTOUPDATE,true
SF_UPDATE_INSTRUCTIONS,Use "npm update --global @salesforce/cli" to update npm-based installations.
Windows: false
Shell: zsh
Channel: stable

Diagnostics

✅ pass - salesforcedx plugin isn’t installed
❌ fail - you have at least one linked plugin
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.yarnpkg.com
✅ pass - [@salesforce/plugin-trust] can ping: https://registry.npmjs.org/
✅ pass - using latest or latest-rc CLI version
❌ warn - [@salesforce/plugin-deploy-retrieve] sourceApiVersion matches apiVersion
✅ pass - can access: https://test.salesforce.com
✅ pass - can access: https://appexchange.salesforce.com/services/data
✅ pass - can access: https://developer.salesforce.com/media/salesforce-cli/sf/channels/stable/sf-win32-x64-buildmanifest
❌ fail - [@salesforce/plugin-auth] CLI supports v2 crypto

Dominant language
No language data
Stars
571
Forks
80
Avg merge
5d 22h
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from forcedotcom/cli

All issues in forcedotcom/cli

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.