Repository navigation
docs: clarify failed rollout handling and reward semantics - #706
Open
Baixin Guo (GBX-Max1220) wants to merge 2 commits into
Open
Baixin Guo (GBX-Max1220) wants to merge 2 commits into
Baixin Guo (GBX-Max1220) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The documentation omits that a non-numeric final reward event causes training to use the configured fallback rather than an earlier numeric reward.
1 open issue
What changed in this PR
This documentation-only PR addresses #448 by explaining failed-rollout handling in Agent Lightning v1.0 and distinguishing framework behavior from user-defined training policy.
Changes:
- Documents retry boundaries, terminal states, and how failed rollouts reach training.
- Explains reward defaults and provides an example separating task outcomes from infrastructure errors.
- Clarifies filtering options, lifecycle hooks, and unsupported older APIs.
| File | Description |
|---|---|
docs/05-basics.md |
Adds failed-rollout guidance, a decision table, a minimal example, and adapter limitations. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #448.
This is a documentation-only change to
docs/05-basics.md. It adds a short "Handling failed rollouts" subsection to the existing Basics guide. No production code is modified.Issue #448 discusses APIs that no longer exist at current HEAD (
RolloutConfig.max_attempts,agl.emit_exception,agl.TracerTraceToTriplet). This contribution documents the behavior actually implemented in v1.0 instead of reviving the older workaround.What the section clarifies
Rollout-level retry. There is no automatic retry of a
FAILEDrollout;FAILEDis terminal. The Gateway only makes up to six attempts for each proxied model call on transport errors, timeouts,408,409,429, and5xx(six includes the initial request). Re-enqueuing needs a freshrollout_id.NoneversusFAILED. ReturningNonefromrun()is not a failure signal: the worker ignores the return value and exits with code 0, so the rollout becomesSUCCEEDEDregardless of whether a reward event was recorded. Only an uncaught exception exits non-zero and marks the rolloutFAILED.FAILEDrollouts still enter adapter processing. The trainer builds aCompletedRolloutfrom any terminal rollout, includingFAILED, and passes it to the adapter. Model calls recorded before the failure remain in the partial trace; they are not dropped automatically.Missing reward default. When no
rewardevent was recorded,reward_fillna_value(default0.0) supplies the reward for any rollout, successful or failed. An infrastructure failure after a few successful model calls can therefore produce zero-reward training rows indistinguishable from a genuine zero-reward outcome.Infrastructure failure versus legitimate task failure. A decision table separates framework behavior from user policy across five situations: transient and persistent infrastructure failures, exceptions in sub-agents, valid task failures, and excessive failures in a batch. Task outcomes — including wrong answers — should be reported with an explicit numeric
rewardevent; infrastructure errors should not be converted into0.0rewards.Scope notes
RolloutHooks.on_failedis documented as a lifecycle callback, not a filter; filtering must happen oncompleted_rolloutsbefore the adapter consumes them.RolloutAdapterdirectly and exposes no adapter injection point.Validation:
mkdocs build --strict, embedded snippetpy_compile,git diff --check, andgit apply --checkall pass. Single-file diff.