Repository navigation
Resumo pós-partida (3.3.0) e correção do aviso de vida baixa - #4
Merged
Merged
Conversation
The Live Client API only exposes championStats on activePlayer; allPlayers entries never have it. Health was read from the allPlayers entry, so it was always 0, the low health trigger never fired, and every ally and enemy was sent to the AI with 0 health. Read health from activePlayer for the local player only and make the test fixtures match the real payload shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the provider, model fallback and error handling out of ask_coach into _complete so a second kind of request can reuse it. ask_post_match_review asks for 2 strengths and 2 points to train, parsed from "+"/"-" lines, with a larger token budget than the 180 used for in-game tips. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MatchRecorder keeps periodic samples (level, K/D/A, CS, unspent gold), a timeline of kills, deaths with the killer, assists, finished items, level milestones and objectives with the team that took them, plus every coach reply. It also tracks CS at 10 minutes, time spent above the rich-gold threshold, kill participation and the GameEnd result when the client sends it. The summary now keeps the vision score and inhibitor and result event fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
At the end of a match (or when a new one starts without an end) the coach writes partidas/<date>_<champion>.html and .json, then asks the AI for the review and rewrites the page with it, without blocking the main loop. The page is self-contained (no scripts or external resources) and escapes every dynamic text. Ctrl+C mid-match saves a partial report right away. POST_MATCH_REPORT and POST_MATCH_OPEN control it; partidas/ is ignored by git. The fixture comes from a simulated match run against the real coach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README section with a screenshot of the sample report, new .env settings, architecture diagram and troubleshooting entry; changelog for 3.3.0; contributing notes on previewing the report without playing. Co-Authored-By: Claude Opus 5.5 <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 que muda
Resumo pós-partida
Ao fim de cada partida, o coach salva em
partidas/e abre no navegador uma página com:Detalhes:
match_recorder.pycoleta os dados;post_match_report.pymonta a página (HTML autocontido, sem scripts nem recursos externos, todo texto dinâmico escapado) e chama a análise em segundo plano, sem travar o loop.Ctrl+Cno meio da partida salva um resumo parcial na hora. Trechos com menos de 3 minutos não geram resumo.POST_MATCH_REPORTePOST_MATCH_OPEN. A pastapartidas/está no.gitignore.brain.py: a lógica de provedor e fallback de modelos virou_complete, reaproveitada pelas dicas e pela análise.Bug corrigido: vida baixa nunca disparava
A Live Client API só traz
championStatsemactivePlayer, mas a vida era lida deallPlayers, onde esse campo não existe. A vida chegava sempre como 0, o aviso de vida baixa nunca disparava e aliados e inimigos iam para a IA com vida zerada. Confirmei o formato no exemplo oficial da Riot; os testes agora usam esse formato.Como testei
ruff check .main.pyreal, com push-to-talk simulado e a voz desligada. O resumo saiu 12 s após o fim, com a análise, e a IA passou a receber a vida real (686/686). A partida simulada virou o fixturetests/fixtures/sample_match.jsone o print do README.scripts/build.ps1: o executável 3.3.0 abre e espera a partida🤖 Generated with Claude Code