Skip to content

feat(video): add single-turn Video-MME v2, Video-MME and LVBench environments - #6071

Merged
yfw merged 19 commits into
NVIDIA-NeMo:mainfrom
cg1177:guoc/agentic-video-env
Nov 16, 2026
Merged

yfw merged 19 commits into
NVIDIA-NeMo:mainfrom
cg1177:guoc/agentic-video-env

Conversation

@cg1177

@cg1177 cg1177 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What

Single-turn video multiple-choice evaluation for Video-MME v2, Video-MME (v1) and LVBench, with a shared verifier:

  • resources_servers/video_mcqa: the shared task contract, boxed-letter parser (boxed_only_v1, opt-in
    boxed_or_letter_v1), fixed-cohort accuracy verifier, task-data schema and the prepare CLI for the authors'
    Video-MME and LVBench annotations. It also runs on its own (configs/video_mcqa_single_turn.yaml), scoring the
    benchmark its cohort names.
  • resources_servers/videomme_v2: raw accuracy plus the official four-question group (nonlinear) score, overall and by
    level.
  • resources_servers/videomme_v1 and resources_servers/lvbench: thin servers on the shared verifier, with
    per-category breakdowns.

Each config runs the stock simple_agent for one tool-free step through a single_agent_turn_legacy Environment
Server, against the stock vllm_model. A row carries its video as an input_video part with a data: or file://
URL. A run declares its cohort (pinned dataset revision, expected task IDs, setting, answer policy, repeats) before
inference; missing and masked rows stay in the denominator, and coverage and completeness are reported. Gym's
counted-zero rows are skipped in aggregation, so they count as missing.

The PR changes nothing in nemo_gym/. Each server ships five invented questions about five synthetic 4-second clips
(resources_servers/video_mcqa/data/example_videos/, inlined in the rows as MP4 data: URLs), an example cohort,
example_metrics.json and real-model example_rollouts.jsonl. No benchmark questions, answers, videos, checkpoints or
credentials are included. The configs are verified: false.

Why

Makes Video-MME v2, Video-MME and LVBench evaluation available from Gym main. No issue: new environments. The
dataset terms allow evaluation-only or noncommercial use (Video-MME and Video-MME v2: academic research only, with
restricted redistribution; LVBench: CC-BY-NC-SA-4.0), and the READMEs say so.

Scoring notes

  • The prompt asks for a boxed letter, and boxed_only_v1 scores an unboxed or conflicting answer as 0. The official
    scripts ask for a bare letter, so these scores are not comparable to official results.
  • Video-MME v2 group scores follow the official scoring functions (MME-Benchmarks/Video-MME-v2 28fc3bcf). A group
    with a missing or masked member counts that member as wrong, and /group_coverage and /nonlinear_complete report
    the gap.
  • The adapters were built for VideoAnyRes preparation, which is not public yet. Plain data: / file:// runs use
    vLLM's own frame sampling (32 frames unless --media-io-kwargs sets another count) and are not that protocol.

Related PRs

Agentic setting: follow-up PR

The sandboxed OpenCode video agent was removed from this PR after review; its code stays in this branch's history.
The follow-up will be ready when it has:

  1. a build recipe for the media runtime archive;
  2. nemo_rl.environments.video_media_cli public in NeMo-RL;
  3. the vLLM loader for the tool video, named in the README;
  4. a sandbox that loads the repo's .mjs modules;
  5. real-model rollouts.

It will also check error_type and -1 on the post-run hash step and import EXECUTION_FAILURE_METADATA_KEY from
resources_servers.video_mcqa.scoring. Running it on stock opencode_agent under single_agent_turn_legacy is
being considered. Agentic training additionally needs NeMo-RL work: a vLLM loader for the tool-video payload, tool
video in the trainer, and mixed image and video prompts in NeMo-RL's media capture.

Validation (head 5977f7f11, CPU; Python 3.13.14, uv 0.13.4)

The head is itself the merge with main 951ee9ec8. Checks on its tree, on CPU, with CI's commands:

  • Server suite. scripts/ci/server_test_workers.py 7 8 +fail_on_total_and_test_mismatch=true +delete_venvs_after_each_test=true (shard 7: 36 modules, including lvbench and opencode_agent) passes. The four
    video resources servers (shards 2, 3, 4 and 7) pass ng_test +should_validate_data=true: videomme_v2 136 tests,
    videomme_v1 1, lvbench 1, video_mcqa 257 (plus 118 subtests). Each one reports "The data for ... has been
    successfully validated!". Shards 2, 3 and 4 were also run in full before the example-data commit. Outside the video
    servers, they failed only in modules this PR does not touch, and only because of the local machine:
    • interactive_browser: its Playwright tests need CI's browser dependencies;
    • terminal_bench_4 and miniswe_sandboxed_agent: both pass when rerun with CI's umask 022.
  • Core unit tests. scripts/ci/core_unit_tests.sh, unsharded, so a superset of the four core shards: 22,390 passed, 103 skipped, 0 failed (plus 343 subtests).
  • Lint, secrets and locks.
    • pre-commit run --all-files passes.
    • The secrets-detector command (detect-secrets 1.5.0, 76 changed files) passes.
    • scripts/component_locks.py checks 307 projects with 0 failures.
    • uv lock --check passes for the root and the four servers.
    • tests/unit_tests/test_fern_docs_links.py passes.
  • Migration script. scripts/add_legacy_agent_environment_servers.py --switch-simple-agent --check leaves
    nothing to switch in these configs.
  • Pipeline smoke on this tree. The real-model rollouts were collected on the branch before main was merged. On the
    merged tree, a local run against a stub OpenAI-compatible endpoint starts the 13 servers of the four configs,
    completes all 20 example rows, and every model request carries the MP4 data: URL before the question text.
  • Mutation check. I broke each new or moved test's target once: grading an unclosed <think>, dividing accuracy
    by the returned rows, removing the counted-zero skip from either verifier, making the shared server ignore its
    cohort's benchmark, and altering an example clip. Each change makes its suite fail.

Rollout evidence

Model: nvidia/Nemotron-3-Nano-Omni-30B-A3B-Reasoning-BF16, BF16 on one H200. Serving: vLLM
0.30.1rc1.dev143+g29468dde8 with the model card's video flags (--video-pruning-rate 0.5,
--media-io-kwargs '{"video": {"fps": 2, "num_frames": 256}}', --reasoning-parser nemotron_v3,
--max-model-len 131072) and the model's default sampling (temperature 0.6, top-p 0.95, at most 16,384 output
tokens). Gym ran the stock vllm_model, simple_agent and single_agent_turn_legacy servers from these configs. The
rollouts are the committed data/example_rollouts.jsonl files.

Synthetic clip (invented question) Gold videomme_v2 videomme_v1 lvbench video_mcqa
Square moving right ("Which shape moves?") B B, 1 B, 1 B, 1 B, 1
Blue background ("Background color?") C C, 1 C, 1 C, 1 C, 1
One red dot ("How many dots?") A A, 1 A, 1 A, 1 A, 1
Bar moving down ("Direction?") D D, 1 D, 1 D, 1 D, 1
Counter ending on 5 ("Last number?") B no answer (16,384-token limit), 0 D (9), 0 D (9), 0 D (9), 0

Each cell is the parsed answer and the reward. Each server reports raw accuracy 80, coverage 1.0 and a complete
cohort; the misses are labelled incorrect and no_answer. The model sees the video: each request carries 683-687
input tokens, and a direct probe of the same vLLM server gives 643 prompt tokens with the clip and 27 without. With the
blue-background clip it answers "A yellow diamond moves from the left side to the right side of a blue background";
without a clip it says it cannot view the video, or describes an unrelated scene. On the counter, its reasoning reads
one frame as 5 and the last frames as 9.

Follow-ups

  • Imports still use pre-0.8 module paths (for example nemo_gym.server_utils, nemo_gym.base_resources_server),
    which _moved_paths maps with a DeprecationWarning until 0.10.0. python scripts/migrate_imports.py --check lists
    eight files in these four servers; a follow-up PR runs the script on them (no behavior change).
  • A Video-MME v2 annotation adapter for the prepare CLI; until then the README shows prepare_single_turn().
  • The agentic setting (above).

Evaluate Video-MME v2 multiple-choice questions in two settings, each with
its own frozen cohort, result directory and metric namespace:

- Single-turn (configs/videomme_v2_single_turn.yaml): the stock simple_agent
  makes one tool-free request with the prepared (VideoAnyRes) video.
- Agentic (configs/videomme_v2_agentic.yaml): opencode_video_agent, a
  subclass of the stock opencode_sandboxed_agent, binds the source video
  and a SHA256-pinned media-tool runtime (watch_video, view_image) into the
  sandbox and exports media-preserving transcripts. vllm_video_model keeps
  images and videos returned by tools as structured parts of the tool
  message, and nemo_gym.openai_utils accepts video parts in function-call
  outputs and tool messages.

resources_servers/video_mcqa holds the benchmark-independent task contract,
which keeps the model-visible question and media apart from the
verifier-only gold answer and provenance, and the deterministic grading of
the final answer (a boxed letter, optionally a bare letter) with explicit
no-answer, format, ambiguity and failure outcomes and fixed-cohort
accuracy. videomme_v2.task and videomme_v2.scoring re-export them.

The videomme_v2 verifier checks every result against the frozen cohort and
reports raw accuracy and the official nonlinear group score, overall and for
L1/L2/L3, on a 0-100 scale; mean/Video_MME_v2[_agentic] stays the 0-1 raw
accuracy. Four-question groups are validated against the source question
order and scored within each repeat. Missing and infrastructure-failed rows
stay in the denominators, and coverage and completeness metrics mark
partial results.

The server venvs install nemo-gym ([dev,sandbox] for the OpenCode video
agent). No benchmark data, media, checkpoints, runtime bundles or
credentials are included.

Signed-off-by: Guo Chen <[email protected]>
Evaluate Video-MME (v1) and THUDM/LVBench in the two Video-MME v2 settings:
single-turn VideoAnyRes through simple_agent, and agentic through
opencode_video_agent, each with its own frozen cohort and namespace.

resources_servers/video_mcqa gains what both benchmarks share:
- prepare: CLI that turns the authors' annotations (JSON, JSONL or Parquet)
  and an explicit media inventory into Gym task rows, a frozen cohort and a
  receipt with input/output SHA256s; it never downloads data and never
  overwrites an output directory.
- dataset: annotation loaders for both benchmarks. Repeated option texts in
  the source are kept and flagged outside the model input; the task
  contract accepts them only when a loader opts in (allow_duplicate_options).
