Cancel the agent candidate plan

Cancel an unconfirmed agent candidate.

HTTP
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agent-builder/candidates/{agent_id}/candidate-versions/{candidate_version}/cancel

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First generate the agent candidate plan or regenerate the agent candidate plan to obtain the candidate version and source_digest. Prepare the personal access token, target workspace ID, agent ID, and candidate version that can access the target workspace.

Request body

Replace $WORKSPACE_ID, $AGENT_ID, $CANDIDATE_VERSION, $CLOUDSIGMA_API_KEY, $SOURCE_DIGEST in the example with actual values.

Shell
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agent-builder/candidates/$AGENT_ID/candidate-versions/$CANDIDATE_VERSION/cancel" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "source_digest": "'"$SOURCE_DIGEST"'"
  }'

Parameter

Type

Required

Description

workspace_id

string

Yes

workspace ID.

agent_id

string

Yes

agent ID.

candidate_version

string

Yes

Release Candidate.

Request body

Field

Type

Required

Description

source_digest

string

Yes

A summary of the current candidate response. Cannot be empty.

Successful response

JSON
{
  "code": 0,
  "data": {
    "render_type": "agent_candidate",
    "workspace_id": "ws_01",
    "agent_id": "agent_01",
    "candidate_version": "0.2.0",
    "load_version": "0.2.0",
    "source_digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
    "mode": "create",
    "status": "superseded",
    "display": {
      "agent_name": "产品助手",
      "agent_id": "",
      "candidate_version": "0.2.0",
      "load_version": "0.2.0",
      "model": "",
      "tools": null,
      "skills": null,
      "knowledge_bases": null,
      "catalog_files": [],
      "channel_bindings": [],
      "agent_md": "",
      "change_reason": ""
    },
    "resolved_refs": {},
    "package_summary": {
      "manifest_path": "",
      "prompt_path": "",
      "file_paths": []
    }
  }
}

Field

Type

Description

data.render_type

string

Display type. Fixed to “agent_candidate”.

data.workspace_id

string

The workspace, agent and candidate version to which the candidate belongs.

data.agent_id

string

The workspace, agent and candidate version to which the candidate belongs.

data.candidate_version

string

The workspace, agent and candidate version to which the candidate belongs.

data.load_version

string

Load version.

data.source_digest

string

A summary of the content that was disqualified.

data.mode

string

processing mode. Value: create, revise.

data.status

string

Superseded on success. Fixed to “superseded”.

data.display

object

Candidate display content, diagnostics, and resolved resource references.

data.display.agent_name

string

agent name.

data.display.agent_id

string

agent ID.

data.display.candidate_version

string

Release Candidate.

data.display.load_version

string

Load version.

data.display.model

string

model.

data.display.tools

array of string or null

Tool collection.

data.display.skills

array of string or null

Skill set.

data.display.knowledge_bases

array of string or null

knowledge base reference.

data.display.catalog_files

array of object

Catalog file reference.

data.display.catalog_files[].workspace_id

string

The workspace ID to which it belongs.

data.display.catalog_files[].volume_id

integer

Volume ID.

data.display.catalog_files[].file_id

string

File ID.

data.display.channel_bindings

array of object

Channel binding.

data.display.channel_bindings[].tool_name

string

Tool name.

data.display.channel_bindings[].tool_workspace_id

string

Tool source workspace ID.

data.display.channel_bindings[].skill_name

string

Skill name.

data.display.channel_bindings[].skill_workspace_id

string

Skill source workspace ID.

data.display.channel_bindings[].provider

string

Provider.

data.display.channel_bindings[].workspace_id

string

The workspace ID to which it belongs.

data.display.channel_bindings[].instance_id

string

Channel instance ID.

data.display.agent_md

string

agentMarkdown text.

data.display.change_reason

string

Reason for change.

data.diagnostics

array of object

Candidate display content, diagnostics, and resolved resource references. At least 1 items.

data.diagnostics[].severity

string

Diagnostic level.

data.diagnostics[].code

string

Error or diagnostic code.

data.diagnostics[].message

string

Message content.

data.diagnostics[].field_path

string

Field path.

data.diagnostics[].resource_ref

string

Resource references.

data.resolved_refs

object

Candidate display content, diagnostics, and resolved resource references.

data.resolved_refs.model

object

model.

data.resolved_refs.model.name

string

Name.

data.resolved_refs.model.id

string

logo.

data.resolved_refs.model.workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.model.requested_name

string

The name when requested.

data.resolved_refs.tools

array of object

Tool collection.

data.resolved_refs.tools[].name

string

Name.

data.resolved_refs.tools[].id

string

logo.

data.resolved_refs.tools[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.tools[].requested_name

string

The name when requested.

data.resolved_refs.skills

array of object

Skill set.

data.resolved_refs.skills[].name

string

Name.

data.resolved_refs.skills[].id

string

logo.

data.resolved_refs.skills[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.skills[].requested_name

string

The name when requested.

data.resolved_refs.skill_tools

array of object

Skill tool mapping.

data.resolved_refs.skill_tools[].skill_name

string

Skill name.

data.resolved_refs.skill_tools[].skill_id

string

Skill ID.

data.resolved_refs.skill_tools[].skill_workspace_id

string

Skill source workspace ID.

data.resolved_refs.skill_tools[].tool_name

string

Tool name.

data.resolved_refs.skill_tools[].tool_id

string

Tool ID.

data.resolved_refs.skill_tools[].tool_workspace_id

string

Tool source workspace ID.

data.resolved_refs.knowledge_bases

array of object

knowledge base reference.

data.resolved_refs.knowledge_bases[].name

string

Name.

data.resolved_refs.knowledge_bases[].id

string

logo.

data.resolved_refs.knowledge_bases[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.knowledge_bases[].requested_name

string

The name when requested.

data.resolved_refs.catalog_files

array of object

Catalog file reference.

data.resolved_refs.catalog_files[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.catalog_files[].volume_id

integer

Volume ID.

data.resolved_refs.catalog_files[].file_id

string

File ID.

data.resolved_refs.channel_bindings

array of object

Channel binding.

data.resolved_refs.channel_bindings[].tool_name

string

Tool name.

data.resolved_refs.channel_bindings[].tool_workspace_id

string

Tool source workspace ID.

data.resolved_refs.channel_bindings[].skill_name

string

Skill name.

data.resolved_refs.channel_bindings[].skill_workspace_id

string

Skill source workspace ID.

data.resolved_refs.channel_bindings[].provider

string

Provider.

data.resolved_refs.channel_bindings[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.channel_bindings[].instance_id

string

Channel instance ID.

data.package_summary

object

Summary of candidate packages.

data.package_summary.manifest_path

string

Manifest file path.

data.package_summary.prompt_path

string

Prompt word file path.

data.package_summary.file_paths

array of string

List of file paths.

Error response

The candidate status may have changed before the response is returned. When HTTP 500 is encountered, the candidate status is first queried, and the cancellation operation cannot be judged to have been revoked based on this.

JSON
{
  "code": 4,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

The request contains unknown fields or is invalid source_digest. Recommendation: Check the request body.

401

6(UNAUTHENTICATED)

Valid identity credentials are missing. Recommendation: Check the API Key.

403

5(PERMISSION_DENIED)

The current identity does not have the permission to cancel candidacy. Suggestion: Check workspace and agent authorization.

404

3(NOT_FOUND)

The release candidate does not exist. Recommendation: Check out the release candidates.

409

4(ALREADY_EXISTS)

Summary does not match or status cannot be canceled. Duplicate cancellation of digest matches returns the status quo.

500

1(INTERNAL)

An internal error occurred while canceling the candidate. Suggestion: Check the current status first. Do not automatically resubmit.

503

15(UNAVAILABLE)

Agent building or authorization services are temporarily unavailable. Suggestion: Check the current status first. Do not automatically resubmit.

Last updated on