- Neue Tabelle agent_api_keys (user_id, agent_id, key_id) - Migration: bestehende selected_api_key_id auf alle Agents verteilt - Backend: GetAgentApiKeyRecord(userId, agentId) in Chat, Telegram, Cronjobs - Endpoints: select/selected mit ?agentId Query-Parameter - Frontend: currentAgentId aus Session, alle Key-Calls agent-aware - DeleteApiKey bereinigt agent_api_keys statt users.selected_api_key_id
13 lines
210 B
JavaScript
13 lines
210 B
JavaScript
// ── Session State ──
|
|
|
|
let currentSessionId = null;
|
|
let currentAgentId = null;
|
|
|
|
function getCurrentSessionId() {
|
|
return currentSessionId;
|
|
}
|
|
|
|
function getCurrentAgentId() {
|
|
return currentAgentId;
|
|
}
|