Skip to content

alerting: retry transient Kimi requests and raise Full CI read timeout - #120

Merged
Thangnguyenvn98 merged 1 commit into
mainfrom
agent/kimi-transient-retry
Sep 3, 2026
Merged

Thangnguyenvn98 merged 1 commit into
mainfrom
agent/kimi-transient-retry

Conversation

@Thangnguyenvn98

Copy link
Copy Markdown
Collaborator

Why

The Full CI analysis for build #86943 (2026-09-03 02:00 UTC timer fire) failed 24 minutes in:

full_ci_analyze  status=failed  last_error: kimi API request failed: The read operation timed out

One completion exceeded the 300s urllib read timeout, UrllibTransport raised, and the analyzer discarded the entire run. No report row, no outbox entry, no Slack message. The build stayed pending until a manual systemctl start alerting-full-ci.service.

What

  • Classify transport failures. TransientTransportError for read timeouts, connection errors, HTTP 429 and 5xx; other 4xx and malformed JSON remain permanent AnalyzerError.
  • Retry inside the budget. KimiCodeRunner._request retries transient failures up to 3 times with 5s/15s backoff and refuses to sleep past the whole-analysis deadline. The final error carries the attempt count so last_error in Postgres is self-explanatory.
  • Per-request timeout knob. KIMI_REQUEST_TIMEOUT_SECONDS, default 900 for the Full CI analyzer (worker.py, build_full_ci_analysis_runtime). Main CI keeps 300s per request and gains the retry.
  • Docs: alerting/docs/full-ci.md lists both knobs and the retry policy.

Verification

  • pytest: 194 passed (5 new in tests/test_kimi.py — retry-then-succeed with [5.0, 15.0] sleeps, give up after 3 attempts, permanent 400 not retried, retry refused near the deadline, urllib classification).
  • ruff check .: clean.
  • mypy --strict: clean on every touched file. Remaining errors (control.py:92, analyzer.py:890, tests/test_worker.py:247-248) are pre-existing on main.

Deploy

Needs the worker's /opt/alerting/source refreshed via deploy/aws/install.sh after merge (operations doc §9).

🤖 Generated with Claude Code

@vercel

vercel Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vllm-ci-dashboard Ready Ready Preview Sep 3, 2026 3:43am UTC

Request Review

The Full CI analysis for build #86943 (2026-09-03 02:00 UTC fire) failed
24 minutes in with "kimi API request failed: The read operation timed out".
A single completion exceeded the 300s urllib read timeout, the transport
raised, and the whole analysis was discarded with no retry, so no report
reached Slack.

Classify transport failures: read timeouts, connection errors, and HTTP
429/5xx raise TransientTransportError; other 4xx and malformed bodies stay
permanent. KimiCodeRunner retries transient failures up to three times
with 5s then 15s backoff, never sleeping past the whole-analysis deadline,
and records the attempt count in the error when it gives up.

Add a per-request timeout knob. The Full CI analyzer now defaults to 900s
per completion via KIMI_REQUEST_TIMEOUT_SECONDS; Main CI keeps 300s and
gains the retry. Document both knobs in alerting/docs/full-ci.md.

Signed-off-by: Thang Nguyen <thang.nguyen@inferact.ai>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Thangnguyenvn98
Thangnguyenvn98 force-pushed the agent/kimi-transient-retry branch from e819e2c to 99e6e86 Compare September 3, 2026 03:42
@Thangnguyenvn98
Thangnguyenvn98 merged commit 9191358 into main Sep 3, 2026
3 of 4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 99e6e867 Deployed Sep 3, 2026 by vercel[bot]
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.

1 participant