Validation Debugging
Pre-validate Code
To see why a script is refused, run the steps of the enclave yourself: pre-scan the script as it was written, transform it, then validate the transformed code. (AgentScript allows a top-levelreturn and await, which only parse once the script is wrapped.)
globals and toolNamespaces included), so a script that uses them is refused by this stand-alone validator and accepted by run(). The issues run() itself found are in result.error.data.issues.
View Transformed Code
See what the code looks like after transformation:Runtime Debugging
Use Console Logging
A script may useconsole when the enclave has a consoleHandler, which receives each call as (level, message). The result has no captured output: collect the lines in the handler.
consoleHandler, console is allowed only at PERMISSIVE and writes to the host process console.
Track Tool Calls
Log all tool calls in your handler:Inspect Execution Stats
Error Debugging
Detailed Error Information
Error Code Reference
With
doubleVm: { enabled: false } the code of a failing script is VM_EXECUTION_ERROR. See Error Codes.
Scoring Gate Debugging
Log Score Details
Test Scoring Separately
callTool calls only, unless you pass it toolNamespaces.
Performance Debugging
Measure Tool Call Latency
Profile Memory Usage
Testing Scripts
Create a Test Harness
Related
- Common Errors - Error reference
- FAQ - Frequently asked questions