Skip to content

feat: include retry history in JSON output for send commands - #23

Merged
dapi merged 2 commits into
mainfrom
feature/issue-21-feat-include-retry-history-in-json-outpu
Mar 13, 2026
Merged

feat: include retry history in JSON output for send commands#23
dapi merged 2 commits into
mainfrom
feature/issue-21-feat-include-retry-history-in-json-outpu

Conversation

@dapi

@dapi dapi commented Mar 13, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • npx vitest run — 140 tests pass (19 new retry tests)
  • tgcli send text --to @chan --message "test" --retries 3 --json — verify retry_log in output on failure
  • tgcli send text --to @chan --message "test" --retries 0 --json — verify no retry_log when no retries
  • Verify stderr output in both JSON and human-readable modes during retries

Closes #21

🤖 Generated with Claude Code

dapi and others added 2 commits March 13, 2026 11:01
Add --retries flag to `send text` and `send file` commands with
exponential backoff. When retries occur, JSON output includes
retry_log array and attempts count. Retry progress is written
to stderr (JSON in --json mode, human-readable otherwise).

Closes #21

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- withSendRetry now only retries rate_limit and network errors;
  api errors (CHAT_WRITE_FORBIDDEN, PEER_ID_INVALID) throw immediately
- Add maxWaitSeconds option (default 300s) to cap FLOOD_WAIT delays
- Include waitSeconds in retryLog entries for full retry visibility
- Remove duplicate formatErrorMessage/parseRequiredWaitSeconds from cli.js,
  import from core/retry.js instead
- Fix refreshDialogsWithRetry to log to stderr instead of stdout

Closes review findings from PR #23. See #25 for remaining refactoring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dapi
dapi merged commit 2789821 into main Mar 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: include retry history in JSON output for send commands

1 participant