- Instanz-Modus: nur eine persoenliche Anmeldung (Setup-Token/OAuth) bindet sich an das
erste Profil, ein API-Key ist gemessen und wird von allen Profilen unter den Tageslimits
geteilt. Die Bindung passiert jetzt wirklich beim Einreihen eines Jobs (jobs.enqueue),
vorher gab es sie nur in den Tests.
- HTTP-Adapter: 429/500/502/503/504/529 werden zweimal mit kurzer Pause wiederholt, ein
4xx nie. retryDelayMs fuer Tests.
- Payload: Warm-up-Saetze wie in progression.js aus readSession/stalls, done/planned,
Top-Satz, setsByBodyPart und workingWeights herausgefiltert; in vollen Sessions als
warmup:true markiert, common.md sagt dem Modell, was das ist.
- Admin-Karte: .field im Card hat jetzt eine sichtbare Flaeche, die Limit-Zahlenfelder
sind echte Felder statt weisser Browser-Boxen; Text zu 'Whose account pays' unterscheidet
API-Key und persoenliche Anmeldung.
- Neuer Test e2e-apikey: Key ueber die Admin-Routen einlegen, Modelle listen, Review durch
die echte Queue gegen einen lokalen Anthropic/OpenAI/Gemini-Stand-in, inkl. Header,
Cache-Block, Schema, Retry und Auth-Fehler. api 150, frontend 1029, mcp 45 gruen.
Vier Provider, die nur HTTPS sprechen — kein Agent-SDK, keine CLI, kein coach-User:
sie laufen auf dem Default-Image. Eine Factory (core/adapters/http.js) bildet jede
Antwort auf den bestehenden {code,text,stderr}-Vertrag ab, damit die Pipeline nichts
Neues lernen muss: 401/403 werden 'auth', ein abgeschnittenes JSON 'provider' statt
die einzige Reparaturrunde zu verbrennen. Ollama/LM Studio/vLLM/OpenRouter laufen
ueber dieselbe Chat-Completions-Form mit eigener Basis-URL und optionalem Key.
coach.json haelt Key, Modell und Bindung jetzt PRO Provider — Wechseln wirft nichts
mehr weg; die flache v1.2.11-Datei wird einmalig hochgehoben. Das Privilege-Gate
fragt den Adapter, ob er ueberhaupt einen Prozess startet. Die Admin-Karte zeigt
endlich den API-Key-Knopf auch bei Anthropic, listet Modelle vom Endpunkt und
nimmt eine Basis-URL entgegen.
The Agent SDK adapter, its dependency, and the packaging that keeps both out
of the image an owner gets when they never wanted the Coach.
api/Dockerfile builds two targets. The default one runs `npm ci --omit=optional`
and ships no AI runtime at all (~158 MB); `--target coach` drops that flag and
adds @anthropic-ai/claude-agent-sdk (~455 MB). The SDK's runtime ships as a
per-platform package, so on this Alpine base the lockfile resolves the musl
build — the kind of thing that only fails on somebody else's machine, which is
why the new api-image CI job builds *and runs* both targets rather than merely
building them.
Both targets now create the unprivileged `coach` user. That is not a Claude
detail: canDropPrivileges() fails closed, so without it every job is refused —
including the fixture provider that exists so the loop can be walked before an
account is connected. The shipped image could not run one.
The adapter imports the SDK lazily, so an absent runtime stays an ordinary
reportable state rather than a boot crash: check() says so, isConnected() goes
false, and /api/config carries no coach key.
Four SDK options are what make this safe next to ./data — tools: [] (no Read,
no Bash, no Grep), settingSources: [], skills: [], strictMcpConfig. They are
one frozen exported object, asserted by value, so re-enabling one is a red
build rather than a quiet capability grant.
Verified against the SDK's own type definitions rather than from memory. Two
things the fork's draft had wrong: SDKResultError carries no `errors` field, so
`message.errors?.join()` was dead code and the failure reason now comes from
`subtype` and `stop_reason`; and the client-app version string was hardcoded at
1.2.3 two releases after it stopped being true, so it is read from package.json.
The credential connect/disconnect routes land here as promised in 2/6 — they
serve a credential, and until this PR there was no provider that had one.
authMode and the per-profile pair still wait for the side that consumes them.
api 72/72 on macOS and on Linux as uid 65534 with the SDK absent; both image
targets built and run; library in sync at 1324.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
First of six. Everything here is transport and boundary: a job can run, its
answer can be parsed, and nothing yet judges whether that answer is safe to
act on. The validator and the apply path are the next PR, and the seam is
explicit — jobs.js carries an answer no further than `unvalidated`, and a
test pins that so the next PR has something to replace.
Whose account pays, settled first because it decides what the rest may be:
instance one account in coach.json, for the single-profile instance
profile one account per profile, in its own coach-auth-<uid>.json
In instance mode the credential binds to the first profile that spends it and
every other profile is refused — no job, not a dismissible warning. A warning
moves the decision onto whoever clicks past it and the decision is about
somebody's personal subscription. A profile credential is deliberately not a
field on state-<uid>.json: that blob syncs and travels in the user's export,
and a credential in a backup is the mistake we are avoiding, not repeating.
openGym does not interpret any provider's terms; it offers the shape that
does not need the interpretation and refuses the shape that does.
The privilege drop now fails closed. It only ever engaged when the server ran
as root, so adding a USER line to the Dockerfile for unrelated hardening would
have silently left the provider runtime on the server's uid. On Linux, no drop
means no job, and the admin card says so.
./data is no longer sealed with a blanket 0700. It is a host bind mount and
this container is root, so sealing it landed on the host as root-owned and
took the owner's own directory hostage — backup scripts, jq, the MCP server in
issue #19. The files that hold secrets carry 0600 themselves instead, which is
what the directory mode was standing in for; db.json gained an explicit mode
rather than inheriting umask once the blanket came off.
Bodyweight and per-side, folded in rather than deferred: v1.2.4 made `weight`
mean *added* load on a bodyweight exercise, so it is 0 on a good session and
every load-shaped signal reads flat. Uncorrected, the Coach would have looked
at a working push-up progression and proposed adding weight to a push-up. The
payload carries bodyweight/side/repsMax, the session reader carries set count,
and the prompts say reps then sets are the progression and per-side targets
step in twos. coach-parity.test.js pins the server's three copied reading
rules against the frontend's originals over a table of configs — modeOf was
never actually pinned, and it is the one that was predicted to drift.
No AI dependency lands here: api/ still installs @simplewebauthn/server and
web-push and nothing else. Jobs run against the in-repo fixture provider, so
CI needs no account, no network and no image build.
33 api tests, 361 frontend tests (169 of them parity), locales in sync.