Repository navigation
fix: act on the checked target, refuse undeclared flags, keep done calls done - #220
Merged
Merged
Conversation
The guard resolved the account and the chat, then the command resolved both again. An account switch or a cache change in between could make a command act on a chat that was never checked. The check now pins args.account and hands its resolved chat to tg send and tg messages read. Refs #217 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…drop citty reads an unknown --acount 2 as true and drops the value, so the command ran on the active account; --silent false ran as --silent. The guard now refuses both with INVALID_ARGS before the command runs. tg api and tg sql pass their flags on and are not checked. Refs #217 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…itten The success log ran inside the try, so a failed local insert turned a completed write into an error and invited a retry that repeated it. Refs #217 Co-Authored-By: Claude Opus 5.5 <[email protected]>
3 tasks done
This was referenced Nov 19, 2026
Merged
3 tasks done
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.
What and why
Three of the four defects in #217, in shared code used by every write command:
args.accountto the account it checked and hands its resolved chat totg sendandtg messages read(checkedChat). A switch of the active account or a cache change in between no longer moves the command.--acount 2astrueand drops the2, and--silent falseas--silent. The guard now refuses both withINVALID_ARGS(exit 3) before the command runs.tg apiandtg sqlpass their flags on, so they are not checked.api_activityinsert after a successful call threw fromtrackApiCall, so a retry repeated the write. The log write is now outside the call'stryand never changes the call's outcome. A failed write shows only in--verbose.The stale
@usernamepart (item 2 of #217) is in a separate PR. It adds acontacts.resolveUsernamecall for writes and needs a live run first.Refs #217
How I checked it
Each new test fails on
mainand passes here: the guard test switches the account and moves@testuserto another user between the check and the run;undeclaredArgunit tests; the e2e refusal of--acount 2and--silent falsewithout credentials;trackApiCallwith theapi_activitytable dropped.bun run check,bun run test(1200 pass),bun run test:e2e(339 pass),bun run build;dist/tg send --to me -m hi --silent falseexits 3 before connecting.No new Telegram calls, so no live run. The test session is logged out, and the smoke suite fails the same way on
main.Tests pass locally and use made-up data only
README, docs and affected demos follow the product content standard
Title follows the repo's commit style
🤖 Generated with Claude Code