- app: VideoMCQAResourcesServer, which verifies results against the cohort
  and reports question-weighted accuracy on a 0-100 scale, overall and per
  reporting category (duration, domain, sub-category and task type for v1;
  capability for LVBench), with mean/<benchmark> as the 0-1 alias.

resources_servers/videomme_v1 and resources_servers/lvbench select the
benchmark and provide the single-turn and agentic configs; their venvs
install nemo-gym.

Signed-off-by: Guo Chen <[email protected]>
Adds the OpenCode provider/plugin modules used by opencode_video_agent's
runtime bundle: the watch_video and view_image tools, inline media bridging,
the per-request media budget, and opt-in private capture of the exact model
inputs and outputs. The bundle builder (NeMo-RL tools/video_media) packages
these files; the stock opencode_agent is unchanged. Includes node tests.

Signed-off-by: Guo Chen <[email protected]>
NeMo-RL Gym rows name local videos by absolute path, which NeMo-RL turns
into data URLs before its own vLLM sees them. A standalone vLLM server
reads local media only from file:// URLs under --allowed-local-media-path,
so the video model server now sends absolute paths that way. Other video
sources are unchanged.

Signed-off-by: Guo Chen <[email protected]>
Declares the dependencies of lvbench, video_mcqa, videomme_v1,
videomme_v2, opencode_video_agent and vllm_video_model in pyproject.toml
with the shared uv policy and commits their uv.lock files, replacing
requirements.txt. The locked versions equal those of openai_model and
opencode_sandboxed_agent.

Adds data/example.jsonl with five invented single-turn rows each for
Video-MME v2, Video-MME and LVBench; they contain no benchmark
questions, answers or media.

The OpenCode media tests that import the pinned SDK now skip when
NEMOTRON_OPENCODE_DEPENDENCY_ROOT is unset, and two opencode_video_agent
tests are reformatted with ruff.

Signed-off-by: Guo Chen <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

…e test

detect-secrets reports the SHA-256 digest of "abc" in
test_media_capture_io.mjs as a high-entropy hex string. It is the
published FIPS 180-2 test vector, so mark it with the inline
`pragma: allowlist secret` comment used elsewhere in the repository.

Signed-off-by: Guo Chen <[email protected]>
@cmunley1

Copy link
Copy Markdown
Contributor

/ok to test 5e8484d

@cmunley1

Copy link
Copy Markdown
Contributor

/review

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 13, 2026 01:36

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HOLD

I found three BLOCKERs: the video agent rejects a keyword its parent always supplies, saved execution failures can become correct answers during reverification, and exported video tool results lose model-visible receipt text. The inline findings also cover broken sandbox presets, missing validation contracts/artifacts, and two converter compatibility defects.

RISK — representative real-model evidence is missing. The PR reports CPU-only validation and no model rollouts. The repository quality bar requires representative smoke rollouts for behavior-changing environment and agent work. Could you provide inspected single-turn and agentic runs covering all three adapters, with model/runtime versions, cohort identity, aggregate reward, coverage, and representative trajectories? Confirm that the intended video reaches the model, private answers stay outside its input, media tools execute, and verification/aggregation agree. Retain the separate setting namespaces, evaluation-only restrictions, and verified: false; smoke evidence isn't full benchmark certification. These are missing validation results, not runs I observed failing.

NOTE — add published user documentation. The component READMEs explain the feature, but no Fern documentation accompanies these new user-facing environments. Please add a video-evaluation guide linked from the published environment catalog. Include a minimal preparation/composed-run example, external VideoAnyRes/runtime requirements, and score namespaces. Preserve the licensing and unverified-status caveats in the shared guide. Acceptance is a reachable published page, resolvable example configuration, and passing docs checks.

I completed static inspection across the 85 changed files and affected contracts. Dependency-lock inspection covered resolution policy and component declarations, not every wheel hash. I independently covered the JavaScript topic after its delegated advisory wasn't delivered. I couldn't inspect the external media CLI/runtime bundle or execute tests, GPU inference, or sandbox rollouts here. All suggested patches and acceptance checks below need verification before adoption.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

await raise_for_status(response)
return AggregateMetrics.model_validate(await get_response_json(response))

async def _create_opencode_config(self, request: Request) -> dict:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKER — retain the parent's image_input keyword

Every agentic run that reaches the native loop fails before model execution. The parent calls this hook with image_input=bool(attachments), including False for these text-only prompts. This override rejects that keyword with TypeError. The setup tests mock out the parent responses(), so they don't exercise the failing call.

Could you replace the override with:

async def _create_opencode_config(self, request: Request, *, image_input: bool = False) -> dict:
    return video_config(
        await super()._create_opencode_config(request, image_input=image_input),
        output_tokens=self.config.max_output_tokens,
        model=self.config.opencode_model,
    )

This retains the parent's attachment handling and the subclass's provider/plugin, output reserve, and optional model rename. Update the delegation assertion to expect the forwarded keyword.

Proposed acceptance: exercise the real parent responses() with sandbox I/O mocked for both a text-only video task and an inline-image task. Both should reach the OpenCode launch without TypeError; the image case should retain attachment.image limits alongside the video modalities/media plugin. Preserve the existing config-immutability and named-model assertions.

self._validate_metadata(body.verifier_metadata, setting=body.setting)
failure: Failure | None = None
reason = None
if body.response.status == "failed" or body.response.error is not None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKER — keep execution-failure zeroes stable during reverification

