mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 06:56:44 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
65ce5ef4e7
commit
9be818fcdc
1 changed files with 6 additions and 2 deletions
|
|
@ -78,7 +78,7 @@ Deno.serve(async (req) => {
|
||||||
const { data: agent, error: agentErr } = await supabase
|
const { data: agent, error: agentErr } = await supabase
|
||||||
.from("agent_instances")
|
.from("agent_instances")
|
||||||
.select(
|
.select(
|
||||||
"id, user_id, uuid_tenant, status, telegram_bot_token_vault_id, telegram_bot_username, telegram_user_chat_id, railway_service_id",
|
"id, user_id, uuid_tenant, status, telegram_bot_token_vault_id, telegram_bot_username, telegram_user_chat_id, railway_service_id, agent_name",
|
||||||
)
|
)
|
||||||
.eq("id", body.agent_instance_id)
|
.eq("id", body.agent_instance_id)
|
||||||
.maybeSingle();
|
.maybeSingle();
|
||||||
|
|
@ -108,7 +108,11 @@ Deno.serve(async (req) => {
|
||||||
|
|
||||||
const fullName = (profile?.full_name?.trim() || "Usuário").toString();
|
const fullName = (profile?.full_name?.trim() || "Usuário").toString();
|
||||||
const firstName = fullName.split(" ")[0] || "Usuário";
|
const firstName = fullName.split(" ")[0] || "Usuário";
|
||||||
const agentName = body.agent_name?.trim() || `Mika de ${firstName}`;
|
// Prioridade: body > coluna agent_name no DB > default "Mika de {firstName}"
|
||||||
|
const agentName =
|
||||||
|
body.agent_name?.trim() ||
|
||||||
|
(agent.agent_name?.trim() ?? "") ||
|
||||||
|
`Mika de ${firstName}`;
|
||||||
console.log(`[provision-agent] profile carregado: ${fullName} → agent_name=${agentName}`);
|
console.log(`[provision-agent] profile carregado: ${fullName} → agent_name=${agentName}`);
|
||||||
|
|
||||||
// 1c) Carregar subscription ativa (para definir modelo Pro vs Basic)
|
// 1c) Carregar subscription ativa (para definir modelo Pro vs Basic)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue