feat(telegram): approval expiry UX, daily budget in /stats, friendly run errors - #229
Merged
Conversation
…run errors UX/ergonomics improvements from a 3-persona review (product design, power user, reliability): - Approval prompts now state their deadline and are visibly marked Expired with buttons removed on timeout, so stale inline keyboards can't be tapped after the wait window closes. The footer length is budgeted into the 4096-char truncation math. - /stats surfaces daily token usage against daily_token_budget (used/limit with percentage; 'unlimited' when no cap). - Agent-run failures map to actionable chat messages: rate limits explain attempts, retry hint and point to /stats; timeouts state nothing was executed and the session is intact. Generic errors keep the raw message. Docs: TELEGRAM.md approval-expiry and /stats sections updated.
…timeout copy Independent adversarial review findings applied: - Remove trailing periods from new MarkdownV2 strings in the approver (unescaped '.' outside entities risks Telegram parse rejection); the Expired edit and the expiry footer now match the escaping discipline used elsewhere in the codebase. - Fix latent inconsistency: buildApprovalText now appends the footer variable instead of a duplicate Fprintf literal (keeps the 4096 budget accounting honest if the footer ever changes). - Timeout/rate-limit error copy no longer claims 'nothing was executed' — these errors wrap the whole run, so earlier tools may have executed. Now states the session is intact and completed work is saved. Test assertion updated to match the honest wording.
…ases, edit-error logging - Expiry test now pins that the expired edit strips the inline keyboard (reply_markup with empty inline_keyboard), not just the Expired text. - New tests: wrapped context.DeadlineExceeded maps to the timeout message (providers wrap deadlines in transport errors); formatThousands unit cases (0, boundaries, millions, negative); /stats shows honest >100% when usage exceeds the daily budget. - approver: log a failed Expired edit instead of discarding the error, so stuck keyboards are diagnosable.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
odek | 0edc3b4 | Commit Preview URL Branch Preview URL |
Sep 10 2026, 09:58 AM |
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.
Summary
Telegram UX/ergonomics improvements from a multi-persona review (product design, power user, reliability), hardened through two rounds of independent adversarial judge review:
/statsdaily budget: showsDaily tokens: 4,200 / 10,000 (42%)againstdaily_token_budget(orunlimited), including honest >100% over-budget display./stats; timeouts state the session is intact and completed work is saved (no overclaiming); generic errors keep the raw message.Review process
Test plan
internal/telegram: full suite green with-race -count=1cmd/odektelegram-related tests green with-race -count=1go build ./...,go vet,golangci-lint: cleanDocs
docs/TELEGRAM.md: approval-expiry behavior + updated/statsdescription