mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
fix(gateway): keep tool-progress edits alive after Telegram flood control
When a progress-message edit hits Telegram flood control (RetryAfter), can_edit was unconditionally set to False, permanently disabling coalescing for the rest of the run. Subsequent tool updates were posted as separate new messages instead of updating the existing progress bubble. Fix: only set can_edit=False for non-recoverable edit errors. On flood control, back off by resetting _last_edit_ts so the throttle interval is respected before the next edit attempt. Fixes #25188
This commit is contained in:
parent
256c4c1b4a
commit
1b3c51bccc
1 changed files with 6 additions and 5 deletions
|
|
@ -15463,14 +15463,15 @@ class GatewayRunner:
|
|||
if not result.success:
|
||||
_err = (getattr(result, "error", "") or "").lower()
|
||||
if "flood" in _err or "retry after" in _err:
|
||||
# Flood control hit — disable further edits,
|
||||
# switch to sending new messages only for
|
||||
# important updates. Don't block 23s.
|
||||
# Flood control hit — backoff but keep editing.
|
||||
# Only disable edits for non-recoverable errors.
|
||||
logger.info(
|
||||
"[%s] Progress edits disabled due to flood control",
|
||||
"[%s] Progress edit flood control, backing off",
|
||||
adapter.name,
|
||||
)
|
||||
can_edit = False
|
||||
_last_edit_ts = time.monotonic()
|
||||
else:
|
||||
can_edit = False
|
||||
_flood_result = await adapter.send(
|
||||
chat_id=source.chat_id,
|
||||
content=msg,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue