Skip to content

Troubleshooting

Every problem AgentPlay shows has a code, such as provider.rate_limited, printed in square brackets at the end of the message (SPEC-023). Find the code below for what it means and what to do. The terminal, the replay page, reports and experiment status all use the same codes.

aborted: no result in 0 steps, cost $0.0000 -> runs/game.jsonl
  why: x's model service failed: 404 from https://generativelanguage.googleapis.com/v1beta/openai/
       chat/completions: This model models/gemini-2.5-flash is no longer available to new users.
       Please update your code to use models/gemini-3.8-flash. [provider.model_not_found]
  try: the model "gemini-2.5-flash" is not available to your key: copy an id from the service's
       model list (for OpenAI-compatible services: GET https://generativelanguage.googleapis.com/
       v1beta/openai/models)

The replay page shows the same explanation in a yellow box under the result, with a link to the section below.

Add --debug before a command to see the full technical details of an error.

Before a run

config.invalid

A scenario, experiment or setting is not valid. agentplaykit check scenario.yaml lists every problem with the file and field. Spelling mistakes get a "did you mean" hint.

Default fix: fix the field named.

config.missing_key

An API key variable is not set. Keys come only from environment variables. In PowerShell: $env:OPENROUTER_API_KEY = "..."; in bash: export OPENROUTER_API_KEY=.... Set it in the same terminal you run AgentPlay from. To send no key (local servers), set api_key_env: null.

Default fix: set the environment variable that holds the key, in the same terminal.

config.missing_extra

An optional extra is not installed. Some agents need extra packages: pip install "agentplaykit[anthropic]", "agentplaykit[mcp]", "agentplaykit[hf]" or "agentplaykit[openspiel]" (for OpenSpiel games) (plus PyTorch for the transformers agent). agentplaykit doctor shows what is installed.

Default fix: install the extra the message names, such as pip install "agentplaykit[hf]".

This computer

environment.python

This Python is too old. AgentPlay needs Python 3.8 or newer; the transformers agent needs 3.9 or newer.

Default fix: install Python 3.8 or newer.

environment.runtime_missing

No container runtime is available. Sandbox worlds need Docker or Podman, running. On Windows and macOS, start Docker Desktop. agentplaykit doctor says whether it is ready.

Default fix: install Docker or Podman and start it; only sandbox worlds need it.

environment.not_writable

AgentPlay cannot write its files here. Logs go to runs/ by default. Run from a folder you can write to, or pass --out.

Default fix: run from a folder you can write to, or choose another one with --out.

Model services

provider.auth

The model service rejected the API key. The service rejected the key: it is wrong, expired, or lacks permission (for Hugging Face, a token with "Make calls to Inference Providers"). Check the variable named by api_key_env.

Default fix: check that the key variable holds a valid key for this service, with the access needed.

provider.model_not_found

The model does not exist, or is no longer available. Model ids change, and services retire models (Gemini retired gemini-2.5-flash for new users). List the models your key can use, for an OpenAI-compatible service: GET <base_url>/models with your key, for example in PowerShell: (Invoke-RestMethod -Uri "https://generativelanguage.googleapis.com/v1beta/openai/models" -Headers @{Authorization = "Bearer $env:GEMINI_API_KEY"}).data.id. For Ollama, ollama pull <model> first.

Default fix: use a model id your key can use, copied from the service's model list.

provider.rate_limited

The model service is limiting how fast you can send requests. Free models have tight limits. OpenRouter's "Provider returned error" with 429 usually means the upstream provider (named in the message) is rate-limiting a :free model. Wait a minute, try another :free model, add credits to raise free limits, raise the agent's retries, or run fewer games at once (max_parallel_per_provider in experiments).

Default fix: wait a minute and try again, run fewer games at once, or raise the agent's retries.

provider.quota

Your quota or credits at the model service are used up. Your credits or daily quota are used up. Add credits, wait for the quota to reset, or switch to a local model (Ollama, or the transformers agent on Colab).

Default fix: add credits or wait for the quota to reset, or use another model.

provider.bad_request

The model service rejected the request. The service did not accept the request: often an option the model does not support (for example json_mode or tool_calls), or a base_url that is not the API address (it usually ends in /v1).

Default fix: check the agent's config (model id and options) against the service's documentation.

provider.no_structured_output

The model service cannot limit replies to the legal moves. The agent has constrain: true, but the server rejected the structured output request (response_format with a JSON Schema). Older servers, and some models behind a gateway, do not support it; for Ollama, you need version 0.5 or later.

