Repository Analysis

microsoft/agent-lightning

The absolute trainer to light up AI agents.

16.4 Moderate AI signal View on GitHub
16.4
Adjusted Score
16.4
Raw Score
100%
Time Factor
2026-04-29
Last Push
17,254
Stars
Python
Language
144,302
Lines of Code
527
Files
1822
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 4HIGH 82MEDIUM 120LOW 1616

Pattern Findings

1822 matches across 20 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers1078 hits · 954 pts
SeverityFileLineSnippet
LOWtests/test_env_var.py15def test_resolve_bool_env_var_override_takes_precedence(monkeypatch: pytest.MonkeyPatch) -> None:
LOWtests/test_env_var.py33def test_resolve_bool_env_var_parses_truthy_and_falsy_values(
LOWtests/test_env_var.py42def test_resolve_bool_env_var_returns_fallback_when_unset(monkeypatch: pytest.MonkeyPatch) -> None:
LOWtests/test_env_var.py49def test_resolve_bool_env_var_rejects_invalid_value(monkeypatch: pytest.MonkeyPatch) -> None:
LOWtests/test_env_var.py57def test_resolve_int_env_var_reads_from_environment(monkeypatch: pytest.MonkeyPatch) -> None:
LOWtests/test_env_var.py64def test_resolve_int_env_var_invalid_input(monkeypatch: pytest.MonkeyPatch) -> None:
LOWtests/test_env_var.py72def test_resolve_str_env_var_override_and_fallback(monkeypatch: pytest.MonkeyPatch) -> None:
LOWtests/test_logging.py167def _logging_worker_files_string(queue: Queue[Dict[str, Any]], base_dir: str) -> None:
LOWtests/test_logging.py207def _logging_worker_files_mapping(queue: Queue[Dict[str, Any]], base_dir: str) -> None:
LOWtests/test_logging.py286def test_to_level_value_int_and_str() -> None:
LOWtests/test_logging.py296def test_setup_module_plain_console_spawn() -> None:
LOWtests/test_logging.py310def test_setup_module_color_rich_spawn() -> None:
LOWtests/test_logging.py323def test_setup_with_submodules_apply_to_and_capture_warnings_spawn() -> None:
LOWtests/test_logging.py343def test_setup_with_console_and_extra_handler_spawn() -> None:
LOWtests/test_logging.py355def test_setup_files_string_spawn(tmp_path: Path) -> None:
LOWtests/test_logging.py383def test_setup_files_mapping_spawn(tmp_path: Path) -> None:
LOWtests/test_config.py185def test_get_param_type_details(
LOWtests/test_config.py226def test_determine_argparse_type_and_nargs(
LOWtests/test_config.py324def test_add_argument_for_parameter(
LOWtests/test_config.py360def test_add_arguments_for_class(mock_parser: Any) -> None:
LOWtests/test_config.py388def test_add_arguments_for_class_no_init_params(mock_parser: Any) -> None:
LOWtests/test_config.py397def test_create_argument_parser() -> None:
LOWtests/test_config.py455def test_instantiate_classes_error_handling(caplog):
LOWtests/test_config.py484def test_lightning_cli_no_classes():
LOWtests/test_config.py489def test_lightning_cli_simple_config():
LOWtests/test_config.py502def test_lightning_cli_complex_config_types():
LOWtests/test_config.py543def test_lightning_cli_complex_config_defaults():
LOWtests/test_config.py560def test_lightning_cli_multiple_classes():
LOWtests/test_config.py587def test_lightning_cli_missing_required_arg_exits(capsys):
LOWtests/test_config.py596def test_lightning_cli_optional_no_default_behavior():
LOWtests/test_client.py70async def test_uri_and_semantic_correctness(server_setup: Dict[str, Any], sample_resources: NamedResources):
LOWtests/test_client.py102async def test_full_lifecycle_async(
LOWtests/test_client.py200async def test_task_timeout_and_requeue(server_setup: Dict[str, Any]):
LOWtests/test_client.py238async def test_error_handling_no_resources(server_setup: Dict[str, Any]):
LOWtests/test_client.py257async def test_client_with_bad_endpoint():
LOWtests/test_client.py274def test_local_client_core_functionality(sample_resources: NamedResources):
LOWtests/test_client.py338def test_local_client_error_handling(sample_resources: NamedResources):
LOWtests/test_client.py369async def test_local_client_async_methods(sample_resources: NamedResources):
LOWtests/benchmark/analysis.py254def histogram_sum_metric_name(bucket_metric: str) -> str:
LOWtests/benchmark/analysis.py260def histogram_count_metric_name(bucket_metric: str) -> str:
LOWtests/benchmark/analysis.py407def gather_collection_throughput(
LOWtests/benchmark/analysis.py747def render_metric_group_table(
LOWtests/benchmark/benchmark_store.py228 async def algorithm_batch_with_completion_threshold(self, total_tasks: int, batch_size: int, remaining_tasks: int):
LOWtests/benchmark/micro_benchmark.py123def simulate_many_update_workers(store_url: str) -> BenchmarkSummary:
LOWtests/benchmark/micro_benchmark.py162def simulate_dequeue_empty_and_update_workers(store_url: str) -> BenchmarkSummary:
LOWtests/benchmark/micro_benchmark.py214def simulate_rollout_with_spans(store_url: str, spans_per_attempt: int = 4) -> BenchmarkSummary:
LOWtests/benchmark/micro_benchmark.py349def dequeue_and_update_attempts(store_url: str, spans_per_attempt: int = 4) -> BenchmarkSummary:
LOWtests/benchmark/micro_benchmark.py27async def _enqueue_rollouts_for_benchmark(store_url: str, *, total_rollouts: int, task_prefix: str) -> None:
LOWtests/benchmark/micro_benchmark.py143def _dequeue_empty_and_update_workers_task(args: tuple[str, str, str]) -> bool:
LOWtests/benchmark/micro_benchmark.py273 async def _query_remaining_rollouts() -> List[str]:
LOWtests/benchmark/micro_benchmark.py294def _dequeue_and_update_attempt_task(args: tuple[str, str, str, int]) -> bool:
LOWtests/benchmark/micro_benchmark.py381def benchmark_multi_metrics_backend(iterations: int = 10_000_000) -> BenchmarkSummary:
LOWtests/tracer/test_dummy.py18def test_dummy_tracer_create_span_uses_defaults(monkeypatch: pytest.MonkeyPatch) -> None:
LOWtests/tracer/test_dummy.py32def test_dummy_tracer_operation_context_records_span(monkeypatch: pytest.MonkeyPatch) -> None:
LOWtests/tracer/test_dummy.py49def test_dummy_tracer_operation_context_records_exceptions(monkeypatch: pytest.MonkeyPatch) -> None:
LOWtests/tracer/test_dummy.py71def test_set_active_tracer_returns_same_instance() -> None:
LOWtests/tracer/test_dummy.py77def test_set_active_tracer_raises_when_existing() -> None:
LOWtests/tracer/test_dummy.py83def test_clear_active_tracer_removes_current() -> None:
LOWtests/tracer/test_agentops.py134def test_agentops_tracer_create_span(agentops_tracer: AgentOpsTracer) -> None:
LOWtests/tracer/test_agentops.py152def test_agentops_tracer_operation_context_records_exception(agentops_tracer: AgentOpsTracer) -> None:
1018 more matches not shown…
Docstring Block Structure66 hits · 330 pts
SeverityFileLineSnippet
HIGHcontrib/recipes/webshop/agl/tasks.py47Load tasks from a JSON or Parquet file. Args: path: Path to the tasks file (JSON or Parquet format). R
HIGHcontrib/recipes/envs/add_instruction.py35 Retrieve an instruction string from INSTRUCTION_MAP based on the given type. Args: type (str): Instruc
HIGHcontrib/recipes/envs/add_instruction.py88 Append an instruction to a single prompt or a chat-style prompt. - If `prompt` is a string, the instruction is
HIGH…b/agentlightning/contrib/algorithm/env_verl/trainer.py261Compute reference log probability using the correct worker based on LoRA configuration. In verl 0.6.0+, when Lo
HIGHexamples/chartqa/multimodal_utils.py28 Encode an image to base64 string for multimodal LLM APIs. Args: image: Image source (file path, URL, o
HIGHexamples/chartqa/multimodal_utils.py87 Create an OpenAI-compatible multimodal message. Args: text: The text prompt/question image: Im
HIGHexamples/claude_code/claude_code_controller.py186Runs the agent on a specific SWE-bench instance. This method orchestrates the agent execution via the specified
HIGHexamples/claude_code/swebench_utils/docker_runtime.py377 Start a Docker container session for repository testing. Args: image_name (str): Base Dock
HIGHagentlightning/logging.py19Create or reset a namespaced logger with a consistent console format. This helper clears any previously attached ha
HIGHagentlightning/logging.py109Configures logging for the `agentlightning` logger hierarchy. This function provides a one-stop setup utility for c
HIGHagentlightning/llm_proxy.py84Extract LiteLLM request payload from hook args. The LiteLLM logger hooks receive `(*args, **kwargs)` whose third po
HIGHagentlightning/llm_proxy.py1321Create an `LLM` resource pointing at this proxy with rollout context. The returned endpoint is: `ht
HIGHagentlightning/tracer/base.py141Notify the tracer that a span should be created here. It uses a fire-and-forget approach and doesn't wait for t
HIGHagentlightning/tracer/base.py163Start to record an operation to a span. Args: name: The name of the operation. attribut
HIGHagentlightning/types/resources.py111Return the routed endpoint for a specific rollout/attempt pair. Args: rollout_id: Identifier of the
HIGHagentlightning/types/tracer.py390Build a synthetic span from raw attributes. Different from the [`from_opentelemetry`][agentlightning.Span.from_o
HIGHagentlightning/emitter/annotation.py315Entry point for tracking operations. This helper can be used either as a decorator or as a context manager. The
HIGHagentlightning/emitter/reward.py155Emit a reward value as an OpenTelemetry span. Examples: Emit a single-dimensional reward: >>> emit_
HIGHagentlightning/runner/agent.py802Execute a single task directly, bypassing the task queue. This method creates a new rollout for the given input
HIGHagentlightning/runner/base.py165Execute a single task with the given input. This method provides fine-grained control for executing individual
HIGHagentlightning/utils/metrics.py41Validates label keys against the metric definition. Args: kind: Metric kind for error messages ("counter" o
HIGHagentlightning/utils/id.py10Generate a random hexadecimal ID of the given length. Args: length: The desired length of the generated ID.
HIGHagentlightning/utils/otel.py146Resolve the OpenTelemetry tracer configured for Agent Lightning. Args: use_active_span_processor: Whether t
HIGHagentlightning/utils/otel.py291Filter attributes that start with the given prefix. The attribute must start with `prefix.` or be exactly `prefix`
HIGHagentlightning/utils/otel.py306Filter attributes that start with the given prefix and unflatten them. The prefix will be removed during unflattenin
HIGHagentlightning/adapter/messages.py212Yield tool call payloads for a completion span. Args: completion: The completion span whose descend
HIGHagentlightning/adapter/triplet.py227Construct a tree from a flat list of spans. Args: spans: Spans that collectively form a single trac
HIGHagentlightning/algorithm/decorator.py159Execute the wrapped function with injected dependencies. Args: train_dataset: Optional training dat
HIGHagentlightning/algorithm/decorator.py226Convert a callable into a [`FunctionalAlgorithm`][agentlightning.algorithm.decorator.FunctionalAlgorithm]. The deco
HIGHagentlightning/algorithm/fast.py38Reference implementation that streams the full dataset through the rollout queue. The baseline algorithm batches ta
HIGHagentlightning/algorithm/apo/apo.py517 Initialize the beam search with seed prompt and dataset iterators. Args: train_dataset: Da
HIGHagentlightning/algorithm/apo/apo.py696 Evaluate all candidate prompts on validation data and select top-k for the beam. Args: can
HIGHagentlightning/verl/trainer.py209Compute reference log probability using the correct worker based on LoRA configuration. In verl 0.6.0+, when Lo
HIGHagentlightning/litagent/decorator.py141Execute a synchronous rollout using the wrapped function. Args: task: Task input data.
HIGHagentlightning/litagent/decorator.py161Execute an asynchronous rollout using the wrapped function. Args: task: Task input data.
HIGHagentlightning/litagent/decorator.py207Retrieve the first LLM resource from the available resources. Strip the ProxyLLM resource into a LLM resource i
HIGHagentlightning/litagent/decorator.py238Retrieve the first prompt template resource from the available resources. Args: resources: Mapping
HIGHagentlightning/litagent/decorator.py266Convert [`ProxyLLM`][agentlightning.ProxyLLM] instances into concrete LLMs. It resolves ProxyLLM instances to t
HIGHagentlightning/litagent/decorator.py307Create a [`FunctionalLitAgent`][agentlightning.litagent.decorator.FunctionalLitAgent] for LLM-based rollouts. Args:
HIGHagentlightning/litagent/decorator.py353Validate the function signature of an LLM rollout function. Ensures the function follows the expected pattern for L
HIGHagentlightning/litagent/decorator.py394Create a [`FunctionalLitAgent`][agentlightning.litagent.decorator.FunctionalLitAgent] for prompt-based rollouts. Th
HIGHagentlightning/litagent/decorator.py435Validate the function signature of a prompt rollout function. Ensures the function follows the expected pattern for
HIGHagentlightning/litagent/decorator.py466Create a [`FunctionalLitAgent`][agentlightning.litagent.decorator.FunctionalLitAgent] from an arbitrary rollout function
HIGHagentlightning/trainer/init_utils.py152Build and return a component instance from a flexible specification. This function provides a flexible way to creat
HIGHagentlightning/store/base.py167Register a rollout and immediately create its first attempt. !!! note Use [`enqueue_rollout()`][age
HIGHagentlightning/store/base.py208Persist a rollout in `queuing` state so runners can claim it later. !!! note Different from [`start
HIGHagentlightning/store/base.py251Claim the oldest queued rollout and transition it to `preparing`. This function do not block. Retrieva
HIGHagentlightning/store/base.py301Create a manual retry attempt for an existing rollout. This is typically invoked by runners that wish to retry
HIGHagentlightning/store/base.py331Persist a pre-constructed span emitted during rollout execution. The provided [`Span`][agentlightning.Span] mus
HIGHagentlightning/store/base.py362Convert and persist an OpenTelemetry span for a particular attempt. Implementations must transform the `readabl
HIGHagentlightning/store/base.py401Retrieve rollouts filtered by status and/or explicit identifiers. This interface supports structured filtering,
HIGHagentlightning/store/base.py442Return every attempt ever created for `rollout_id` in ascending sequence order. The parameters allow callers to
HIGHagentlightning/store/base.py466Fetch a rollout by identifier without mutating its state. Args: rollout_id: Identifier to retrieve.
HIGHagentlightning/store/base.py480Fetch the attempt with the highest `sequence_id` for `rollout_id`. Args: rollout_id: Identifier to
HIGHagentlightning/store/base.py505List every stored resource snapshot in insertion order. Supports lightweight filtering, sorting, and pagination
HIGHagentlightning/store/base.py530Return a specific named resource snapshot by identifier. Args: resources_id: Identifier of the snap
HIGHagentlightning/store/base.py556Allocate the next strictly increasing sequence number used to order spans. Implementations must retain counters
HIGHagentlightning/store/base.py594Block until the targeted rollouts reach a terminal status or the timeout expires. Terminal statuses are `"succe
HIGHagentlightning/store/base.py641Return the stored spans for a rollout, optionally scoped to one attempt. Supports a handful of filters that cov
HIGHagentlightning/store/base.py682Persist a new immutable snapshot of named resources and mark it as latest. Implementations must assign a fresh
6 more matches not shown…
Unused Imports229 hits · 224 pts
SeverityFileLineSnippet
LOWtests/test_env_var.py3
LOWtests/test_logging.py3
LOWtests/test_config.py16
LOWtests/test_config.py17
LOWtests/benchmark/analysis.py5
LOWtests/benchmark/collection_benchmark.py5
LOWtests/benchmark/micro_benchmark.py5
LOWtests/tracer/test_dummy.py3
LOWtests/tracer/test_agentops.py3
LOWtests/tracer/test_weave.py3
LOWtests/tracer/test_otel.py5
LOWtests/emitter/test_message.py3
LOWtests/emitter/test_exception.py3
LOWtests/emitter/test_object.py3
LOWtests/emitter/test_annotation.py3
LOWtests/emitter/test_operation.py3
LOWtests/llm_proxy/test_stream.py3
LOWtests/utils/test_otlp.py5
LOWtests/utils/test_system_snapshot.py3
LOWtests/utils/test_metrics.py5
LOWtests/utils/test_server_launcher.py3
LOWtests/utils/test_otel.py3
LOWtests/algorithm/test_utils.py3
LOWtests/common/prometheus_stub.py3
LOWtests/common/tracer.py3
LOWtests/execution/test_client_server.py3
LOWtests/trainer/test_trainer_init.py3
LOWtests/trainer/test_trainer_dev.py5
LOWtests/trainer/sample_components.py3
LOWtests/store/conftest.py3
LOWtests/store/test_collection.py3
LOWdocs/macros/source_links.py3
LOWcontrib/recipes/search_r1/search_r1_agent.py3
LOWcontrib/recipes/search_r1/train_search_r1_agent.py4
LOWcontrib/recipes/agentos/demo_governed_training.py23
LOWcontrib/recipes/webshop/tests/test_span_adapter.py14
LOWcontrib/recipes/webshop/tests/test_span_adapter.py19
LOWcontrib/recipes/webshop/server/webshop_server.py71
LOWcontrib/recipes/webshop/agl/tasks.py17
LOWcontrib/recipes/webshop/agl/config.py16
LOWcontrib/recipes/webshop/agl/generate_tasks.py26
LOWcontrib/recipes/webshop/agl/run_training.py39
LOWcontrib/recipes/envs/prompt_builder.py3
LOWcontrib/recipes/envs/empo2_server/server_bert.py4
LOWcontrib/recipes/envs/empo2_server/server_bert.py9
LOWcontrib/agentlightning/contrib/runner/agentos.py10
LOWcontrib/agentlightning/contrib/agent/env_agent.py3
LOWcontrib/agentlightning/contrib/adapter/triplet_group.py3
LOWcontrib/agentlightning/contrib/adapter/triplet_group.py5
LOWcontrib/agentlightning/contrib/adapter/agentos.py10
LOW…b/agentlightning/contrib/algorithm/env_verl/trainer.py5
LOWcontrib/agentlightning/contrib/reward/agentos.py10
LOWexamples/chartqa/chartqa_agent.py17
LOWexamples/chartqa/debug_chartqa_agent.py26
LOWexamples/chartqa/multimodal_utils.py10
LOWexamples/chartqa/train_chartqa_agent.py20
LOWexamples/tinker/hello.py35
LOWexamples/tinker/q20_agent.py13
LOWexamples/tinker/q20_evaluate.py33
LOWexamples/tinker/q20_train.py33
169 more matches not shown…
Decorative Section Separators56 hits · 204 pts
SeverityFileLineSnippet
MEDIUMtests/execution/test_client_server.py151# =========================
MEDIUMtests/execution/test_client_server.py153# =========================
MEDIUMtests/execution/test_client_server.py291# =========================
MEDIUMtests/execution/test_client_server.py293# =========================
MEDIUMtests/execution/test_client_server.py423# =========================
MEDIUMtests/execution/test_client_server.py425# =========================
MEDIUMtests/execution/test_client_server.py665# =========================
MEDIUMtests/execution/test_client_server.py667# =========================
MEDIUMtests/execution/test_client_server.py886# =========================
MEDIUMtests/execution/test_client_server.py888# =========================
MEDIUMtests/execution/test_client_server.py28# =========================
MEDIUMtests/execution/test_client_server.py30# =========================
MEDIUMtests/execution/test_client_server.py67# =========================
MEDIUMtests/execution/test_client_server.py69# =========================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh94# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh96# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh140# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh142# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh154# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh156# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh173# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh175# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh181# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh183# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh210# ==============================================================================
MEDIUMcontrib/recipes/webshop/scripts/run_stack.sh212# ==============================================================================
MEDIUM…envs/config_verl/alfworld/grpo_qwen_1.5b_instruct.yaml1# ==========================
MEDIUM…envs/config_verl/alfworld/grpo_qwen_1.5b_instruct.yaml3# ==========================
MEDIUM…envs/config_verl/alfworld/grpo_qwen_1.5b_instruct.yaml16# ==========================
MEDIUM…envs/config_verl/alfworld/grpo_qwen_1.5b_instruct.yaml18# ==========================
MEDIUMcontrib/recipes/envs/config_verl/alfworld/grpo.yaml1# ==========================
MEDIUMcontrib/recipes/envs/config_verl/alfworld/grpo.yaml3# ==========================
MEDIUMcontrib/recipes/envs/config_verl/alfworld/grpo.yaml16# ==========================
MEDIUMcontrib/recipes/envs/config_verl/alfworld/grpo.yaml18# ==========================
MEDIUM…s/config_verl/scienceworld/empo2_qwen_7b_instruct.yaml1# ==========================
MEDIUM…s/config_verl/scienceworld/empo2_qwen_7b_instruct.yaml3# ==========================
MEDIUM…s/config_verl/scienceworld/empo2_qwen_7b_instruct.yaml19# ==========================
MEDIUM…s/config_verl/scienceworld/empo2_qwen_7b_instruct.yaml21# ==========================
MEDIUM…vs/config_verl/scienceworld/grpo_qwen_7b_instruct.yaml1# ==========================
MEDIUM…vs/config_verl/scienceworld/grpo_qwen_7b_instruct.yaml3# ==========================
MEDIUM…vs/config_verl/scienceworld/grpo_qwen_7b_instruct.yaml18# ==========================
MEDIUM…vs/config_verl/scienceworld/grpo_qwen_7b_instruct.yaml20# ==========================
MEDIUM…/config_verl/scienceworld/grpo_qwen_1.5b_instruct.yaml1# ==========================
MEDIUM…/config_verl/scienceworld/grpo_qwen_1.5b_instruct.yaml3# ==========================
MEDIUM…/config_verl/scienceworld/grpo_qwen_1.5b_instruct.yaml17# ==========================
MEDIUM…/config_verl/scienceworld/grpo_qwen_1.5b_instruct.yaml19# ==========================
MEDIUMcontrib/recipes/envs/config_verl/scienceworld/grpo.yaml1# ==========================
MEDIUMcontrib/recipes/envs/config_verl/scienceworld/grpo.yaml3# ==========================
MEDIUMcontrib/recipes/envs/config_verl/scienceworld/grpo.yaml17# ==========================
MEDIUMcontrib/recipes/envs/config_verl/scienceworld/grpo.yaml19# ==========================
MEDIUMagentlightning/tracer/otel.py408 # ---------------------------------------------------------------------------
MEDIUMagentlightning/tracer/otel.py427 # ---------------------------------------------------------------------------
MEDIUMagentlightning/instrumentation/weave.py309 # ==========================================
MEDIUMagentlightning/instrumentation/weave.py311 # ==========================================
MEDIUMagentlightning/store/collection/memory.py243 # -------------------------------------------------------------------------
MEDIUMagentlightning/store/collection/memory.py245 # -------------------------------------------------------------------------
Excessive Try-Catch Wrapping163 hits · 178 pts
SeverityFileLineSnippet
LOWtests/benchmark/collection_benchmark.py410 except Exception as exc:
LOWtests/benchmark/collection_benchmark.py439 except Exception:
LOWtests/benchmark/collection_benchmark.py464 except Exception:
MEDIUMtests/benchmark/micro_benchmark.py117 console.print(f"Error updating worker {worker_id} for task {task_id}: {e}")
MEDIUMtests/benchmark/micro_benchmark.py156 console.print(f"Error dequeueing empty and updating worker {worker_id} for task {task_id}: {e}")
MEDIUMtests/benchmark/micro_benchmark.py208 console.print(f"Error running rollout task {task_id}: {e}")
MEDIUMtests/benchmark/micro_benchmark.py343 console.print(f"Error dequeueing and updating worker {worker_id} for task {task_id}: {e}")
MEDIUMtests/benchmark/micro_benchmark.py248 console.print(f"Error dequeueing only worker {worker_id} for task {task_id}: {e}")
LOWtests/benchmark/micro_benchmark.py116 except Exception as e:
LOWtests/benchmark/micro_benchmark.py155 except Exception as e:
LOWtests/benchmark/micro_benchmark.py207 except Exception as e:
LOWtests/benchmark/micro_benchmark.py342 except Exception as e:
LOWtests/benchmark/micro_benchmark.py42 except Exception:
LOWtests/benchmark/micro_benchmark.py247 except Exception as e:
LOWtests/tracer/test_integration.py121 except Exception:
LOWtests/tracer/test_otel.py416 except Exception as e:
LOWtests/tracer/test_otel.py568 except Exception as exc: # pragma: no cover - defensive path
LOWtests/tracer/test_otel.py571 except Exception:
LOWtests/llm_proxy/test_stream.py65 except Exception:
LOWtests/llm_proxy/test_stream.py100 except Exception:
LOWtests/llm_proxy/test_stream.py121 except Exception:
LOWtests/llm_proxy/test_stream.py143 except Exception:
LOWtests/llm_proxy/test_stream.py156 except Exception:
LOWtests/llm_proxy/test_stream.py169 except Exception:
LOWtests/utils/test_system_snapshot.py120 except Exception:
LOWtests/utils/test_server_launcher.py114 except Exception as exc: # server may not be up yet
LOWtests/common/vllm.py148 except Exception:
LOWtests/store/conftest.py204 except Exception as exc: # depends on external service
LOWtests/store/test_client_server.py1212 except Exception as e:
LOWdocs/tutorials/debug.md215 except Exception:
LOWcontrib/recipes/search_r1/retrieval_server.py222 except Exception: # pragma: no cover - typing convenience
LOWcontrib/recipes/search_r1/retrieval_server.py236 except Exception:
LOWcontrib/recipes/search_r1/search_r1_agent.py175 except Exception as e:
LOWcontrib/recipes/agentos/demo_governed_training.py110 except Exception:
LOWcontrib/recipes/webshop/server/webshop_server.py206 except Exception as e:
LOWcontrib/recipes/webshop/server/webshop_server.py262 except Exception as e:
LOWcontrib/recipes/webshop/server/webshop_server.py313 except Exception as e:
LOWcontrib/agentlightning/contrib/agent/env_agent.py115 except Exception as e:
LOWcontrib/agentlightning/contrib/agent/empo2_agent.py164 except Exception as e:
LOWcontrib/agentlightning/contrib/adapter/agentos.py112 except Exception as e:
LOW…ib/agentlightning/contrib/algorithm/env_verl/daemon.py457 except Exception as e:
LOW…ib/agentlightning/contrib/algorithm/env_verl/daemon.py571 except Exception as e:
MEDIUM…ib/agentlightning/contrib/algorithm/env_verl/daemon.py572 print(f"Error while waiting for tasks to finish: {e}")
LOWexamples/calc_x/legacy_calc_agent.py77 except Exception as e:
LOWexamples/calc_x/eval_utils.py57 except Exception:
LOWexamples/calc_x/calc_agent.py100 except Exception as e:
LOWexamples/chartqa/chartqa_agent.py125 except Exception as e:
LOWexamples/chartqa/chartqa_agent.py166 except Exception as e:
LOWexamples/chartqa/chartqa_agent.py370 except Exception as e:
LOWexamples/chartqa/chartqa_agent.py406 except Exception as e:
LOWexamples/tinker/q20_agent.py288 except Exception as e:
LOWexamples/tinker/q20_evaluate.py170 except Exception as e:
LOWexamples/tinker/q20_train.py121 except Exception:
MEDIUMexamples/tinker/q20_train.py122 console.print(f"Error in q20_agent: {traceback.format_exc()}")
LOWexamples/claude_code/claude_code_agent.py188 except Exception as e:
LOWexamples/claude_code/claude_code_agent.py302 except Exception as e:
LOWexamples/claude_code/claude_code_agent.py416 except Exception as e:
LOWexamples/claude_code/swebench_utils/evaluation.py217 except Exception as e:
LOWexamples/claude_code/swebench_utils/docker_runtime.py207 except Exception as e:
LOWexamples/claude_code/swebench_utils/docker_runtime.py346 except Exception as e:
103 more matches not shown…
Self-Referential Comments47 hits · 160 pts
SeverityFileLineSnippet
MEDIUMtests/test_client.py169 # Define the synchronous client workflow
MEDIUMtests/tracer/test_integration.py398 # Create a team with the primary and critic agents.
MEDIUMtests/tracer/test_otel.py442 # Create a slow async function that exceeds timeout
MEDIUMtests/runner/test_agent_runner.py776 # Create an attempted rollout
MEDIUMtests/runner/test_agent_runner.py803 # Create an attempted rollout with invalid resources_id
MEDIUMtests/llm_proxy/test_stream.py401 # Create a synthetic long content split into ~20-40 char pieces as the merger would see
MEDIUMtests/algorithm/test_baseline.py178 # Create a dataset with 5 samples
MEDIUMtests/litagent/test_decorator.py168 # Create a ProxyLLM resource
MEDIUMtests/litagent/test_decorator.py174 # Create an AttemptedRollout
MEDIUMtests/litagent/test_decorator.py204 # Create a ProxyLLM resource
MEDIUMtests/litagent/test_decorator.py210 # Create an AttemptedRollout
MEDIUMtests/litagent/test_decorator.py239 # Create a ProxyLLM resource
MEDIUMtests/litagent/test_decorator.py245 # Create an AttemptedRollout
MEDIUMtests/litagent/test_decorator.py329 # Create a rollout object
MEDIUMtests/litagent/test_decorator.py402 # Create a rollout object
MEDIUMtests/litagent/test_decorator.py435 # Create a rollout object
MEDIUMtests/store/test_utils.py80 # Create a valid attempt first, then modify its status
MEDIUMtests/store/test_utils.py258 # Create a valid attempt first, then set it to None
MEDIUMtests/store/test_core.py2564 # Create a valid attempt to ensure rollout exists in store
MEDIUMtests/store/test_core.py446 # Create a rollout
MEDIUMtests/store/test_core.py2096 # Create the first attempt
MEDIUMtests/store/test_core.py2810 # Create a rollout
MEDIUMtests/store/test_core.py2831 # Create a rollout and dequeue to create first attempt
MEDIUMtests/store/test_core.py2494 rollout = await store_fixture.dequeue_rollout() # Create an attempt
MEDIUMcontrib/recipes/webshop/server/webshop_server.py308 # Create a test session to trigger loading
MEDIUM…b/agentlightning/contrib/algorithm/env_verl/trainer.py109# This function is adapted from verl.
MEDIUM…ib/agentlightning/contrib/algorithm/env_verl/daemon.py512 # Create the Rollout object (without trace and logs as per user's note)
MEDIUMexamples/claude_code/swebench_utils/docker_runtime.py109 # Create a copy of metadata to avoid modifying the original
MEDIUMexamples/minimal/llm_proxy.py41 # Create a store to store the traces
MEDIUMexamples/minimal/llm_proxy.py46 # Create a vLLM server
MEDIUMexamples/minimal/llm_proxy.py51 # Create an LLM proxy to guard the vLLM server and catch the traces
MEDIUMexamples/minimal/llm_proxy.py80 # Create a store to store the traces
MEDIUMexamples/minimal/llm_proxy.py88 # Create an LLM proxy to guard the OpenAI server and catch the traces
MEDIUMexamples/unsloth/sft_algorithm.py360 # Create the LLM proxy for rollout worker access and trace data collection
MEDIUM.github/workflows/pypi-nightly.yml46 # Create a dev version with timestamp
MEDIUMagentlightning/llm_proxy.py675 # Creating a new request won't work because request is cached in the base class
MEDIUMagentlightning/tracer/weave.py366 # Create a new trace call object in Weave
MEDIUMagentlightning/runner/legacy.py142 # Create the RolloutLegacy object with standardized fields
MEDIUMagentlightning/utils/server_launcher.py423 # Create the arbiter up-front so the watchdog can inspect it.
MEDIUMagentlightning/adapter/triplet.py290 # Create a virtual root span if multiple root spans are found
MEDIUMagentlightning/verl/trainer.py57# This function is adapted from verl.
MEDIUMagentlightning/verl/daemon.py659 # Create the Rollout object (without trace and logs as per user's note)
MEDIUMagentlightning/store/collection_based.py198 # The following methods should live inside one lock.
MEDIUMagentlightning/store/collection_based.py429 # Create the initial attempt
MEDIUMagentlightning/store/collection_based.py596 # Create a new attempt (could be first attempt or retry)
MEDIUMagentlightning/store/collection/mongo.py301 # Create a new client for this loop.
MEDIUMagentlightning/store/collection/mongo.py318 # Create a new collection for this loop.
Deep Nesting98 hits · 94 pts
SeverityFileLineSnippet
LOWtests/test_logging.py23
LOWtests/benchmark/benchmark_store.py89
LOWtests/benchmark/benchmark_store.py91
LOWtests/benchmark/benchmark_store.py169
LOWtests/benchmark/benchmark_store.py285
LOWtests/benchmark/benchmark_store.py307
LOWtests/benchmark/micro_benchmark.py435
LOWtests/tracer/test_agentops.py166
LOWtests/tracer/test_integration.py738
LOWtests/tracer/test_integration.py113
LOWtests/llm_proxy/test_llm_proxy_cpu.py301
LOWtests/llm_proxy/test_llm_proxy_gpu.py403
LOWtests/llm_proxy/test_llm_proxy_gpu.py511
LOWtests/llm_proxy/test_stream.py13
LOWtests/llm_proxy/test_stream.py71
LOWtests/utils/test_otlp.py85
LOWcontrib/agentlightning/contrib/agent/env_agent.py49
LOWcontrib/agentlightning/contrib/agent/env_agent.py68
LOWcontrib/agentlightning/contrib/agent/empo2_agent.py73
LOWcontrib/agentlightning/contrib/adapter/triplet_group.py29
LOWcontrib/agentlightning/contrib/adapter/agentos.py94
LOW…gentlightning/contrib/algorithm/env_verl/core_empo2.py14
LOW…b/agentlightning/contrib/algorithm/env_verl/trainer.py291
LOW…b/agentlightning/contrib/algorithm/env_verl/trainer.py538
LOW…ib/agentlightning/contrib/algorithm/env_verl/daemon.py461
LOW…ib/agentlightning/contrib/algorithm/env_verl/daemon.py660
LOWexamples/calc_x/train_calc_agent.py110
LOWexamples/chartqa/chartqa_agent.py295
LOWexamples/tinker/q20_evaluate.py53
LOWexamples/tinker/agl_tinker/train.py111
LOWexamples/azure/aoai_finetune.py590
LOWexamples/claude_code/claude_code_agent.py230
LOWexamples/claude_code/claude_code_agent.py312
LOWexamples/claude_code/extended_adapter.py30
LOWexamples/claude_code/extended_adapter.py63
LOWexamples/minimal/vllm_server.py18
LOWexamples/spider/sql_agent.py346
LOWexamples/spider/spider_eval/evaluation.py533
LOWexamples/spider/spider_eval/process_sql.py276
LOWexamples/spider/spider_eval/exec_eval.py65
LOWexamples/spider/spider_eval/exec_eval.py187
LOWexamples/unsloth/sft_algorithm.py61
LOWexamples/unsloth/sft_algorithm.py135
LOWscripts/wandb_download_result.py171
LOWagentlightning/config.py118
LOWagentlightning/llm_proxy.py722
LOWagentlightning/llm_proxy.py1314
LOWagentlightning/tracer/agentops.py142
LOWagentlightning/tracer/otel.py250
LOWagentlightning/tracer/otel.py472
LOWagentlightning/types/resources.py80
LOWagentlightning/emitter/annotation.py187
LOWagentlightning/emitter/annotation.py209
LOWagentlightning/emitter/object.py87
LOWagentlightning/emitter/reward.py148
LOWagentlightning/emitter/reward.py213
LOWagentlightning/runner/agent.py270
LOWagentlightning/runner/agent.py484
LOWagentlightning/runner/agent.py737
LOWagentlightning/runner/agent.py526
38 more matches not shown…
Hallucination Indicators4 hits · 40 pts
SeverityFileLineSnippet
CRITICAL…b/agentlightning/contrib/algorithm/env_verl/trainer.py559 model = "/".join(self.config.actor_rollout_ref.model.path.split("/")[-2:])
CRITICALagentlightning/verl/trainer.py260 if self.config.agentlightning.trace_aggregator.level.startswith("trajectory")
CRITICALagentlightning/verl/trainer.py265 if self.config.agentlightning.trace_aggregator.level.startswith("trajectory")
CRITICALagentlightning/verl/trainer.py459 model = "/".join(self.config.actor_rollout_ref.model.path.split("/")[-2:])
Redundant / Tautological Comments24 hits · 38 pts
SeverityFileLineSnippet
LOWtests/test_config.py375 # Check if mock_add_param_func was called with these specific arguments
LOWtests/utils/test_server_launcher.py211 # Check if the port is still occupied.
LOWcontrib/recipes/webshop/tests/test_span_adapter.py152 # Check if reward was associated with any triplet
LOW…gentlightning/contrib/algorithm/env_verl/core_empo2.py23 # Check if the start pattern matches at the current position
LOWexamples/chartqa/chartqa_agent.py317 # Check if the graph is already built
LOWexamples/claude_code/swebench_utils/evaluation.py190 # Check if git diff changed after running eval script
LOWscripts/bump_version.sh8# Check if version argument is provided
LOWscripts/bump_version.sh30# Check if pyproject.toml exists
LOWagentlightning/config.py110 # Check if the (potentially unwrapped) type is a List
LOWagentlightning/config.py146 # Check if the list item itself is, e.g., Optional[str] or bool
LOWagentlightning/llm_proxy.py612 # Check if it's a chat completions or messages endpoint
LOWagentlightning/llm_proxy.py632 # Check if streaming is requested
LOWagentlightning/llm_proxy.py1424 # Check if tracer provider is malformed due to global tracer clear in tests.
LOWagentlightning/client.py325 # Check if tasks are mixture of TaskInput and Task
LOWagentlightning/types/resources.py82 # Check if we're accessing endpoint after initialization and not from base_url
LOWagentlightning/emitter/reward.py94 # Check if the function is async
LOWagentlightning/utils/server_launcher.py482 # Check if the server is healthy.
LOWagentlightning/utils/otel.py443 # Check if keys are all numeric strings
LOWagentlightning/verl/daemon.py274 # Check if model requires multimodal position_ids (e.g., Qwen2-VL)
LOWagentlightning/litagent/decorator.py517 # Check if it matches the LLM rollout API pattern
LOWagentlightning/store/collection_based.py189 # Check if healthcheck is already running to prevent recursion
LOWagentlightning/store/collection_based.py194 # Set flag to prevent recursive healthcheck calls
LOWagentlightning/store/collection_based.py593 # Check if rollout is still in a queuing state
LOWagentlightning/store/utils.py75 # Check if this status should trigger a retry
Cross-File Repetition7 hits · 35 pts
SeverityFileLineSnippet
HIGHtests/tracer/test_agentops.py0function that always executed successfully to test success tracing.
HIGHtests/tracer/test_weave.py0function that always executed successfully to test success tracing.
HIGHtests/tracer/test_weave.py0function that always executed successfully to test success tracing.
HIGHtests/tracer/test_weave.py0function that always executed successfully to test success tracing.
HIGHagentlightning/types/tracer.py0mapping from attribute names to their values. same as opentelemetry `attributes` type.
HIGHagentlightning/types/tracer.py0mapping from attribute names to their values. same as opentelemetry `attributes` type.
HIGHagentlightning/types/tracer.py0mapping from attribute names to their values. same as opentelemetry `attributes` type.
Cross-Language Confusion5 hits · 22 pts
SeverityFileLineSnippet
HIGHexamples/claude_code/claude_code_controller.py152if ! command -v python3 &> /dev/null; then
HIGHexamples/claude_code/claude_code_controller.py154 sudo apt-get update -qq && sudo apt-get install -y -qq python3.12
HIGHexamples/claude_code/swebench_utils/docker_runtime.py188 "py_interpreter_path": r'$(which python 2>/dev/null || echo "")',
HIGHexamples/claude_code/swebench_utils/docker_runtime.py194 self.send_command("apt update -qq && apt install -y -qq git")
HIGHagentlightning/utils/otel.py474 # This include null, dict, etc.
AI Slop Vocabulary9 hits · 21 pts
SeverityFileLineSnippet
MEDIUM…b/agentlightning/contrib/algorithm/env_verl/trainer.py647 # This exit logic is to ensure a robust CI.
MEDIUMexamples/tinker/agl_tinker/llm.py188 # NOTE(yuge): I thought about adding this to make it more robust to empty responses,
MEDIUMscripts/wandb_download_result.py82 # We fetch all runs in the project once, then pick matching ones to be robust across filters/backends.
MEDIUMagentlightning/logging.py192 # TODO: More comprehensive Windows support may be needed in the future.
LOWagentlightning/llm_proxy.py635 # Simple case: no streaming requested, just return the response
MEDIUMagentlightning/verl/trainer.py542 # This exit logic is to ensure a robust CI.
LOWagentlightning/store/client_server.py479 # If not API request, just pass through
LOWagentlightning/store/client_server.py1016 # If the store is zero-copy, we can just call the method directly.
LOWagentlightning/store/client_server.py1026 # If it's already thread-safe, we can just call the method directly.
Verbosity Indicators6 hits · 14 pts
SeverityFileLineSnippet
LOWcontrib/recipes/webshop/scripts/run_stack.sh95# Step 1: Initialize WebShop Data (if needed)
LOWcontrib/recipes/webshop/scripts/run_stack.sh141# Step 2: Start WebShop Server
LOWcontrib/recipes/webshop/scripts/run_stack.sh155# Step 3: Start Agent Lightning Coordinator
LOWcontrib/recipes/webshop/scripts/run_stack.sh174# Step 4: Wait for Services
LOWcontrib/recipes/webshop/scripts/run_stack.sh182# Step 5: Build and Start Runners
LOWcontrib/recipes/webshop/scripts/run_stack.sh211# Step 6: Wait for Training to Complete
Over-Commented Block14 hits · 13 pts
SeverityFileLineSnippet
LOWcontrib/recipes/search_r1/qa_em.py1# Copyright (c) Microsoft. All rights reserved.
LOWcontrib/recipes/webshop/aml/run_webshop_aml.sh1#!/usr/bin/env bash
LOWcontrib/recipes/webshop/scripts/run_stack.sh1#!/usr/bin/env bash
LOW…ib/agentlightning/contrib/algorithm/env_verl/daemon.py481 """
LOW…ib/agentlightning/contrib/algorithm/env_verl/daemon.py721 #
LOWexamples/rag/metric_utils.py161 # # search acc
LOWexamples/spider/spider_eval/evaluation.py1# Copyright (c) Microsoft. All rights reserved.
LOWexamples/spider/spider_eval/process_sql.py1# Copyright (c) Microsoft. All rights reserved.
LOWexamples/spider/spider_eval/exec_eval.py181# db is the database path
LOWexamples/unsloth/sft_algorithm.py221 console.print(
LOWagentlightning/tracer/otel.py401 def _await_in_loop(self, coro: Awaitable[Any], timeout: Optional[float] = None) -> Any:
LOWagentlightning/verl/daemon.py421 if resp.status_code == 200:
LOWagentlightning/store/client_server.py1021 if method_name == "wait_for_rollouts":
LOWagentlightning/store/client_server.py1421 self._request_timeout = state["_request_timeout"]
Magic Placeholder Names3 hits · 12 pts
SeverityFileLineSnippet
HIGHdocs/how-to/train-sql-agent.md370export OPENAI_API_KEY=<your_api_key>
HIGHexamples/chartqa/README.md60export OPENAI_API_KEY=<your-api-key>
HIGHexamples/unsloth/math_agent.py8export OPENAI_API_KEY=your_api_key
Example Usage Blocks4 hits · 6 pts
SeverityFileLineSnippet
LOWtests/benchmark/utils.py123 # Example usage
LOWcontrib/recipes/webshop/aml/run_webshop_aml.sh9# Usage:
LOWcontrib/recipes/webshop/aml/compute.yml6# Usage:
LOWcontrib/recipes/webshop/scripts/run_stack.sh8# Usage:
Slop Phrases2 hits · 6 pts
SeverityFileLineSnippet
MEDIUMtests/trainer/test_trainer_init.py66 # By default, strategy is client-server, but you can also use a string alias to specify it again
MEDIUMexamples/apo/apo_debug.py28 # If you don't need any tracing functionality yet, you can use a dummy OtelTracer.
Synthetic Comment Markers1 hit · 5 pts
SeverityFileLineSnippet
HIGHRAI_README.md44Outputs generated by AI may include factual errors, fabrication, or speculation. Users are responsible for assessing the
Fake / Example Data4 hits · 4 pts
SeverityFileLineSnippet
LOWdocs/tutorials/emitter.md63 "name": "John Doe",
LOWdocs/tutorials/emitter.md79 'agentlightning.object.json': '{"name": "John Doe", "age": 30, "email": "john.doe@example.com"}',
LOWdashboard/src/pages/Rollouts.page.story.tsx544const veryLongInput = `{"prompt":"${'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '.repeat(12)}"}`;
LOWdashboard/src/pages/Rollouts.page.story.tsx544const veryLongInput = `{"prompt":"${'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '.repeat(12)}"}`;
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippet
LOWdashboard/static/mockServiceWorker.js123async function handleRequest(event, requestId, requestInterceptedAt) {
LOWexamples/calc_x/tests/test_agentops.py10def process_data(data: str) -> float: