Skip to content

Agents SDK: API examples in skill references caused incorrect usage #3

@nev-offload

Description

@nev-offload

Problem

When building the AI Chat page for the showcase app, the subagent made 3 API mistakes despite having the skill references available:

Bug 1: Wrong parameter name for createConversation

// ❌ What was written
base44.agents.createConversation({ agentName: 'showcase_assistant' })

// ✅ Correct
base44.agents.createConversation({ agent_name: 'showcase_assistant' })

Bug 2: Wrong subscribeToConversation signature

// ❌ What was written
base44.agents.subscribeToConversation({
  conversationId: conversation.id,
  onMessage: (message) => { ... }
})

// ✅ Correct
base44.agents.subscribeToConversation(conversation.id, (updatedConversation) => { ... })

Bug 3: Wrong addMessage signature

// ❌ What was written
base44.agents.addMessage({ conversationId, message: input })

// ✅ Correct
base44.agents.addMessage(conversation, { role: 'user', content: input })

Analysis

Looking at the base44-agents.md reference in the skill, the correct signatures ARE documented:

  • createConversation(params) with example showing agent_name
  • subscribeToConversation(id, onUpdate?) with positional params
  • addMessage(conversation, message) with conversation object + message object

So the docs are correct, but the agent still hallucinated different patterns. This suggests:

  1. The WRONG vs CORRECT table pattern used for other modules (auth, entities, integrations, functions) is missing for agents. The agents module doesn't have an explicit "don't hallucinate" table like the others do in SKILL.md.

  2. Adding a WRONG vs CORRECT table for agents in the main SKILL.md (like exists for auth, functions, integrations, entities) would likely prevent these mistakes.

Suggested Fix

Add to the SKILL.md ⚠️ CRITICAL: Do Not Hallucinate APIs section:

### Agents - WRONG vs CORRECT

| ❌ WRONG (hallucinated) | ✅ CORRECT |
|------------------------|-----------|
| \`createConversation({ agentName })\` | \`createConversation({ agent_name })\` |
| \`subscribeToConversation({ conversationId, onMessage })\` | \`subscribeToConversation(id, onUpdateCallback)\` |
| \`addMessage({ conversationId, message })\` | \`addMessage(conversation, { role, content })\` |
| \`getConversation({ id })\` | \`getConversation(id)\` |

Origin

All 3 bugs found during QA of the Base44 showcase app's AI Chat page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions