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
49b310205f
commit
3233786616
1 changed files with 12 additions and 3 deletions
|
|
@ -197,9 +197,18 @@ Deno.serve(async (req) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!telegramBotToken) {
|
if (!telegramBotToken) {
|
||||||
console.error(`[provision-agent] telegram_bot_token ausente — usuário ainda não conectou bot`);
|
// Onboarding ainda não concluído. NÃO marca agent como 'error' — o wizard de Telegram
|
||||||
await failJob(supabase, agent, job.id, "telegram_bot_token ausente no Vault — usuário precisa concluir onboarding antes");
|
// dispara este endpoint de novo após o usuário salvar o token (validate-telegram-bot).
|
||||||
return jsonResponse(412, { error: "telegram token missing" });
|
console.log(`[provision-agent] aguardando token do Telegram (job=${job.id})`);
|
||||||
|
await supabase
|
||||||
|
.from("provisioning_jobs")
|
||||||
|
.update({
|
||||||
|
status: "pending",
|
||||||
|
error_message: "Aguardando o usuário conectar o bot do Telegram",
|
||||||
|
completed_at: null,
|
||||||
|
})
|
||||||
|
.eq("id", job.id);
|
||||||
|
return jsonResponse(202, { waiting_for_token: true, agent_instance_id: agent.id });
|
||||||
}
|
}
|
||||||
console.log(`[provision-agent] token Telegram OK (len=${telegramBotToken.length})`);
|
console.log(`[provision-agent] token Telegram OK (len=${telegramBotToken.length})`);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue