Gateway loses model-request events for malformed or non-object upstream JSON
メンテナーはふだん 4 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 20/100
調査の方向性
Read agentlightning.server.proxy.forward_request and the existing endpoint cases in tests/server/test_proxy_response.py and tests/server/test_endpoints.py. Start by reproducing the malformed JSON and non-object response cases using the offline setup described in the issue. Done means these responses return a gateway error, record a model-request event, preserve upstream HTTP error statuses, and release the in-flight counter; linked PR #658 is already open.
索引モデルが issue の本文から書いたものです。
説明
Problem
On main at 05c7fe133175653e48c990546a3509e52dc56512, forward_request assumes the upstream response is a JSON object:
- malformed JSON with
Content-Type: application/jsonraises duringresponse.json(); - JSON arrays, strings, numbers and
nullreach_pop_routed_expertsand fail before_capture_event; - a non-JSON HTTP 200 response becomes
{}and is recorded as a successful model request.
The first two paths lose the model-request event, making a failed rollout harder to diagnose.
Offline reproduction
Replace agentlightning.server.proxy._send_upstream_with_retries with an async function returning httpx.Response(200, text="null", headers={"content-type": "application/json"}). Register a rollout and model, then POST a normal chat-completion request through the gateway. The request raises instead of returning a gateway error, and no model-request event is recorded. A response containing { reproduces the JSON parsing failure; HTTP 200 with HTML reproduces the empty successful response.
Proposed scope
I have a focused local patch and eight endpoint regression cases. The patch returns a structured upstream-response error for malformed/non-object/non-JSON responses, maps invalid responses below HTTP 400 to 502, and preserves existing upstream HTTP error statuses. It records the error and retry count and releases the in-flight counter. Valid object responses keep their current path.
Would this error/status contract be appropriate for a PR?
Validation
Windows, Python 3.12.14; FastAPI 0.162.0, HTTPX 0.28.1, pytest 9.1.1. Dependencies were installed from the declared ranges, not the frozen lockfile. No model calls or GPU use.
- Eight new cases: 8 failed before the patch.
python -m pytest -q tests/server/test_proxy_response.py tests/server/test_endpoints.py tests/test_client.py --tb=short: 51 passed after the patch.- Server/controller/examples/client tests: patched 101 passed, 9 failed; unchanged upstream 93 passed, the same 9 failed. These failures reference POSIX
os.killpg, unavailable on Windows. - Ruff lint/format and
git diff --check: passed.
I searched open PRs for upstream JSON response handling and non-JSON handling. #587 concerns request bodies; #574 concerns stored triplet export. Neither handles this response-ingestion path. AI assistance was used for investigation, the local patch and test execution.
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 1.7k
- 平均マージ
- 5日 22時間
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/agent-lightning のほかの issue
-
Local workers fail for non-coroutine awaitable run results対応中かも @Elon-Jiang が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/agent-lightning#666 ·
メンテナーはふだん 4 日以内に返信
-
Low-precision rollout normalization can overflow its divisor and erase advantages対応中かも @lll-hhh が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/agent-lightning#661 ·
メンテナーはふだん 4 日以内に返信
-
RayPPOTrainer._dump_generations() missing gts argument in _train_step call対応中かも @yunkai-yyk が 255 日前に担当しました。 オープンbug v0.x verl
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
microsoft/agent-lightning#492 ·
メンテナーはふだん 4 日以内に返信
-
enhancement store v0.x
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
microsoft/agent-lightning#372 · コメント 10 件 ·
メンテナーはふだん 4 日以内に返信
-
Proxy transport retry exhaustion is missing from rollout events対応中かも @feiiiiii5 が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
microsoft/agent-lightning#664 ·
メンテナーはふだん 4 日以内に返信
microsoft/agent-lightning の issue をすべて見る
似ている issue
-
Status: Triage Type: Quest
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
GTNewHorizons/GT-New-Horizons-Modpack#27490 ·
メンテナーはふだん 1 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
retentioneering/retentioneering-tools#231 ·
メンテナーはふだん 1 日以内に返信
-
backend bug documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
geolens-io/geolens#3568 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
mprov-ng/mprov_control_center#450 ·
メンテナーはふだん 1 日以内に返信