A captured agentic execution failure with a correct final \boxed{B} can score zero initially and one on replay. The inherited run boundary requests forced-zero grading; its helper verifies an empty output, then restores the original response in the saved row. This verifier and the v2 verifier subsequently grade that restored answer without its execution-failure classification. Standard reverification payload construction also doesn't copy opencode_failed from the saved rollout.

Could you carry an explicit classification through initial grading and saved-response replay? A small implementation is to set response.metadata['video_execution_failure'] = 'true' in the video agent before returning a response whose run result has opencode_failed=True, then add an agentic-marker branch in both verifiers that passes failure='execution_failure' to grade_answer. Keep the existing infrastructure-failure branch first. Response metadata survives both the forced-empty copy and reverification, unlike a rollout-only flag. Keep the original transcript for inspection.

Proposed acceptance: through the inherited run path, capture a correct answer followed by execution failure, source mutation, or length-limit failure. Initial grading and replay via _build_verify_payload must both return zero, outcome='execution_failure', no prediction, and an unmasked completed evaluation. Preserve successful correct/wrong answers, single-turn tool rejection, and masked/inconclusive infrastructure failures.

else:
if tool_name in {"watch_video", "view_image", "view_video"}:
raise ValueError("Unsupported visual tool attachment MIME")
if parts and text and tool_name not in {"watch_video", "view_image", "view_video"}:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKER — preserve video receipt text in exported tool results

For a completed watch_video result with nonempty state.output and a video attachment, this branch exports only the attachment. The model actually receives both: the JavaScript bridge suppresses text only for view_image, and the receipt regression case expects frame counts, visual-token counts, and sampling intervals beside the video. Saved transcripts silently lose those observations, affecting replay and training consumers. The legacy view_video shape has the same mismatch.

Replace this condition with:

Suggested change
if parts and text and tool_name not in {"watch_video", "view_image", "view_video"}:
if parts and text and tool_name != "view_image":

This aligns video exports with the live bridge while preserving image-only view_image behavior. Keep original call IDs, attachment order, the compacted-result sentinel, failed-tool error text, and native nonvisual-tool text.

Proposed acceptance: export watch_video and view_video states with output='Frames: 120 total' and one video attachment; each output must contain the text part followed by the unchanged video part. view_image with explanatory output must still export only its image. Retain the current empty-receipt, compacted-result, invalid-attachment, and nonvisual-tool cases.

workdir: /testbed/work
resources:
cpu: 2
memory: 8Gi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RISK — use the provider-neutral memory field in both presets

With otherwise valid runtime inputs, LVBench and VideoMME-v1 fail before sandbox creation because their presets use memory: 8Gi. The inherited sandbox setup passes this mapping to SandboxResources.from_mapping, which rejects memory as an unknown key. The v1 preset has the same problem; v2 already uses the supported field.

Replace this line in both affected YAML files with:

Suggested change
memory: 8Gi
memory_mib: 8192

Retain cpu: 2, provider selection, image/workdir, TTL, and readiness settings.

Proposed acceptance: extend the composed-config tests to pass every agentic preset's resources mapping through SandboxResources.from_mapping; assert cpu == 2 and memory_mib == 8192. A mocked sandbox-start test should reach creation instead of raising Unknown sandbox resource keys: memory. Preserve the single-turn configuration assertions.

cohort_manifest: Path


class VideoMCQAVerifyRequest(BaseVerifyRequest):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RISK — provide the required task-data schemas

None of video_mcqa, videomme_v1, videomme_v2, or lvbench ships task_data.py. Adding these applications therefore violates the existing schema-presence gate. Standard collation also skips their task validation, including with task_data_validation=error.

Could you add dependency-light TaskData declarations using the existing normalization contract, with enforcement against the actual request models and agent-consumed binding? The tooling flattens verifier_metadata, so copying the nested request model verbatim isn't sufficient. Mark exclusively nested wire fields with legacy_location, preserve required identity/setting/provenance fields and the current unknown-field policy, and enforce the agentic binding without requiring one for single-turn rows. For a genuinely non-server shared package, moving it outside resources-server discovery is an alternative to inventing a placeholder schema.

Proposed acceptance: the existing schema-presence test passes; committed examples and prepared rows for both settings validate through each concrete owner's TaskDataValidator. Missing required metadata, misplaced nested-only fields, malformed bindings, and runtime/schema drift must fail targeted checks. Preserve allowed duplicate-option annotations and optional v2 level/group metadata.

@@ -0,0 +1,5 @@
{"task_id": "videomme_v2:example-1", "setting": "single_turn", "responses_create_params": {"tools": [], "tool_choice": "none", "input": [{"role": "user", "content": [{"type": "input_video", "video_url": "https://example.invalid/videos/synthetic-1.mp4"}, {"type": "input_text", "text": "Watch the video and answer the question.\nPut the selected option letter in \\boxed{...} as your final answer.\n\nQuestion: Which invented shape moves across the synthetic clip?\nA. Circle\nB. Square\nC. Triangle\nD. Star"}]}]}, "verifier_metadata": {"task_id": "videomme_v2:example-1", "expected_answer": "B", "option_count": 4, "dataset_source": "https://example.invalid/videomme-v2-synthetic-examples", "dataset_revision": "0000000000000000000000000000000000000000", "video_id": "synthetic-1", "video_source": "https://example.invalid/videos/synthetic-1.mp4", "video_sha256": "0000000000000000000000000000000000000000000000000000000000000000", "level": null, "group_id": null}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RISK — complete the resources-server example-validation artifacts

The three concrete servers contain five example rows but no example metrics or rollout sidecars; video_mcqa has no example data. Consequently _validate_data_single() rejects all four new components. The full component suite always enables this validation and fails on these results. The PR reports the same failures; they aren't passes or pre-existing upstream failures.

Could you supply runnable invented example media/cohorts and example dataset declarations for the concrete servers, generate their metric sidecars, and record five genuine model rollouts per server? The current example.invalid video URLs aren't runnable media. For video_mcqa, satisfy the component contract or move the shared package outside server discovery and update its imports/tests. Keep restricted benchmark content out of the repository; invented media is sufficient.

Acceptance: ng_test +entrypoint=resources_servers/<component> +should_validate_data=true succeeds for every retained component. Each concrete metric sidecar reports Number of examples == 5, each rollout file has five measured rows, and the example cohort matches their IDs, setting, and revision. Preserve the existing parser and frozen-denominator assertions. I confirmed the missing artifacts statically, not by executing these commands.

"""The stock vLLM model server, with ToolMediaConverter as its converter."""

def get_converter(self) -> ToolMediaConverter:
return ToolMediaConverter(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RISK — forward the configured custom-tool strategy

This model inherits and accepts custom_tool_strategy='function_bridge', but its converter silently falls back to passthrough. A custom exec declaration is therefore converted to a chat custom tool rather than the requested function bridge, and replaying its custom_tool_call raises NotImplementedError. The parent get_converter() forwards this setting.

Add this constructor argument:

custom_tool_strategy=self.config.custom_tool_strategy,

Retain token-information/reasoning settings, default passthrough behavior, and structured image/video transport. Give the existing mocked config a concrete strategy value.

Proposed acceptance: exercise the existing bridge declaration and replay expectations through VideoVLLMModel.get_converter(): a custom exec tool and its history must become function-shaped with one string input parameter and unchanged call identity. A matching backend call must lift back to a custom call with the original payload. With passthrough, declarations must remain custom and unsupported replay must still fail explicitly. Retain mixed-media conversion tests.

if isinstance(output, list) and any(part["type"] in {"input_image", "input_video"} for part in output):
# The message formatter maps each structured media part and
# flushes the preceding assistant tool calls. It does not sort calls.
self._format_message(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RISK — retain the supported tool-image original detail mapping

This branch sends tool images through the user-message formatter, bypassing the shared tool-image helper. A tool output such as {'type': 'input_image', 'image_url': url, 'detail': 'original'} therefore raises NotImplementedError, even when tool-image inlining is enabled. The shared helper deliberately maps tool-image original to chat high, and an existing regression test pins that behavior.

Before this _format_message call, normalize only tool-image original parts:

output = [
    {**part, "detail": "high"}
    if part["type"] == "input_image" and part.get("detail") == "original"
    else part
    for part in output
]

Keep this inside _format_function_call_output: user-image original must remain explicitly unsupported. Preserve ordinary image details, surrounding text/media order, local-video URL conversion, and call IDs.

Proposed acceptance: convert image-only and mixed text/video/image tool outputs with original; assert chat detail high and unchanged order/identity. auto, low, and high must remain unchanged. A user image with original, and a tool image carrying only file_id, must still fail explicitly. Retain the existing mixed-media round-trip cases.

cg1177 and others added 8 commits November 14, 2026 01:50
…d mark failed runs

OpenCodeSandboxedAgent.responses() calls _create_opencode_config(request,
image_input=...), so the override now takes and forwards that keyword; it
previously raised TypeError before any model call. A test drives the real
parent responses() with only sandbox I/O mocked, for a text-only turn and
for an inline image, and checks the launched OpenCode config.

Exported watch_video and view_video results keep their text receipt before
the media, as media_bridge.mjs replays them to the model; only view_image
drops its text beside the image.

When execution_failure_reward_zero applies to a failed run (a failed or
length-limited OpenCode run, or a modified source video), the response
carries metadata video_execution_failure="true", so the verifier grades the
saved answer as an execution failure when the row is replayed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>
…rified

A failed agent run is graded on an emptied copy of its response, and the
saved row keeps the original response. Replaying that row (rollout
reverification) graded the original final answer, so a failed run with a
correct boxed letter could turn from 0 into 1. The VideoMME-v1/LVBench and
VideoMME-v2 verifiers now treat an agentic response whose metadata carries
video_execution_failure="true" as an execution failure: reward 0, no
prediction, completed and unmasked. Failed model calls stay inconclusive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>
…sets

SandboxResources.from_mapping() rejects the "memory" key, so these presets
failed before sandbox creation. They now use memory_mib: 8192, as the
VideoMME-v2 preset does, and the composed-config test parses each agentic
preset's resources.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>
video_mcqa, videomme_v1, lvbench and videomme_v2 now ship task_data.py, as
every resources server must. The shared schema mirrors the verify requests
(task_id and setting top-level, VerifierMetadata fields marked as read from
verifier_metadata) and requires the video_binding that the OpenCode video
agent reads on agentic rows. VideoMME-v1 and LVBench rows have four choices
and no level or group; VideoMME-v2 rows may have any option count, a level
and a group. Tests check the committed examples and prepared rows of both
settings against each server's schema and the runtime request models, and
that rows the runtime refuses fail validation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>
…e original detail

The tool-media converter now receives the configured custom_tool_strategy,
so function_bridge lowers custom tools to function tools and lifts their
calls back, as the stock vLLM model server does. Tool-output images with
detail "original", which chat lacks, are sent as "high", as the shared
tool-image path sends them; a user image with "original" stays unsupported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>
tests/unit_tests/data/test_task_data.py imports every server's task_data.py, so
the core coverage gate measures resources_servers/video_mcqa/task_data.py, while
the servers' own tests do not run in that job. Core-suite tests now exercise the
schema's validators on synthetic rows, as tests/unit_tests/benchmarks does for
other servers' schemas.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>

@yfw yfw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HOLD. The agentic setting cannot run from public code (opencode_video_agent/app.py:270). Landing the single-turn setting first is the suggested path.

Thank you for three benchmarks with careful grading. The Video-MME v2 group score matched the official scorer in all 96 cases run against it, and the frozen denominators report coverage. Each fix for the automated review has a test that fails without it.

CI unit and server tests have not run at this head. The last CI trigger was for 5e8484df28, so a maintainer needs to trigger CI again for edbb3e6cd8. DCO passes on every commit, and pre-commit passes. Even after the split, the single-turn half fails CI's data validation: the three servers have no data/example_metrics.json or data/example_rollouts.jsonl, and video_mcqa has no example data. That is the automated review's open point on example.jsonl, and the split does not fix it.

The PR description still reads as a draft: "N/A for this draft", "Follow-ups before ready for review", and validation at 158bebdb7. Please refresh the validation at the final head, and add labels (feature, area:environment). Please also drop "for RL training" from Why. The Video-MME, LVBench and video_mcqa READMEs, the catalog rows and all three dataset terms say evaluation only or noncommercial use. The follow-up that the description lists for the pre-0.8 import paths is still open.

Two open PRs also add Video-MME and Video-MME v2. PR #5894 runs Video-MME and Video-MME v2 through stock opencode_agent sessions, with media as images through tools. PR #3996 scores Video-MME v2 groups with a different rule. It drops a group with a masked or missing member, but this PR counts that member as wrong and reports group coverage. This PR and #5894 do not name each other.

The single-turn VideoAnyRes preparation is also not public. It is data preparation, not code on the run path, so it is a note (videomme_v2/README.md:55-58) and not part of the blocker.

Agentic training needs NeMo-RL work beyond video_media_cli, and the description does not list it. It needs a vLLM loader for the fixed-video payload and tool-video media in the trainer. The NeMo-RL media capture also refuses prompts that mix images and video (captured_media.py L429-L432), and this agent offers both view_image and watch_video. This can wait for the follow-up.

With execution_failure_reward_zero: true, the parent opencode_sandboxed_agent also scores a model-server outage inside an OpenCode run as 0 (opencode_sandboxed_agent/app.py L1823-L1826). This is not new in this PR.

Generated by Claude Code

Comment thread resources_servers/video_mcqa/app.py Resolved
Comment thread resources_servers/videomme_v2/README.md Resolved
Comment thread resources_servers/videomme_v2/README.md Resolved
Comment thread resources_servers/videomme_v2/README.md Resolved
cg1177 and others added 3 commits November 16, 2026 00:53
Land Video-MME v2, Video-MME and LVBench as single-turn environments; the
agentic setting moves to a separate change.

- Remove responses_api_agents/opencode_video_agent, the OpenCode media
  modules and their Node tests in responses_api_agents/opencode_agent, the
  three agentic configs and responses_api_models/vllm_video_model, and
  restore the core Responses types. Single-turn rows run on the stock
  vllm_model.
- Run the single-turn configs through single_agent_turn_legacy
  Environment Servers.
- Skip rows without a verifier outcome, such as Gym's counted-zero rows,
  when aggregating fixed-cohort metrics.
- Serve the shared video_mcqa verifier directly with
  configs/video_mcqa_single_turn.yaml; the cohort names the benchmark.
- Add five synthetic example clips, inline them as MP4 data URLs in the
  example rows, and add example cohorts and example datasets.
- Move the shared scorer and task tests to video_mcqa/tests.
- Document the single-turn inputs, the dataset terms and the parser
  difference from the official scripts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>
Add data/example_rollouts.jsonl and data/example_metrics.json for the
videomme_v2, videomme_v1, lvbench and video_mcqa resources servers, which
the legacy data validator requires.

The five rollouts per server come from
nvidia/Nemotron-3-Nano-Omni-30B-A3B-Reasoning-BF16 served by vLLM with the
model card's video settings, collected through the stock vllm_model,
simple_agent and single_agent_turn_legacy servers on the synthetic example
clips. The example metrics come from gym dataset collate with
+mode=example_validation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>
@cg1177 cg1177 changed the title feat(video): add Video-MME v2, Video-MME and LVBench environments with an OpenCode video agent feat(video): add single-turn Video-MME v2, Video-MME and LVBench environments Nov 15, 2026
@cg1177

cg1177 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@yfw Thanks for the detailed review. I followed the suggested path: this PR now lands only the single-turn setting, and the
agentic setting moves to a follow-up PR. The new head is 5977f7f112b29ad30efb07f208fddcfc66061160, a fast-forward
from edbb3e6cd (no rebase) that also merges main 951ee9ec8.

  • Split. Removed responses_api_agents/opencode_video_agent/, the eight .mjs modules and seven Node tests in
    responses_api_agents/opencode_agent/, and the three *_agentic.yaml configs.
    responses_api_models/vllm_video_model/ is gone too, together with the two core type changes, so the PR no longer
    touches nemo_gym/. The setting-aware verifier code stays. The agentic code remains in this branch's history for the
    follow-up.
  • Must-fix items. Gym's counted-zero rows no longer break /aggregate_metrics in either verifier (threads 5 and
    6), and the shared scorer tests moved to video_mcqa/tests (thread 12).
  • Docs. The Video-MME v2 README states the dataset terms (9), the single-turn inputs a gym eval user can send
    today (10), and why the scores are not comparable to the official parser's (11).
  • Environment Servers. All single-turn configs now run simple_agent through single_agent_turn_legacy (4).
  • Example data and real-model smoke. Each of the four resources servers now has five invented questions about five
    synthetic clips, data/example_metrics.json and data/example_rollouts.jsonl with real-model rollouts. The rollouts
    come from nvidia/Nemotron-3-Nano-Omni-30B-A3B-Reasoning-BF16 on vLLM 0.30.1rc1.dev143+g29468dde8 through the
    stock vllm_model, simple_agent and single_agent_turn_legacy. In each server the model answers four of the five
    questions correctly (reward 1). On the counter clip it reads the final 5 as 9 (incorrect), and once it runs out of
    its 16,384 output tokens (no_answer, Video-MME v2); both score 0, so raw accuracy is 80 with full coverage on every
    server. Every request carries 683-687 input tokens; a direct probe of the same server gives 643 prompt tokens with
    the clip and 27 without it. The rows inline each clip as an MP4 data: URL, so they run with no
    --allowed-local-media-path.
  • Description is rewritten for the final head. I can't set labels on this repo, so could a maintainer add
    feature and area:environment?

Validation at 5977f7f112b29ad30efb07f208fddcfc66061160: the four video servers pass their tests and Gym's legacy data
validation with CI's server-suite command, server-suite shard 7 passes, the core unit tests pass (22,390 passed, 0 failed), and pre-commit run --all-files, the secrets-detector command and the lock checks pass. Details are in the description.

Inline threads

  1. Agentic setting not runnable from public code (opencode_video_agent/app.py:270).
    Done as suggested: the agent, the eight .mjs modules with their seven Node tests, and the three agentic configs
    are removed. test_configs.py, test_task_data.py and test_prepare.py no longer import or name the agent. The
    binding checks the agent used to enforce are still tested against the task-data schema. The follow-up PR will
    bring the agent back only when it has the five things you listed: a build recipe for the runtime archive,
    nemo_rl.environments.video_media_cli public in NeMo-RL, the vLLM loader for the tool video named in the README,
    a sandbox that loads the repo's .mjs files (your upload snippet), and real-model rollouts.

  2. Post-run sha256sum timeout scores a correct answer as 0 (opencode_video_agent/app.py:314-316).
    The agent is no longer in this PR. Your fix (raise on a set error_type or -1, and read stdout or "") is on the
    follow-up's list, with a test for the timeout and the stdout=None cases.

  3. Stock harnesses get no video (opencode_video_agent/app.py:174).
    Thanks, noted for the follow-up design. I will look at running the agentic setting on stock opencode_agent
    under single_agent_turn_legacy, with the resources server lending the sandbox, before re-proposing the agent.

  4. Switch the single-turn relay to single_agent_turn_legacy (videomme_v2_single_turn.yaml:22-28).
    Done for Video-MME v2, Video-MME, LVBench and the shared video_mcqa config with
    scripts/add_legacy_agent_environment_servers.py --switch-simple-agent. I removed the direct_http tool grant the
    script adds, because these verifiers have no tools; the result matches your suggestion and math_with_judge.yaml.
    The script's --check now reports nothing left to switch. test_configs.py validates each environment with
    SingleAgentTurnLegacyEnvironmentServerConfig and checks its resources-server binding. The example rollouts were
    collected through these Environment Servers.

  5. Counted-zero rows break Video-MME and LVBench metrics (video_mcqa/app.py:183-185).
    Fixed as suggested: aggregation skips a row without a verifier outcome, so the frozen cohort counts that task as
    missing. New test: one measured row plus a Gym-style counted row (the task's dataset fields, reward 0,
    mask_sample false, no verifier fields) gives the same benchmark metrics as the measured row alone
    (raw_acc 50, coverage 0.5, is_complete false), for both benchmarks.

  6. Counted-zero rows raise KeyError: 'answer_policy' in Video-MME v2 (videomme_v2/app.py:192-194).
    Fixed the same way, with the same test for Video_MME_v2.

  7. vllm_video_model is not needed (vllm_video_model/app.py:6-7).
    Done: the component is deleted, and so are the function_call_output video part and the chat tool-message
    video_url part in nemo_gym/core/responses_api_types.py (the file and its test now match main). The READMEs say
    that rows carry data: or file:// video URLs and point at the stock vllm_model, which served the example
    rollouts.

  8. EXECUTION_FAILURE_METADATA_KEY is defined twice (opencode_video_agent/app.py:23-35).
    The agent's copy left with the agent; video_mcqa/scoring.py keeps the only definition. The follow-up agent will
    import it from resources_servers.video_mcqa.scoring, as you suggest.

  9. Video-MME v2 dataset terms (videomme_v2/README.md:144).
    Added your text.

  10. What single-turn rows can carry today (videomme_v2/README.md:55-58).
    Added a "Single-turn inputs" section to the Video-MME v2 and video_mcqa READMEs: data: URLs need no setup,
    file:// URLs need --allowed-local-media-path and a file on the vLLM host, vLLM samples 32 frames unless
    --media-io-kwargs says otherwise, and such runs are not the VideoAnyRes protocol. Video-MME v2 still has no
    preparation CLI, so the README shows how to build a row with prepare_single_turn(); a v2 annotation adapter
    (levels, groups and group structure, with its own tests) is left for a later change.

  11. Parser difference from the official script (videomme_v2/README.md:126-127).
    Added your text to the Video-MME v2 README, and the same caveat to the Video-MME and LVBench READMEs. The
    scoring itself is unchanged.

  12. Shared scorer tests live in videomme_v2/tests (videomme_v2/tests/test_scoring.py:9).
    Moved test_scoring.py and test_task.py to resources_servers/video_mcqa/tests/ (with git mv); they import
    resources_servers.video_mcqa.scoring and .task, and videomme_v2/tests/test_metrics.py imports the moved
    module. I checked the move by breaking the scorer locally: grading an unclosed <think> as the answer, or dividing accuracy by the returned rows instead of the frozen cohort, now fails the video_mcqa suite (1 and 2 tests).

@cmunley1

Copy link
Copy Markdown
Contributor

/ok to test 5977f7f

@cmunley1

Copy link
Copy Markdown
Contributor

/review

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team November 15, 2026 19:07
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP

I verified that the earlier blocking failures are fixed or removed from this single-turn change. Both verifiers handle the execution-failure marker, and the replay regression helper exercises forced-zero grading and saved-response reverification. The task-data schemas and example sidecars are present. Removing the video-specific agent, model adapter and agentic presets makes their earlier findings inapplicable.

The committed rollout artifacts and documented model setup address the earlier absence of smoke evidence for the narrower single-turn scope. One prior NOTE remains: the published catalog has entries, but no published preparation/run guide.

I completed this follow-up against the previous reviewed tree, checking the earlier findings, subsequent changes and directly affected integration paths. I found no new regression eligible above the historical moderate-impact threshold. I did not execute tests, GPU inference or Fern checks, and I did not independently reproduce the reported accuracy or coverage. Some earlier converter comments were truncated; their implementation is absent from the current tree.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

| [wmt_translation](https://github.com/NVIDIA-NeMo/Gym/tree/main/resources_servers/wmt_translation) | Machine translation with BLEU and xCOMET-XXL | Execution (COMET metrics) | ✓ |
| [longmt_eval](https://github.com/NVIDIA-NeMo/Gym/tree/main/resources_servers/longmt_eval) | Document-level translation (SEGALE pipeline + COMETKiwi) | Execution (neural QE) | ✓ |
| [vlm_eval_kit](https://github.com/NVIDIA-NeMo/Gym/tree/main/resources_servers/vlm_eval_kit) | VLM benchmarks: MMBench, OCRBench, and others | Execution (VLMEvalKit) | ✓ |
| [videomme_v2](https://github.com/NVIDIA-NeMo/Gym/tree/main/resources_servers/videomme_v2) | Video-MME v2 single-turn video multiple-choice QA (evaluation only) | Boxed letter; fixed-cohort accuracy and grouped nonlinear score | |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE — finish the published video-evaluation guide

The documentation finding in review 5884933909 is partly addressed. These catalog entries link to GitHub directories, but a reader still has no published walkthrough for preparing the required cohort and running a single-turn evaluation. The runnable examples and media requirements are only in the shared README.

Could you add a short guide under the evaluation docs and link it here? Reuse the existing preparation example and composed vllm_model run, name each benchmark's cohort variable, and explain the Video_MME, Video_MME_v2 and LVBench namespaces. The invariant is that a reader can prepare inputs and run a shipped single-turn config from the published docs without depending on the removed agentic components.

Keep the distinctions between inline data: media and host-local file:// media, and between vLLM sampling and the unavailable VideoAnyRes preparation. Preserve the evaluation-only restrictions, parser-comparability caveats and verified: false status. Document agentic execution as a follow-up, not an available preset.

Proposed acceptance: the catalog link reaches the guide in the Fern preview; its composed configuration resolves with a committed example cohort and all required variables supplied; make docs-check and pytest tests/unit_tests/test_fern_docs_links.py pass. The walkthrough must reference only shipped single-turn components. I have not run these checks.

yfw
yfw previously approved these changes Nov 16, 2026

@yfw yfw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. CI still has to pass after you merge main to fix the README table conflict.

@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Guo Chen <[email protected]>
@cg1177

cg1177 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

@yfw Thanks for the approval! I merged main to resolve the README environment-table conflict; only this PR's four rows were added and nothing else changed. The new commit dismissed your approval automatically, so could you please re-approve?

@cmunley1

Copy link
Copy Markdown
Contributor

/ok to test 5fcb983

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team November 16, 2026 06:18
@yfw
yfw added this pull request to the merge queue Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43840208618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants