Skip to content

feat(auto-mode): comportamento semelhante ao auto mode do Claude Code - #81

Open
savass33 wants to merge 9 commits into
mainfrom
fix/auto-mode-like-claude-code
Open

savass33 wants to merge 9 commits into
mainfrom
fix/auto-mode-like-claude-code

Conversation

@savass33

@savass33 savass33 commented Nov 3, 2026

Copy link
Copy Markdown

Sintomas relatados

  • "Ansioso": o modelo perguntava "posso implementar?" e já começava a implementar.
  • Erros e bloqueios sem explicação: por exemplo "Classifier returned no tool use block", ou 8 ações bloqueadas seguidas.
  • Lentidão ou travamento.

O que muda

Instrução ao modelo

  • Saiu "execute imediatamente / na dúvida, comece a programar".
  • Agora: fazer o que foi pedido sem pedir licença, respeitar pedidos de planejar antes, perguntar só quando a decisão for do usuário, e uma pergunta encerra a vez.
  • Mantidos os itens sobre ações destrutivas e exfiltração.

Classificador

  • Falha = perguntar, não bloquear. Indisponível, lento, ou resposta fora do formato (tanto no modo tool_use quanto em duas etapas) mostra o prompt normal de permissão na sessão interativa. Nunca aprova sozinho, e não conta na cota de bloqueios. Headless (-p) continua negando. Depois de um Esc do usuário, nada é perguntado.
  • Modelo dedicado: agent_model_roles.classifier do roteador (verboo-code-router#52). VERBOO_AUTO_MODE_MODEL serve para diagnóstico. Sem nenhum dos dois, usa o modelo da conversa.
  • Prazo de 45s por requisição (VERBOO_AUTO_MODE_TIMEOUT_MS) e uma nova tentativa em 429/5xx/timeout.
  • Shim OpenAI-compatível: um tool call forçado que volta com finish_reason: "stop" agora é aceito. Era a causa provável dos "no tool use block".
  • Transcrição em JSONL por padrão: conteúdo de arquivo ou comando não consegue forjar uma linha "User:" para o classificador aprovar algo.
  • Regras do usuário (autoMode.allow/soft_deny/environment) somam às padrão em vez de substituí-las.
  • Confiança: .verboo/settings.local.json fica dentro do projeto, então não conta mais para o opt-in nem para regras do classificador.
  • O prompt do classificador dizia que ele via respostas e resultados de ferramentas. Corrigido.

Outros

  • /config → "Auto" agora persiste como auto (antes virava default).
  • Overrides de feature-flags.json mesclam com o padrão e o arquivo mudou para ~/.verboo.
  • Textos com "Claude Code" corrigidos e erro TS2554 resolvido.
  • .txt dos prompts com diff legível no git.

Avaliação de candidatos: scripts/eval-auto-mode-classifier.ts roda 20 ações rotuladas contra o roteador e mede formato válido, acerto, bloqueios perdidos e latência por modelo. É ele que vai indicar o modelo para AGENT_MODEL_ROLE_CLASSIFIER.

Testes

  • autoModeVerboo.test.ts:
    • nova tentativa em 5xx; sem nova tentativa em 4xx;
    • timeout com nova tentativa; Esc do usuário sem nova tentativa;
    • ligações de falha → prompt, papel classifier, instrução e /config.
  • openaiShim.test.ts: tool call forçado com stop (aceito, não forçado e nome diferente).
  • Override de flag mescla, e teste de budget do transcript ajustado ao formato JSONL.
  • Local, com Bun 1.3.13: check-cli-quality --suite 364/364 e --terminal 36/36.

Fora deste PR

O modelo do classificador no /status ficou de fora: o import deixava o /status lento.

🤖 Generated with Claude Code

savass33 and others added 8 commits November 3, 2026 16:56
…etry, calmer instructions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A classifier that is down, slow or answers out of format (tool_use and
  two-stage paths) now asks the user in interactive sessions instead of
  blocking the action and counting it as a policy denial; headless sessions
  keep the fail-closed deny.
- The classifier runs on the router's "classifier" role model
  (agent_model_roles.classifier), VERBOO_AUTO_MODE_MODEL for diagnosis, else
  the conversation model.
- Each classifier request has a deadline (VERBOO_AUTO_MODE_TIMEOUT_MS,
  default 45s) and one retry on 429/5xx/timeout.
- The OpenAI-compatible shim commits a forced tool call that finishes with
  "stop", which many servers return for tool_choice by name.
- The main model's auto mode instructions no longer say "execute
  immediately / when in doubt, start coding": do the requested work without
  asking permission for it, and a question ends the turn.
- JSONL classifier transcript by default (tool output cannot forge a "User:"
  line); user allow/soft_deny/environment rules add to the defaults; project
  settings.local.json no longer opts in or adds classifier rules; object
  feature-flag overrides merge; flags file moved to ~/.verboo.
- /config keeps "auto" as the default mode; leftover "Claude Code" strings
  and the stub signature mismatch (TS2554) fixed; prompt .txt files diffable.
- scripts/eval-auto-mode-classifier.ts compares candidate classifier models
  (format validity, accuracy, missed blocks, latency) against the router.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al.timeout

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by end-to-end validation and the CI security scan:

- Background-agent results, skill bodies and command output reached the
  classifier as if the user had written them, so injected text could pose as
  approval. Only text the user typed counts now.
- With nobody to answer a prompt (background agents, -p), a broken classifier
  looped forever without tripping the denial limit. It now counts and ends the
  run. -p gets the transient-failure message instead of a raw ask.
- `auto-mode config` and `critique` still described custom rules as replacing
  the defaults, after they became additive.
- VERBOO_AUTO_MODE_TIMEOUT_MS above 2^31-1 made every call time out at once.
- Reworded a comment that the PR scanner flagged as a download-and-execute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Product decision: with a ChatGPT plan or an OpenAI/Anthropic key, the classifier
uses the conversation model instead of the router's "classifier" role. Nothing
from the session reaches the router, the Verboo plan is not billed, and auto mode
keeps working when that plan runs out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row only said "Denied by auto mode classifier"; the reason went to the model
and never to the person, who had complained about blocks with no explanation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its labeled test cases contain the commands the classifier must block, so the PR
intent scan fails on them. It is only needed to pick the classifier model, not at
runtime; it stays on chore/auto-mode-classifier-eval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant