Repository navigation
Silence the coach in warmup/practice/bot games (Premier/Competitive only) - #55
Merged
Merged
Conversation
…nly)
Live coaching was gated on match *phase*, never *mode* or bot status: the
engine dispatch had no mode/bot checks, so any session reaching map.phase
"live" in a non-ranked mode (casual, deathmatch, community/aim maps, Wingman)
or an offline practice-with-bots game fired the full reaction set — greeting,
buy calls, kill/MVP/round-end hype, clock callouts. The existing botsDetected
flag only gated post-match recording, and only trips once the user dies and
spectates a bot, so a pubstomp where you never die stayed loud.
Add a "coachable match" gate at the engine chokepoint (handleOne):
- COACHABLE_MODES allowlist {competitive, premier} ("premier" defensive; Premier
reports "competitive" today). Unknown/undefined mode fails OPEN — a real live
speech event always carries a defined mode; menu/blip frames emit no speech.
- coachableNow(ctx) = isCoachableMode(ctx.mode) && !botsDetected(); EngineDeps
gains botsDetected, wired in index.ts to roster.matchReport().botsDetected
(already OR'd across feeds) so offline competitive-with-bots latches silent
once a bot is spotted (the one case mode can't catch).
- matchEnd still runs onMatchEnd + cancelTimers + flag resets when non-coachable,
so a real game's recording/recap (self-gated in index.ts) is never mis-skipped.
- The clock/bomb timer callouts re-check coachableNow for the mid-match bot flip.
Per the user's choice, Wingman (scrimcomp2v2) is silenced too — the sim
assertion that wingman round 12 speaks is flipped to expect silence, plus a new
"non-ranked modes and bot matches get NO live coaching" scenario (casual/dm
silent, undefined fail-open speaks, bot-latch goes silent after first spectate).
Residual gap (documented): offline practice-with-bots in COMPETITIVE mode talks
until the first death+spectate, then latches silent — no GSI field can name bots
while the user is alive and instant-respawning. Realistic warmups (aim/casual/dm)
report a defined non-ranked mode and are silenced from the first frame.
typecheck + full sim green.
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.
Problem
The coach reacted (greeting, buy calls, kill/MVP/round-end hype, clock callouts) while the user warmed up by killing bots. Root cause: live coaching was gated on match phase, never mode or bot status. The engine dispatch (
handleOne) had zero mode/bot checks, so any session that reachedmap.phase === "live"in a non-ranked mode (casual, deathmatch, community/aim maps, Wingman) or an offline practice-with-bots game fired the full reaction set. The existingbotsDetectedflag only gated post-match recording and only trips once the user dies and spectates a bot — useless for a pubstomp where you never die.(The detailed coach log for the reported session was unrecoverable: the prod
coachcontainer had been recreated and its/app/logslives in the container's ephemeral filesystem. Diagnosis is from the code, cross-checked against the Caddy access log andsessions.json.)Fix
A "coachable match" gate at the engine chokepoint — the single path every spoken line flows through:
COACHABLE_MODES = {competitive, premier}("premier"defensive; Premier reports"competitive"today, only medium confidence perRESEARCH.md). Everything else is treated as warmup/practice and gets no live coaching. Unknown/undefined mode fails OPEN — a real live speech event always carries a definedmap.mode; the menu/blip frames that lack one emit no speech anyway.coachableNow(ctx) = isCoachableMode(ctx.mode) && !botsDetected().EngineDepsgainsbotsDetected, wired inindex.tstoroster.matchReport().botsDetected(already OR'd across feeds), so an offline competitive-with-bots game latches silent once a bot is spotted — the one case the mode gate can't catch (it reports"competitive").matchEndstill runsonMatchEnd+cancelTimers+ flag resets when non-coachable, so a real game's recording/recap (self-gated inindex.ts) is never mis-skipped.coachableNowfor the mid-match bot flip.Per the requested scope, Wingman (
scrimcomp2v2) is silenced too.Reviewer notes
=== "competitive"— equality would silence Wingman immediately and put Premier one Valve token-change away from going mute. (An adversarial review pass flagged exactly this, plus that a blanket early-return would have silently dropped real-game recording — henceonMatchEndis preserved.)ctx.modeis the fused/authority mode, so the gate behaves correctly in the multi-feed squad case.Tests
npm run typecheckand the fullnpm run sim(260+ checks) pass.🤖 Generated with Claude Code