Command line
How blaise-agent listen finds and uses blaise.yml.
Finding the configuration
blaise-agent looks for its configuration in this order:
- the file given with
--config(-C), which must end in.ymlor.yaml; - otherwise
blaise.yml, thenblaise.yaml, in the working directory.
A --config that is not YAML stops the command with an error. Without any configuration, login,
logout and status still work; listen has nothing to run and says so.
What blaise.yml can set
The server and log sections set the options of the same meaning. A flag or environment variable
given explicitly wins.
blaise.yml | Option |
|---|---|
server.url | --api-url, BLAISE_API_URL |
server.token | --token, BLAISE_RUNNER_TOKEN |
log.level | --log-level |
log.format | --log-format |
See the configuration reference for all keys.
listen
blaise-agent listenEach accepted session runs through the plugs of the blaise.yml. At startup listen resolves every
use:, imports the plugs and checks their inputs and ids. All the problems are reported together
and the runner does not start:
Cannot load the plugs of /work/blaise.yml:
- plug 1: `blaise:shel` is not bundled with the runner and `@blaiseagent/plugs-shel` is not installed; ...How a session runs
Each accepted session runs in a process of its own, so a plug that crashes or leaks cannot take the
listener, or other sessions, down. The process is blaise-agent run, a hidden command: listen
starts it with an IPC channel, sends it the resolved configuration and the session's start context
over that channel (so nothing sensitive appears on a command line), and logs the outcome it reports
back. It works the same in development, when installed as a package and when compiled.
Plugs see the runner's environment through ctx.runnerEnv, without BLAISE_RUNNER_TOKEN, and
the processes they start on the local host begin from that environment.
When a session ends
The runner ends a run when Blaise stops it with a stop directive; it has no timers of its own.
When the session goes idle, Blaise stops the run with mayResume: true and the session is paused.
The runner exits, and the next message starts a new blaise-agent run to resume it. When the
session is over (closed, completed, timed out or failed) the plugs are paused and then torn down in
the same process. See Session settings and states.
At startup listen asks Blaise for the agent's idle policy. With the policy to pause idle sessions
it refuses to start if a plug cannot resume:
Cannot start with /work/blaise.yml:
- plug 4 (acme/one-shot) is not resumable; set the agent's idle policy to "end" in Blaise, or remove the plug