Coach: ein API-Key gilt fuer die ganze Instanz, Warm-ups zaehlen nicht, Retries bei 429/5xx, sichtbare Admin-Felder
- 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.
This commit is contained in:
1 parent
63cf1deaed
commit
02c75b320d
14 files changed
+311
-35
No files matched your search
@@ -32,6 +32,20 @@ test('instance mode: the first profile to spend the credential binds it', () =>
|
||||
assert.equal(cfg.boundUidFor(), 'alice');
|
||||
});
|
||||
|
||||
test('instance mode: an API key binds to nobody — every profile shares it', () => {
|
||||
cfg.reset();
|
||||
cfg.save({
|
||||
enabled: true, provider: 'anthropic', authMode: 'instance', boundUid: {},
|
||||
auth: { anthropic: { type: 'apikey', account: '', data: cfg.encrypt({ token: 'sk-ant-shared' }) } }
|
||||
});
|
||||
cfg.bindInstanceCredential('alice');
|
||||
assert.equal(cfg.boundUidFor(), null, 'a metered key is issued for exactly this use; binding it would just look broken');
|
||||
assert.equal(cfg.credentialFor('bob').ok, true);
|
||||
assert.equal(cfg.credentialFor('bob').auth.token, 'sk-ant-shared');
|
||||
assert.equal(cfg.isPersonalCredential('apikey'), false);
|
||||
assert.equal(cfg.isPersonalCredential('cli-token'), true);
|
||||
});
|
||||
|
||||
test('instance mode: a second profile is refused, not warned', () => {
|
||||
connectInstance();
|
||||
cfg.bindInstanceCredential('alice');
|
||||
|
||||
Reference in new issue
Block a user