Repository navigation
Conversation
|
ningyixi please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
1 similar comment
|
ningyixi please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
There was a problem hiding this comment.
🟢 Approval recommended
The narrow fix follows existing error handling and includes regression coverage for both affected formats.
No open issues 🎉
What changed in this PR
Prevents overflowing logprob values from failing triplet event queries.
Changes:
- Handles
OverflowErrorusing the existing unusable-logprobs fallback. - Adds API regression coverage for chat and completion formats, verifying token IDs survive and logprobs become
null.
| File | Description |
|---|---|
| tests/server/test_endpoints.py | Tests overflowing logprobs in both response formats. |
| agentlightning/server/routes/events.py | Catches overflow during logprob conversion. |
Review effort: Balanced
An oversized integer logprob (for example,
10**400) raisesOverflowErrorduringfloat()conversion, causingGET /api/rollouts/{id}/events?format=tripletto fail instead of marking the sample's logprobs unusable.Handle
OverflowErroralongside the existing conversion errors. Add API-level regression coverage for both chatlogprobs.contentand completionlogprobs.token_logprobs, checking that token IDs survive andresponse_log_probsisnull.Validation:
OverflowErrorbefore the fix.uv run --locked --no-sync pytest -q tests/server— 34 passed.Prepared with Codex AI assistance; the diff and before/after regression results were checked locally. No model service or GPU is needed for these tests.