Default fix: remove "constrain: true" from the agent's config, or update the server to a version that supports structured output.

provider.unavailable

The model service had an error on its side. The service had an error (5xx) or is overloaded. AgentPlay retries; if it still fails, run it again later.

Default fix: wait and run it again later; the service may be down or overloaded.

provider.unreachable

AgentPlay cannot reach the model service. AgentPlay could not connect. Check base_url; for local servers, start them (ollama serve). A Colab tunnel address changes every time the notebook restarts.

Default fix: check the address (base_url), the network, and that a local server is running.

provider.timeout

The model service did not answer in time. No answer in time. Large or local models can be slow, especially on CPU: raise the agent's timeout_s, or limits.max_seconds for the whole run.

Default fix: run it again, or raise the agent's timeout_s; large or local models can be slow.

Agents

agent.format

The agent's reply could not be read. The model's reply had no readable JSON with an "action". Small models often do this. Set json_mode: true, add wrap: [format_hints], lower temperature, or use a larger model. agentplaykit test world.py --sloppy shows how your world copes with these mistakes.

Default fix: set json_mode: true, add wrap: [format_hints], or use a larger model; the reply needs an "action".

agent.crashed

The agent's code failed. Code in the agent (or a wrapper) raised an error. The message names the agent or wrapper; agentplaykit test my_agent.py checks an agent file.

Default fix: fix the agent's (or wrapper's) code; run agentplaykit test on its file.

Playing yourself

human.no_terminal

A human player has no terminal to type moves in. A scenario seats a person (use: human or --human), but standard input is not a terminal: the command's input comes from a pipe, a file or a script. Run it in a terminal window, or add --live to play in the browser instead. See Play it yourself.

Default fix: run it in a terminal, or add --live to play in the browser.

human.not_here

A human player cannot be seated here. Experiments, benchmark runs, tournaments and model check play many games, often in parallel, and measure agents, not people, so they refuse an agent with use: human. Play a game yourself with agentplaykit play.

Default fix: use agentplaykit play <scenario> --human to play a game yourself.

Worlds

world.rejected

The world rejected a move. The world said the move was illegal, and the agent got the reason. Several in a row end in a forfeit (limits.max_illegal, default 3). The world's message says what a valid move is; wrap: [format_hints] shows the model an example; limits.count_rejected_steps: false stops rejected replies from using up max_steps.

Default fix: add wrap: [format_hints] to the agent, set json_mode: true, or raise limits.max_illegal.

world.bug

The world's code failed. The world's code raised an error; the message names the file and line. agentplaykit test my_world.py checks a world against the rules.

Default fix: fix the world's code at the file and line shown; run agentplaykit test on its file.

Evaluators and judges

evaluator.invalid_result

An evaluator gave a result that is not valid. For the judge: the judge model did not give a verdict in the right shape, even after a second try with an example. Use a larger judge model than the players, and json_mode: true.

Default fix: for the judge: use a larger model or json_mode: true; for your own: return eval_result().

evaluator.bug

An evaluator's code failed. An evaluator's code raised an error; the message names the file and line. The run itself is not affected.

Default fix: fix the evaluator's code; the run itself is not affected.

Limits

limit.steps

The run reached max_steps. The run used up limits.max_steps. Raise it; if many steps were rejected replies, set limits.count_rejected_steps: false.

Default fix: raise limits.max_steps.

limit.time

The run reached max_seconds. The run took longer than limits.max_seconds. Raise it for slow or local models.

Default fix: raise limits.max_seconds.

limit.cost

The run reached max_cost_usd. The run spent limits.max_cost_usd. Raise it if you expect a longer run.

Default fix: raise limits.max_cost_usd.

limit.tokens

The run reached max_tokens. An agent reports no cost (no price set), so the token cap applied instead. Set the agent's price from the provider's price list, or raise limits.max_tokens.

Default fix: set the agent's price so the cost limit applies, or raise limits.max_tokens.

Runs

run.interrupted

The run was stopped. The run was stopped (Ctrl+C). The log ends with run_end; run it again to play to the end. Experiments resume where they stopped.

Default fix: run it again to play it to the end.

Bugs

internal.bug

AgentPlay hit an unexpected problem. Something unexpected happened inside AgentPlay. Please report it at https://github.com/thetejasmagade/agentplay/issues with the command you ran and the output of agentplaykit --debug <same command>.

Default fix: please report it at https://github.com/thetejasmagade/agentplay/issues with the command you ran; add --debug to see the details.