Skip to main content
You can test an actor on your machine, for free, with no account and no network, and two commands do it. cowboy test runs the project’s pytest suites, whose tests call the actor’s handlers in memory, through SimulatedChain. cowboy run runs one handler of the built actor and keeps the actor’s state between runs. This page builds a small help desk actor that asks a model a question, then tests it both ways. First, install the CLI.

1. Create the project

Output

2. Write the actor

Replace actors/helpdesk/main.py with:
ask sends the question to a model as a runner job and continues when the answer comes back. Only the owner can start the daily reset, and only the schedule can run reset_count. Build your first actor explains these pieces.

3. Write the tests

Replace tests/test_helpdesk.py with:

4. Run them

Output
cowboy test also checks each actor against the rules cowboy check applies, so a test can’t pass on code a deploy would refuse.

5. Run handlers with cowboy run

Output of the ask run
The CLI shows two readings of what the handler returned. CBOR is the right one, and the stray first letter in the text reading is an encoding byte. --stub-llm answers the next runner.llm call, so ask finishes in one run with no model. Each run saves the state, so answer sees what ask saved. You can try the failure path the same way, by making the job fail:
Output

Next