Debugging Functions
When your function isn’t behaving, the issue is usually in one of these layers:1. Did the inbound message arrive?
Open the dashboard → Senders → your sender → Conversations.- No message visible: the inbound never reached Zavu. Check your sender’s webhook (WhatsApp, Telegram) is wired up. The dashboard shows webhook config and recent delivery attempts.
- Message visible, no reply: inbound is fine, problem is downstream. Go to step 2.
2. Did the agent run?
a) “No executions.”
The inbound arrived but the agent dispatcher didn’t even try to invoke the agent. Causes:b) status: error
The agent ran but something blew up. Fetch the full detail:
errorMessage and errorCode. Common error categories:
c) status: success but no message sent back
The agent succeeded but didn’t reply. Look at responseText in the execution
detail — if it’s empty, the LLM returned nothing useful. Adjust your
systemPrompt to encourage replies, or check that the model isn’t returning
just tool calls without a final response.
3. Is the LLM working?
If executions are failing withprovider_error:
errorMessage. Typical issues:
- Bad model ID: e.g.
openai/gpt-4o-miniworks onprovider: "zavu"(our gateway uses prefixed IDs), but the rawgpt-4o-miniworks onprovider: "openai"directly. - Expired API key (when using
provider: "openai"etc.): rotate the key and update the agent’sapiKey. - Tool schema malformed: rare, but if your
defineToolparameters JSON Schema has a typo, the LLM’s tool-calling step can fail. Validate the schema renders to valid JSON.
4. Did the tool get called?
Once the agent runs successfully but you suspect the tool wasn’t invoked, check the function logs:agents executions shows
success, the LLM chose not to call the tool. Tighten the tool’s
description so the LLM understands when to call it.
5. Is the tool handler buggy?
Once you confirm the tool is being called, isolate it locally:ctx.log calls inside the handler:
npx zavudev deploy and npx zavudev fn logs --tail while triggering the tool from
a real conversation. The [ctx.log] lines appear in the live tail.
Reconcile didn’t pick up my new agent / tool
When you runnpx zavudev deploy, the platform reads your defineAgent /
defineTool declarations from a manifest probe Lambda invocation, then
reconciles the live agent + tools to match. If you see:
- Missing required secret: e.g.
process.env.SENDER_ID!evaluates toundefinedbecause you didn’t set the secret yet. Fix:npx zavudev fn secrets set SENDER_ID <value>thennpx zavudev deploy. - Syntax error in your
index.ts: the bundler caught it earlier but some edge cases get through. Runtsc --noEmitlocally before deploying.
Local invocation cheat sheet
When all else fails
- Add
ctx.log("got here", { someState })aggressively in your handler. npx zavudev deployandnpx zavudev fn logs --tailsimultaneously.- Trigger the flow from a real conversation.
- Read the logs top-to-bottom — the first absence of expected output is the layer that’s failing.
- Open a ticket with the function ID, the
executionIdthat failed, and the timestamp. Support can pull internal traces faster than guessing.
