Kirsch documentation · v0.1.5
Troubleshooting
The failures people meet most often, what you see, and what to do.
When Kirsch will not start, or starts and then cannot send a prompt, begin with kirsch doctor. It prints a line for each result its checks give, and it sends no prompt to a model and makes no network calls, so you can run it at any time. Every line it can print is explained on kirsch doctor checks.
This page covers the messages you see in the program for the failures people meet most often. For installing Kirsch, see Install. For the settings named here, see Configuration.
Common failures
No API key
What you see. Kirsch opens, but it cannot send a prompt. When you send one, an error card titled auth reads:
no API key for endpoint "opencode" (set KIRSCH_OPENCODE_API_KEY or OPENCODE_API_KEY)
On a fresh start, the onboarding screen also shows this, with the variable names. It stays while the transcript holds only notices, such as no previous session — starting fresh, and every notice fits beneath it. A resumed session that already has messages in its transcript does not show the onboarding, so check the key with kirsch doctor, below, instead.
What to do. Set the variable in the shell you start Kirsch from. Use the bare name, or the prefixed one if you already use it for other tools:
export OPENCODE_API_KEY="<your-opencode-key>"
Install has the details. Run kirsch doctor to confirm: the key line should read key found in.
Not in a repository
What you see. When you start Kirsch outside a Git repository, and without --workspace, it stops before the screen opens. Kirsch prints its own message after the program name:
kirsch: Kirsch runs inside a Git repository.
Either cd into a repository, or point Kirsch at a directory explicitly:
kirsch --workspace /path/to/project
This is the output of a run from an empty folder. Kirsch exits with status 1.
doctor says the same thing in its own words: fail repository: not in a Git repository (see repository).
What to do. Either cd into the repository, or pass the folder with --workspace:
kirsch --workspace /path/to/project
With --workspace, a folder that is not a Git repository works. Kirsch starts with its Git features off. Doctor shows this as a warn line for the repository check.
If you are sure you are inside a repository, check that git rev-parse --show-toplevel works there. Kirsch treats any failure of that command as 'not in a repository'.
401 or 403: rejected the API key
What you see. A prompt ends in an error that names the endpoint and the status. Kirsch builds this text for a 401 and for a 403:
provider "<endpoint>" rejected the API key (HTTP <status>); set KIRSCH_<NAME> or <NAME>
<endpoint> is the endpoint's name, opencode by default. <status> is 401 or 403. <NAME> is the endpoint's api_key_env value. The program shows it in an error card titled turn_error, with extra text in front of that message. For the default endpoint the card reads:
agent: model stream: provider_error: auth: provider "opencode" rejected the API key (HTTP 401); set KIRSCH_OPENCODE_API_KEY or OPENCODE_API_KEY
Why it can mislead. The same message appears for a 401 and for a 403, whatever the cause. The key is not always the problem. The endpoint may be wrong, or the account may not have permission to use the model. The message gives no way to tell these apart. So check in this order:
- The key. Run
kirsch doctor, and check thekeyline. Then confirm the variable is set in the shell you start Kirsch from, and that the value is the key you meant. - The endpoint. Check
base_urlandauthfor the endpoint in your config. See Configuration. - The model. Check the
modelsetting. Your account may not allow the model you named.
Doctor cannot show a 401 or 403, because it makes no network calls and never sends a prompt.
Missing ripgrep
What happens. Without ripgrep, search_code uses Kirsch's own search. Search works. If ripgrep is on your PATH but fails during a search, Kirsch also falls back to its own search, rather than failing the tool.
What doctor shows. Warnings, which do not fail doctor:
warn rg: not found on PATH; search_code uses the pure-Go fallback
warn backend: search_code uses pure-go (rg is not on PATH)
These are the lines from the rg and backend checks.
What to do. Install ripgrep with your system's package manager. See Install.
Lock held
What you see. A second Kirsch in the same project does not resume the last session, and it turns off session grants. The program shows these messages. Each line reads as follows:
- In the status bar, as a persistent warning:
another Kirsch is running here - When it would resume on launch:
auto-resume skipped — another Kirsch instance is running(the notice that starts a new session in its place) - When you run
kirsch resume:resume skipped — another Kirsch instance is running
Session grants are switched off in this copy. The policy setting that controls them is explained in Configuration.
If the lock cannot be taken for another reason, the status bar shows lock unavailable — single-instance guard off. In this case the guard is off, and Kirsch runs as normal.
What to do. If you want resume and grants in this project, close the other Kirsch and start again. If you see the warning and expected no other Kirsch to be running, look for one in another terminal. Running kirsch doctor does not take the lock from a copy that is already running.
If the report does not explain it
Run kirsch doctor and read the fail lines first. Fix each one, then run doctor again. A warn line does not stop Kirsch, but it often explains behaviour that looks wrong.
Config and project-context warnings do not show in the program. To see them, turn on the debug log for one run with kirsch --debug, or with KIRSCH_DEBUG=1. The log is written under $XDG_STATE_HOME/kirsch/debug.log, or ~/.local/state/kirsch/debug.log. See Debug log.
These pages describe Kirsch v0.1.5. Source: the doc folder for v0.1.5 on GitHub · releases.