Repository navigation
fix(api): log every Telegram callback press - #195
Conversation
A scout Create spike press left no trace when its callback data did not parse, when the message carried no keyboard, or when it succeeded, so a press that did nothing on screen could not be told apart from one Telegram never delivered. Log each press on arrival and each outcome.
|
Claude finished @mashkovd's task in 12s —— View job Review of PR #195
Verdict: approved. P1: 0, P2: 0, P3: 1.
The logging is bounded and gives every press a line. Failed |
| // handleTelegramCallback handles an inline-button press. Refusals log only a | ||
| // reason and chat type, never chat or user ids. A press from a chat or user | ||
| // that is not allowed gets no Telegram call at all. | ||
| // callbackDataForLog bounds callback data for logging. The Bot API caps it at |
There was a problem hiding this comment.
P3 — The handleTelegramCallback doc comment (lines 450-452) is now directly above callbackDataForLog's doc, so Go attaches it to the wrong declaration and handleTelegramCallback has none. Move the two helpers above that comment, or move the comment back down to the function.
Antigravity (agy) review — informationalModel: gemini-3.8-flash-high · commit No significant issues found. |
|
Claude finished @mashkovd's task in 22s —— View job Review of PR #195 (commit 0104425)
Verdict: approved. P1: 0, P2: 0, P3: 1.
The arrival line is bounded and carries no chat or user ids. Every previously silent path now logs a reason, and failed |
| } | ||
| } | ||
|
|
||
| // callbackDataForLog bounds callback data for logging. The Bot API caps it at |
There was a problem hiding this comment.
P3 — const max shadows the Go 1.21+ builtin max, and data[:max] can cut a multi-byte rune in half. Neither matters here (slog quotes the value), but a rename and a rune-safe cut would be tidier.
Antigravity (agy) review — informationalModel: gemini-3.8-flash-high · commit No significant issues found. |
Why
Owner presses of the scout Create spike N button produce nothing visible and no line in the mctl-agent log. Three paths in
handleTelegramCallbackwere silent: callback data that does not matchscout:create:N, a message without a keyboard ("message unavailable"), and success. That leaves no way to tell a press that reached the agent from one Telegram never delivered.What
telegram callback receivedfor every press, with the callback data (bounded to 64 bytes, the Bot API limit) and whether the message is present. No chat or user id is logged, whichTestScoutCallbackAuthRefusalsstill pins.telegram callback refusedreason for unrecognised data and for a missing keyboard.scout spike createdon success.answerCallbackQueryis now logged instead of discarded.Tests
TestScoutCallbackEveryPressIsLoggedcovers the three previously silent paths. Mutation-checked: dropping the arrival line, or the unrecognised-data refusal, fails it.go test ./...passes.🤖 Generated with Claude Code