run_local_tests
Execute your solution locally with embedded test invocations to validate correctness before submitting, capturing output and exit code for rapid debugging without using a LeetCode submission.
Instructions
Runs the user's code locally in an isolated subprocess, captures stdout / stderr / exit code, and updates the session's lastLocalRunPassed flag. Use this in the inner loop instead of submit_solution — it costs no LeetCode submission and turns around in seconds. The agent is responsible for including test invocations (e.g. print(Solution().twoSum([2,7,11,15], 9))) in the code passed in. Currently runnable: python3, go, and java.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Complete source code to execute. Should include test invocations that print results / raise on failure. | |
| language | Yes | Language to execute as. Currently runnable: python3, go, java. Other LeetCode languages remain valid for submit_solution. | |
| timeoutMs | No | Optional wall-clock budget in milliseconds. Defaults are language-specific. | |
| titleSlug | Yes | The URL slug of the problem (must match an active session opened with start_problem). |