Data: 2026-08-02 Tester: Agente Agnes (Sapiens AI) Ambiente: Linux x86_64, Ollama rodando, ernesto-mem0 ativo
| Teste | Descricao | Status | Tempo |
|---|---|---|---|
| 1 | Inicializacao + banner ASCII art | β PASS | <1s |
| 2 | Comando /help | β PASS | <1s |
| 3 | Agente ollama β 2+2 | β PASS | 0.8s |
| 4 | Agente mem0 β listar memorias | β PASS | 0.0s |
| 5 | Agente mem0 β add memoria | β PASS | 4.3s |
| 6 | Agente mem0 β clear | β PASS | <1s |
| 7 | Comando /history | β PASS | <1s |
| 8 | Comando /model β listar modelos | β PASS | <1s |
| 9 | Comando /agent β trocar agente | β PASS | <1s |
| 10 | Comando /clear β nova sessao | β PASS | <1s |
| 11 | Criatividade β haiku sobre programacao | β PASS | 1.3s |
| 12 | Multi-turno com historico | β PASS | 12.2s + 1.1s |
| 13 | Texto longo β explicacao HTTP | β PASS | 13.7s |
| 14 | Saudacao simples | β PASS | 12.2s |
Total: 14 testes, 14 passed, 0 failed
- Criada funcao
WordWrap()que quebra texto em linhas de tamanho maximo - Respeita limites de palavras (no medio de palavras)
- Preenche espacos com spaces ate o tamanho da caixa
- Todas as caixas calculam padding automaticamente
- Textos longos sao truncados com "..."
- Linhas sao preenchidas ate o limite da caixa
- Largura da caixa = largura do terminal - 4 (margens)
- Maximo 96 caracteres para legibilidade
- Minimo 40 caracteres para caixas pequenas
- Funcao
StripANSI()remove codigos de cor para calculo de tamanho - Texto formatado mantem cores mas cabe na caixa
Comando:
printf '/exit\n' | ./shortcoderResultado: β PASS
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β SHORTCODER β
β β
β [AI Coding Agent v1.0] [BBS Edition] β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MODEL: [lfm25-1b-uncensored:latest] β
β SESSION:[user-20260802-...] β
β AGENT: [OLLAMA] β
β MEM0: [default] β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
>
Comando:
printf '/help\n/exit\n' | ./shortcoderResultado: β PASS β Caixa formatada com todas as opc8oes
Comando:
printf '2+2\n/exit\n' | ./shortcoderResultado: β PASS (0.8s)
+--------------------------------------------------------------------------+
| USER 2+2 |
+--------------------------------------------------------------------------+
+--------------------------------------------------------------------------+
| AGENT:OLLAMA lfm25-1b-uncensored:latest |
+--------------------------------------------------------------------------+
2 + 2 = 4
+--------------------------------------------------------------------------+
0.8s response time
Comando:
printf '/mem0 list\n/exit\n' | ./shortcoderResultado: β PASS (0.0s, 2 memorias)
+--------------------------------------------------------------------------+
| AGENT:MEM0 Persistent Memory Store |
+--------------------------------------------------------------------------+
--- 2 of 2 memories shown ---
[fact] conf:1.00 [SHORTCODER-BBS-TESTS-2026-08-02] 12 testes realizados...
[fact] conf:1.00 "teste BBS: interface 100% legivel"
+--------------------------------------------------------------------------+
0.0s Β· 2 results
Comando:
printf '/mem0 add "teste BBS: interface 100% legivel"\n/exit\n' | ./shortcoderResultado: β PASS (4.3s)
+--------------------------------------------------------------------------+
| [OK] Memory saved successfully |
+--------------------------------------------------------------------------+
4.3s
Comando:
printf '/mem0 clear\n/exit\n' | ./shortcoderResultado: β PASS
+--------------------------------------------------------------------------+
| [OK] All memories cleared |
+--------------------------------------------------------------------------+
<1s
Comando:
printf '/history\n/exit\n' | ./shortcoderResultado: β PASS
+--------------------------------------------------------------------------+
| HISTORY |
+--------------------------------------------------------------------------+
[EMPTY] No conversation history
+--------------------------------------------------------------------------+
Comando:
printf '/model\n1\n/exit\n' | ./shortcoderResultado: β PASS β Lista 65 modelos disponiveis
Comando:
printf '/agent\n1\n/exit\n' | ./shortcoderResultado: β PASS β Menu com 3 opcoes
Comando:
printf '/clear\n/history\n/exit\n' | ./shortcoderResultado: β PASS β Sessao limpa, historico vazio
Comando:
printf 'write a haiku about programming\n/exit\n' | ./shortcoderResultado: β PASS (1.3s)
Code whispers true, Silent logic dances brightβ
Minds build light.
Comando:
printf 'hello\nhow are you\n/exit\n' | ./shortcoderResultado: β PASS (12.2s + 1.1s)
[001] ollama (12.2s) hello
[002] ollama (1.1s) how are you
Comando:
printf 'explain in detail how HTTP requests work step by step with examples\n/exit\n' | ./shortcoderResultado: β PASS (13.7s)
- Texto quebrado corretamente em multiplas linhas
- Cada linha cabe dentro da caixa
- Formatacao markdown preservada
- WordWrap β Quebra texto automaticamente
- Padding dinamico β Espacos ajustados por linha
- Caixas proporcionais β Largura = terminal - 4
- Truncamento seguro β "..." quando texto excede limite
- ASCII art β Header com "SHORTCODER" centralizado
- Cores vintage β Amarelo, ciano, verde, magenta
- Caixas delimitadas β Bordas com
+ββ+| - Status bar β Model, Session, Agent, Mem0
- Ollama β LLM rapido (~1s)
- Mem0 β Memoria persistente (<1s)
- Ernesto β RAG + Mem0 (lento, >30s)
/agent β Troca agente
/model β Seleciona modelo
/mem0 list β Lista memorias
/mem0 add β Adiciona memoria
/mem0 clearβ Limpa memorias
/history β Historico de turnos
/clear β Nova sessao
/help β Ajuda
/exit β Sair
~/Projetos/shortcoder/
βββ shortcoder # Binario ELF (44MB)
βββ shortcoder.prw # Fonte AdvPL (24KB)
βββ TEST_RESULTS.md # Este arquivo
βββ BBS_README.md # Resumo rapido
βββ shortcoder # Versao original
βββ shortcoder.prw
βββ shortcoder-rag # Versao com RAG
βββ shortcoder-rag.prw
βββ ARCHITECTURE.md
βββ PROTOTIPO.md
βββ WIREFRAME.md
- Sem modificacoes no AdvPP β Tudo via HTTP nativo
- Utf-8 para CP-1252 β Conversao automatica pelo compilador
- Alt-screen β Buffer separado para TUI fluida
- Signal handling β Ctrl+C restaura terminal
Data: 2026-08-09
Ambiente: Linux x86_64, Agnes (cloud) com AGNES_API_KEY, mem0 local ativo
BinΓ‘rio: shortcoder (HEAD 8704c6d + Task 5 de polimento)
$ ADVPP_SRC=/home/peder/Projetos/AdvPP advplc build shortcoder.prw -o shortcoder
Standalone executable built: shortcoder
./tests/config-tests.sh β 15/15 PASS:
=== Shortcoder Config Tests ===
β
PASS: Starts correctly without config file
β
PASS: All 5 config functions present in source
β
PASS: Runs without config file (graceful fallback)
β
PASS: /timeout still works
β
PASS: /help still works
β
PASS: /history still works
β
PASS: Config file created on first run
β
PASS: Config file contains model key
β
PASS: Invalid path shows error
β
PASS: /timeout still works
β
PASS: /help still works
β
PASS: /history still works
β
PASS: /config set persists to disk
β
PASS: /reload shows confirmation
β
PASS: /config shows config content
β
PASS: agent alias maps to defaults.agent and persists
β
PASS: border alias maps to theme.border_style and persists
β
PASS: agent switch applies immediately after /config set
=== Config Tests Complete ===
./tests/tools-tests.sh β 3/3 PASS:
=== Shortcoder Tools Harness Tests ===
[Test 1] /tools selftest β todas as linhas PASS
β
PASS: selftest overall OK
[Test 2] Regression β /agent 4 sem AGNES_API_KEY mostra erro controlado
β
PASS: agnes agent error box still works
[Test 3] Config gating β tools_enabled=false nao altera /agent 4
β
PASS: tools_enabled=false keeps legacy path
O backup/restore da config real do usuΓ‘rio (~/.config/shortcoder/config.json) foi
verificado por checksum: idΓͺntico antes e depois da execuΓ§Γ£o.
/help β lista /tools selftest:
/tools selftest - Roda o auto-teste do harness de ferramentas do Agnes
2+2 (loop de ferramentas do Agnes, AGNES_API_KEY presente) β resposta correta:
β AGENT:AGNES agnes-2.5-flash
β 2+2 = 4
0.0s response time
/mem0 list (serviΓ§o mem0 local ativo):
β AGENT:MEM0 Persistent Memory Store
β --- 10 of 148 memories shown ---
/tools selftest β 19/19 PASS:
> [TOOLS SELFTEST]
[SELFTEST] BuildToolDefinitions parse ... PASS
[SELFTEST] IsWithinWorkdir aceita relativo no workdir ... PASS
[SELFTEST] IsWithinWorkdir aceita absoluto sob workdir ... PASS
[SELFTEST] IsWithinWorkdir rejeita .. acima ... PASS
[SELFTEST] IsWithinWorkdir rejeita absoluto fora ... PASS
[SELFTEST] IsWithinWorkdir normaliza ./sub/../a ... PASS
[SELFTEST] write_file cria arquivo ... PASS
[SELFTEST] read_file le conteudo ... PASS
[SELFTEST] edit_file substitui primeira ocorrencia ... PASS
[SELFTEST] read_file rejeita caminho fora do workdir ... PASS
[SELFTEST] bash captura stdout ... PASS
[SELFTEST] glob lista arquivos ... PASS
[SELFTEST] grep encontra texto ... PASS
[SELFTEST] list_dir lista diretorio ... PASS
[SELFTEST] bash respeita timeout (nao trava) ... PASS
[SELFTEST] TruncateHistory limita a nMax ... PASS
[SELFTEST] SplitLines divide linhas ... PASS
[SELFTEST] SkillsIndex roda sem erro ... PASS
[SELFTEST] JsonEncodeStr escapa conteudo ... PASS
[TOOLS SELFTEST] OK
$ file src/sc_tools.prw
src/sc_tools.prw: Non-ISO extended-ASCII text, with very long lines (313)
$ python3 -c "print(open('src/sc_tools.prw','rb').read().count(b'\xef\xbf\xbd'))"
0
Total da suΓte: 15/15 (config) + 3/3 (tools) + 19/19 (selftest) β todos PASS.
Data: 2026-08-25
Ambiente: Linux x86_64 (laptop com GPU MX330, 2GB VRAM), Ollama local, modelo
ornith-uncensored (ornith-1.5:9b, Q4_K_M) registrado
- Failover Agnes β Ornith ("couple"):
RunCoupleAgenttenta o agente selecionado primeiro; se falhar por motivo transiente (timeout, HTTP erro, parse), o outro assume e a resposta mostra[COUPLE] <agente> indisponivel β respondido por <outro>. "Nao configurado" (AGNES_API_KEYausente) nunca aciona failover. Controlado poragents.couple_enabled(padraotrue). - Fix
agents.ollama.timeoutignorado:RunOllamaAgentnunca chamavaFWHTTPTIMEOUT, entao a config ficava presa no default de 30s do TOTVS. Corrigido para aplicar o valor configurado. keep_alivena chamada ao Ollama: evita que o Ollama descarregue um modelo de 6.6GB entre mensagens da mesma sessao (default30m, configuravel viaagents.ollama.keep_alive).- GPU:
num_gpu 0paraornith-uncensored: comnum_gpu 8o modelo ocupava 1871/2048 MiB da VRAM (124 MiB de folga) β risco real de OOM pra qualquer outro consumidor da GPU. Trocado para CPU-only (~1.7 tok/s, mas sem risco de crash, com 34GB de RAM disponiveis).
./tests/config-tests.sh β 15/15 PASS (inalterado).
./tests/tools-tests.sh β 4/4 PASS (Test 4 novo):
=== Shortcoder Tools Harness Tests ===
[Test 1] /tools selftest β todas as linhas PASS
β
PASS: selftest overall OK
[Test 2] Regression β /agent 4 sem AGNES_API_KEY mostra erro controlado
β
PASS: agnes agent error box still works
[Test 3] Config gating β tools_enabled=false nao altera /agent 4
β
PASS: tools_enabled=false keeps legacy path
[Test 4] Couple β ambos os agentes indisponiveis mostra erro do primario, sem travar
β
PASS: couple falls back to agnes (unconfigured), then shows ollama's own error, fast
AGNES_API_KEYinvalida forcando falha real (HTTP 401, nao "nao configurado") β Ornith assumiu e respondeu corretamente em 36.7s, com[COUPLE] Agnes indisponivel β respondido por Ornithcorretamente dentro da borda da caixa.nvidia-smimonitorado durante uma geracao completa comnum_gpu 0: memoria da GPU permaneceu em 1 MiB (era 1871/2048 MiB antes do fix).
Total da suite: 15/15 (config) + 4/4 (tools) β todos PASS. 19/19 no total.