refactor!: redesign Agent Lightning for the next major version - #531
Closed
huzhen (hihuzhen) wants to merge 71 commits into
Closed
refactor!: redesign Agent Lightning for the next major version#531huzhen (hihuzhen) wants to merge 71 commits into
huzhen (hihuzhen) wants to merge 71 commits into
Conversation
Status: complete task 1.x contract stabilization (1.1~1.6). - freeze AlgorithmContext usage and context-aware algorithm adapter execution - align Algorithm.run/trainer/litagent paths to context contract - lock core runtime types (RolloutResult, AgentSpanPayload, SpanWriteResult, SpanWriter) and status transition boundaries - clarify store state transition ownership rules and baseline span rewrite behavior - include regression tests in apo/baseline/decorator/runner/store/core/trainer/types - verification: uv run --no-sync pytest tests/algorithm/test_apo.py tests/algorithm/test_baseline.py tests/algorithm/test_decorator.py tests/runner/test_agent_runner.py - verification: uv run --no-sync pytest tests/store/test_core.py tests/store/test_utils.py tests/trainer/test_trainer_dev.py tests/types/test_core.py -m "not mongo"
Status: update task 2 to completed in major-version todo list. - normalize queueing wording to queuing in store runtime docs/comments and deep-dive docs - fix state transition guard that used non-existent 'queueing' rollout status literal - run smoke test: pytest tests/store/test_core.py -k dequeue_rollout_skips_non_queuing_status -m 'not mongo'
Note: - Remove legacy trainer component builders and registry helpers so core Trainer accepts concrete component instances only. - Default missing algorithms through Baseline while keeping internal algorithm state non-optional. - Clean agentlightning typing boundaries across stores, tracers, instrumentation, VERL, Weave, emitters, adapters, and utilities without broad type widening. - Update examples, docs, benchmarks, and trainer tests for the stricter Trainer API. Verification: - UV_CACHE_DIR="/Users/zhen/projects/agent-lightning/.cache_uv" XDG_CACHE_HOME="/Users/zhen/projects/agent-lightning/.cache_xdg" uv run --no-sync pyright agentlightning - UV_CACHE_DIR="/Users/zhen/projects/agent-lightning/.cache_uv" UV_TOOL_DIR="/Users/zhen/projects/agent-lightning/.uv_tools" uvx ruff check <changed Python files> - UV_CACHE_DIR="/Users/zhen/projects/agent-lightning/.cache_uv" XDG_CACHE_HOME="/Users/zhen/projects/agent-lightning/.cache_xdg" uv run --no-sync black --check <changed Python files> - UV_CACHE_DIR="/Users/zhen/projects/agent-lightning/.cache_uv" XDG_CACHE_HOME="/Users/zhen/projects/agent-lightning/.cache_xdg" uv run --no-sync isort --check-only <changed Python files> - UV_CACHE_DIR="/Users/zhen/projects/agent-lightning/.cache_uv" XDG_CACHE_HOME="/Users/zhen/projects/agent-lightning/.cache_xdg" uv run --no-sync pytest -q tests/trainer/test_trainer_init.py tests/trainer/test_trainer_dev.py tests/litagent tests/emitter tests/types/test_resources.py tests/utils/test_otel.py tests/adapter tests/store/test_core.py tests/store/test_threading.py -m "not mongo"
Use a concrete default algorithm instead of overloading None, preserve precise span batch outcomes, and drain claimed runner work before managed store shutdown. Remove the unused resource registry path and update regression tests and optimization notes.
Bound runner draining before shutdown escalation, propagate APO template failures, reject conflicting runner counts, and forbid unsupported agent span payload fields. Report bulk span outcomes from backend-confirmed item indexes and treat unknown writes as failures; update regression tests and optimization notes.
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.
No description provided.