Run on the workstation, on pydantic-ai with cloud and local models
The daemon moves from the Lightsail host to WSL on the workstation (EVAI), where the RTX 4090 can run local models and the data platform and home cluster live. It reaches the core host over one multiplexed SSH connection: each health check pipes probe.py to the host's python3 and gets Kuma, disk, memory, OOM kills, restarts and reboots back in one snapshot. The agent edits and commits core's live checkout there, as semprini-core's rules expect, and the service desk still runs on the host. Off the host, it now notices when the host itself stops answering. The agent runs in-process with pydantic-ai instead of Claude Code headless. Model profiles (anthropic, ollama, any OpenAI-compatible server) are routed per kind of task: an unreachable model hands over at once (FallbackModel), a run that fails as a run restarts on the next profile. The result is a typed envelope; conversations persist as message histories; cancel stops the command in flight; each reply names the model and its cost. `model` in Matrix pins a room to a profile; --try-model checks a model calls tools and uses what they return (qwen3-coder does not; GLM-4.7-Flash, the local default, does). Cloud runs now need an API key (--set-api-key) and are billed per token; the subscription token was for Claude Code only. Back-off is per kind of task, so a cloud-only upgrade waiting on a key does not stall work the local model can do. A queued task held back by a hold no longer spins the main loop. --hold and --resume stay stdlib-only, so sync-to-host.sh can still hold the daemon from the host's checkout; the daemon reads the host's hold each minute. install.sh sets up WSL and retires the host's service: one Matrix bot, one daemon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
99ebfcfb38
commit
61dca2c3ca
13 files changed
+3042
-822
No files matched your search
@@ -1,22 +1,22 @@
|
||||
[Unit]
|
||||
Description=semprini-core autonomous stack maintenance agent
|
||||
Description=semprini autonomous stack maintenance agent
|
||||
Documentation=https://git.semprini.me/paul/semprini-maintainer
|
||||
After=docker.service network-online.target
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
Requires=docker.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
# A template: install.sh fills in @USER@, @HOME@ and @DIR@.
|
||||
# NOT root: Claude Code refuses --permission-mode bypassPermissions as root.
|
||||
# Runs in WSL on the operator's workstation. It reaches the core host over
|
||||
# SSH with this user's key, Ollama on Windows over WSL's network, and Windows
|
||||
# itself through WSL interop (powershell.exe).
|
||||
User=@USER@
|
||||
Group=@USER@
|
||||
# docker: drive the stack. adm: read the kernel log for OOM kills.
|
||||
SupplementaryGroups=docker adm
|
||||
WorkingDirectory=@DIR@
|
||||
Environment=HOME=@HOME@
|
||||
Environment=PATH=@HOME@/.local/bin:/usr/local/bin:/usr/bin:/bin
|
||||
ExecStart=/usr/bin/python3 @DIR@/maintainer.py --config @DIR@/config.json
|
||||
Environment=PYDANTIC_AI_NO_BANNER=1
|
||||
ExecStart=@DIR@/.venv/bin/python @DIR@/maintainer.py --config @DIR@/config.json
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
# Stopping kills the whole cgroup, an agent run in progress included.
|
||||
|
||||
Reference in new issue
Block a user