fix: clear stale Telegram CAS bindings before reuse#91
fix: clear stale Telegram CAS bindings before reuse#91kesslerio wants to merge 4 commits intopwrdrvr:mainfrom
Conversation
|
I did another pass on the current branch, not the earlier narrower diff. One thing still worries me.
The tests cover the stale-binding case (
That is the only real thing I would still patch before merge. |
|
Patched the preflight issue I called out in the last review pass. The controller still clears a binding when the thread is clearly gone. That part stays the same. What changed is the generic failure path. If I also added a regression for that case. Checks I reran after the patch:
|
Fixes #94.
What
cas_statusand turn startup from restoring a binding that was already cleared during that checkresume-threadcallbacks for the same conversation once one resume choice moves into approval or succeedsWhy
A resumed Telegram topic could still look bound and yet behave like it was dead. In the April 11 case, the thread itself was still resumable. What had drifted was the binding state around it.
That showed up in two places:
/cas_resumeattempts could leave old resume callbacks behind for the same topicThis patch cleans up both parts. It keeps the controller from reusing dead bindings, and it clears old resume choices once a topic starts binding again.
Tests
pnpm test src/controller.test.tspnpm test src/state.test.tspnpm typecheckpnpm testAI Assistance
I used Codex to inspect local gateway and plugin state, trace the binding lifecycle, implement the fix, and run the tests above.