feat(ask): Consultar gera resposta via assinatura Claude do usuário (créditos dele)#158
Merged
Conversation
Adiciona campo opcional effort (low|medium|high) às opts de callSubscription. Em modelos capazes (supportsEffort) usa opts.effort ?? "high" no output_config.effort; default INALTERADO = "high" e temperature segue omitido. Ignorado em modelos não-capazes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Quando a conta tem assinatura Claude conectada, /portal/ask gera a resposta com os créditos do próprio usuário (callSubscription, effort "low", model ASK_SUB_MODEL=claude-opus-4-8), igual ao extrator de memória. Helper generateAnswer com ordem de fallback fail-safe (rota VIVA, sem gate): 1. seam de teste (deps.complete) — preserva os testes existentes 2. assinatura (createditos do usuário) — NÃO metered, token nunca logado 3. central (nossa chave ASK_MODEL) — único caminho metered (recordLlmUsage) Se a assinatura falha (reauth/rate-limit/rede), cai no central; se o central também falha, propaga pro caller (canned no meta, degradado no search). accountId sempre vem da sessão (res.locals); classifyIntent segue central/barato. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O chat Consultar (/portal/ask) passa a gerar a resposta usando a assinatura Claude da própria conta quando ela está conectada (reusa o provider da curadoria), tirando o custo da chave central. Ativa automático pra quem conectou (sem flag).
Deploy: rotina do engine (sem web). Sem enable: ativa por conexão de assinatura.
🤖 Generated with Claude Code