Skip to content

feat: initial implementation of createAgent component#3832

Draft
gaga1307 wants to merge 6 commits intomainfrom
feature/gradient-ai-digitalocean
Draft

feat: initial implementation of createAgent component#3832
gaga1307 wants to merge 6 commits intomainfrom
feature/gradient-ai-digitalocean

Conversation

@gaga1307
Copy link
Copy Markdown
Collaborator

@gaga1307 gaga1307 commented Mar 30, 2026

Related to #3766

The component creates and deploys a GradientAI agent as part of a workflow — it handles workspace assignment, optional provider API key registration (Anthropic/OpenAI), agent creation, deployment, and API key generation. It polls until the agent reaches running status and emits the agent object on the default output channel.

Execution Flow

  1. Create workspace (if workspaceSource = "new")

    • POST /v2/gen-ai/workspaces
  2. Register provider API key (if anthropicKey or openAIKey is set in the integration configuration)

    • Anthropic → POST /v2/gen-ai/anthropic/keys → sets anthropic_key_uuid
    • OpenAI → POST /v2/gen-ai/openai/keys → sets open_ai_key_uuid
    • Llama/others → skipped (no key needed)
  3. Create agentPOST /v2/gen-ai/agents

    • Fields: name, instruction, model_uuid, workspace_uuid, region, project_id, tags, knowledge_base_uuid, provider key UUID
  4. Update settings (if useDefaultSettings = false)

    • PUT /v2/gen-ai/agents/{uuid}
    • Fields: temperature, max_tokens, top_p, k, retrieval_method, provide_citations
  5. Attach guardrailsPOST /v2/gen-ai/agents/{uuid}/guardrails (for each)

  6. Add agent routesPOST /v2/gen-ai/agents/{uuid}/routes (for each child agent)

  7. Poll every 10s (up to 10min timeout)

    Agents auto-deploy on creation — no separate deploy call needed

    • Running/Active → creates agent API key, stores in metadata, emits agent on default output channel
    • Error → fails with error
    • Other → schedules another poll

Known Issue

Execution fails at step 3 (Create agent) with:

failed to create agent: request got 404 code: {"id":"not_found","message":"failed to create agent"}

Investigation

The same failure was reproduced with a direct curl call:

curl -X POST
-H "Content-Type: application/json"
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN"
"https://api.digitalocean.com/v2/gen-ai/agents"
-d '{
"name": "api-create",
"model_uuid": "95ea6652-75ed-11ef-bf8f-4e013e2ddde4",
"instruction": "be a weather reporter",
"description": "weather-agent",
"project_id": "37455431-84bd-4fa2-94cf-e8486f8f8c5e",
"tags": [
"tag1"
],
"region": "tor1",
}'

What Was Tried

  • New API token with Full Access
  • New API token with genai-specific scopes
  • Activated Gradient AI ADK Feature Preview
  • New project ID
  • Different models (Llama, Anthropic)
  • Minimal payload (required fields only)

Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
@superplanehq-integration
Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

@gaga1307 gaga1307 changed the title feat:initial implementation of createAgent component feat: initial implementation of createAgent component Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants