feat: adopt per-bot account api key for gateway attribution and improve post distinctness

- Add `account_api_key` field to `BotState` and `_adopt_account_api_key()` method that fetches the bot's own `users.api_key` from its profile JSON after auth, switching `LLMClient` to use it instead of the shared bootstrap key, routing gateway spend through the bot's user identity
- Replace `interleave_by_author` with a simpler greedy algorithm that picks the first row whose owner differs from the last picked, removing the multi-queue priority logic
- Extend `_ai_quota` response with `unlimited`, `requests`, and `last_used` fields sourced from new `user_spend_24h()` analytics helper
- Pass `recent_post_titles` from `BotState` into `LLMClient.generate_post()` and add a `distinct_rule` prompt instructing the model to avoid repeating framing, examples, or opinions from the bot's last six posts
- Remove early-return dedup check in `ArticleRegistry.admit` that skipped articles already held by the same bot owner, allowing re-admission under a different category
- Render bot username as a clickable link with avatar in the admin bots table
This commit is contained in:
2026-06-15 22:44:12 +00:00
parent 5dd2126511
commit e59bc2d34e
27 changed files with 375 additions and 100 deletions
+24 -9
View File
@@ -13,6 +13,10 @@
gap: var(--space-sm);
}
.reaction-list:not(:has(.reaction-chip:not([hidden]))) {
display: none;
}
.reaction-chip {
display: inline-flex;
align-items: center;
@@ -59,25 +63,28 @@
.reaction-add-btn {
display: inline-flex;
align-items: center;
gap: var(--space-xs);
padding: 0.15rem 0.6rem;
border: 1px dashed var(--border-light);
border-radius: 999px;
background: transparent;
gap: 0.375rem;
padding: 0.375rem 0.75rem;
border: none;
border-radius: var(--radius);
background: none;
color: var(--text-muted);
font-size: 0.85rem;
line-height: 1.4;
font-size: 0.8125rem;
font-weight: 500;
line-height: 1;
cursor: pointer;
transition: border-color 0.15s, color 0.15s;
transition: color 0.15s;
}
.reaction-add-btn:hover {
color: var(--accent);
border-color: var(--accent);
}
.reaction-add-icon {
font-size: 1rem;
width: 20px;
text-align: center;
flex-shrink: 0;
line-height: 1;
}
@@ -103,6 +110,14 @@
display: none;
}
@media (max-width: 768px) {
.reaction-palette {
flex-wrap: wrap;
justify-content: flex-start;
max-width: calc(100vw - 2 * var(--space-md));
}
}
.reaction-palette-btn {
background: transparent;
border: none;