A common debugging mistake is deploying five times to fix the same bug, when a single log line plus one deployment would have shown you the root cause immediately.If you’re patching against test failures rather than the actual return shape, stop and add a console.log first — then deploy once.
Log the actual value — not a guess, the real thing:
async execute(input: any) { const results = await Data.search('articles', input.query, 5, 0.7); // ✅ Log the raw return value FIRST console.log('Data.search result:', JSON.stringify(results, null, 2)); // Don't touch the rest of the code yet return results.map(entry => ({ id: entry.id, title: entry.title }));}
Log the entire object so you see the actual shape, not what you assumed it would be.
2
Push to sandbox (not production)
lua push
Or use sandbox mode for even faster iteration — no push needed:
lua chat# Select "Sandbox" when prompted
In sandbox mode, lua chat compiles and uses your local code directly. Use this for rapid iteration before committing to a push.
3
Send ONE test message
# Non-interactive: send a single message and exitlua chat -m "search for thriller movies"
Or in interactive mode:
lua chat# Type your test message, then Ctrl+C
Send the minimum message needed to trigger the tool. Don’t run a full conversation — you need one clean execution to inspect.
4
Check logs immediately
# See the most recent 10 skill executionslua logs --type skill --limit 10# Filter to a specific skill by namelua logs --type skill --name my-skill --limit 5# JSON output for piping/scriptinglua logs --type skill --json | head -100
Your console.log output appears in the log message body. Look for the 🔍 DEBUG or ℹ️ INFO entries — they contain your logged values.Example output:
Set LUA_NO_HINTS=true (or yes) in your shell profile or CI environment to disable hints globally. This is useful in CI/CD pipelines that capture only command output.
[DEBUG] Data.search result type: object array[3][DEBUG] Data.search result: [{"id":"entry_abc","data":{"title":"Inception"},"score":0.92}]
results.data would be undefined — there is no .data wrapper on the array. Use results[0].data.title for the entry payload, or results[0].title via the Proxy shortcut.
Once the bug is fixed, clean up your logs. Production logs are visible to your whole team and consume log storage.
// ❌ Don't leave these in production codeconsole.log('[DEBUG] raw result:', JSON.stringify(results));// ✅ Leave meaningful operational logsconsole.log(`Processed ${results.length} search results for query: "${input.query}"`);