Problem
When using --json mode, logSendRetry is completely suppressed — retry attempts produce zero output. If a command retries multiple times and eventually succeeds or fails, the user in JSON mode only sees the final result with attempts: N but has no visibility into what happened during retries.
Current Behavior
tgcli send photo --to @chan --photo ./img.png --retries 3 --json
# Output (success after 2 retries):
{"ok":true,"method":"sendPhoto","message_id":123,"attempts":3}
# No information about WHY it retried or what errors occurred
Proposed Solutions
Two complementary approaches:
Option A: Add retry log to final JSON payload
{
"ok": true,
"method": "sendPhoto",
"message_id": 123,
"attempts": 3,
"retry_log": [
{"attempt": 1, "error": {"type": "network", "message": "ECONNRESET", "code": "ECONNRESET"}},
{"attempt": 2, "error": {"type": "network", "message": "ECONNRESET", "code": "ECONNRESET"}}
]
}
Option B: Write retry progress to stderr in JSON mode
Retry logs go to stderr (not stdout) so JSON parsers aren't affected.
Recommendation
Option A is more useful for programmatic consumers. Option B is simpler to implement. Both can coexist.
Context
Found during PR #18 review by silent-failure-hunter agent.
🤖 Generated with Claude Code
Problem
When using
--jsonmode,logSendRetryis completely suppressed — retry attempts produce zero output. If a command retries multiple times and eventually succeeds or fails, the user in JSON mode only sees the final result withattempts: Nbut has no visibility into what happened during retries.Current Behavior
Proposed Solutions
Two complementary approaches:
Option A: Add retry log to final JSON payload
{ "ok": true, "method": "sendPhoto", "message_id": 123, "attempts": 3, "retry_log": [ {"attempt": 1, "error": {"type": "network", "message": "ECONNRESET", "code": "ECONNRESET"}}, {"attempt": 2, "error": {"type": "network", "message": "ECONNRESET", "code": "ECONNRESET"}} ] }Option B: Write retry progress to stderr in JSON mode
Retry logs go to stderr (not stdout) so JSON parsers aren't affected.
Recommendation
Option A is more useful for programmatic consumers. Option B is simpler to implement. Both can coexist.
Context
Found during PR #18 review by silent-failure-hunter agent.
🤖 Generated with Claude Code