ChangeCombatModeFor called host.ChangeCombatMode, began a paced action only on
success, and then returned true either way. BuffManager and the Combat stance
paths read that true as a sent request: they advanced their attempt clocks,
counted a failed try and logged a retry. With the engine turning non-teardown
actions away around a teleport or a death, chained refusals could reach
NoWandFlipMaxFails and set _magicModeBlocked / _wandSwapExhausted.
- ChangeCombatModeFor returns false on a refusal, without Begin. The other
*For helpers already return the host result. The no-ChangeCombatMode host
case still returns true (nothing to send or pace).
- Callers stamp their bookkeeping only on true: BuffManager peace-for-kit
paths (_lastCastAttempt, _healWaitKind); CorpseOpenController's peace
before an open and MissileCraftingManager's peace before the first combine
are asked again until accepted, inside their 2.5 s ceiling counted from the
first ask; the stuck-stance clocks (BuffManager, CombatManager) start only
once a stance request has gone out; ExpressionEngine's cast-stance flip
throttle; the CombatManager stall-watchdog toggle, whose ladder step is
taken back (CombatStallWatchdog.Unfire) when the toggle is refused.
- ActionPacer tracks a streak of consecutive engine refusals (one log line
when it starts, one when an accepted call ends it). After
EngineRefusalFailOpenMs (30 s) ChangeCombatModeFor returns true again, so a
permanent refusal (missing hook, full ring) is counted by the callers' own
failure paths instead of retrying forever. A gap of more than RefuseGapMs
(10 s) starts a new streak; Reset() and Forget() end it.
- ActionPacer.LastEngineRefusalMs: a refusal newer than a stuck-stance
clock's start restarts that clock, so a request accepted and then dropped
by a teleport does not end in a re-equip UseObject on the wielded weapon.
Tests: FakeHost.CombatModeRefuse; ActionPacingTests (refusals burn no try or
backoff, streak, fail-open, expiry and Forget, stuck clock restart, 20 s
no-wand loop never reaches _magicModeBlocked, peace-before-open retry,
MissileCraftingManager), WeaponTests (equip pass keeps its backoff),
CombatHookTests, CombatStallWatchdogTests (Unfire).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A snapshot of the working tree for aelrynth.com/git/: the code, build files
and public docs. Internal review notes and agent instructions are left out.
MIT licensed; see LICENSE.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>