Skip to content

calendar: duplicate event IDs can receive full reward #5381

Closed

Description

@deavgprime

Describe the bug

The calendar verifier returns reward 1.0 for responses containing duplicate event IDs. This contradicts the calendar prompt's requirement that event_id be unique and allows an extra or invalid event to receive full credit.

In resources_servers/calendar/utils.py, grade_assistant_response() stores events in a dictionary keyed by ID. A later duplicate overwrites the earlier event before the count and constraint checks. The overlap check also skips all entries equal to the current event, so identical duplicates pass that check.

Steps to reproduce

From the repository root:

import json
from resources_servers.calendar.utils import grade_assistant_response

expected = {
    "0": {
        "event_id": 0, "duration": 60, "constraint": None,
        "min_time": "10:00", "max_time": "16:00",
    }
}
event = {
    "event_id": 0, "event_name": "Meeting",
    "start_time": "10:00", "duration": 60,
}

cases = {
    "valid": [event],
    "identical duplicate": [event, dict(event)],
    "duplicate at another time": [event, {**event, "start_time": "11:00"}],
    "invalid duration hidden by duplicate": [
        {**event, "duration": 30}, {**event, "start_time": "11:00"}
    ],
    "overlapping duplicate control": [event, {**event, "start_time": "10:30"}],
    "extra unique ID control": [event, {**event, "event_id": 1, "start_time": "11:00"}],
    "missing event control": [],
}
for name, events in cases.items():
    print(name, grade_assistant_response(json.dumps(events), expected))
valid (1, 'pass')
identical duplicate (1, 'pass')
duplicate at another time (1, 'pass')
invalid duration hidden by duplicate (1, 'pass')
overlapping duplicate control (0, 'conflicting_events')
extra unique ID control (0, 'different_number_of_events')
missing event control (0, 'no_json_list')

I also ran all seven cases through CalendarResourcesServer.verify() with real CalendarVerifyRequest and NeMoGymResponse objects. The returned rewards match the results above. Only the unused server client was mocked; the verifier and grading code were not mocked.

Expected behavior

Reject a calendar response with duplicate event IDs before constructing the event dictionary. The valid single-event response should continue to receive 1.0.

Environment

  • Source: efc2e77d2ac180fe93b487344574e7ee51b1bc7e
  • Python: 3.13.17; Ubuntu 24.04.5
  • Installed core dependencies from the repository lockfile.
  • Local CPU checks with supplied response text. No model or GPU execution.

Additional context

All 24 existing calendar tests pass. The two affected source files are also unchanged at newer main 7c97dae0187002f660ee96153e061783d8ad4bc1.

The uniqueness requirement is present in the system prompts in resources_servers/calendar/data/example.jsonl. This affects grading of a valid task and reference calendar, not just malformed task metadata.

I can prepare a focused fix and regression tests for identical duplicates, nonoverlapping duplicates, and duplicates that hide a constraint violation, if that scope works for the maintainers.

Activity

  1. added
    community-request
    on Oct 30, 2026
  2. added
    waiting-on-maintainers
    and removed
    waiting-on-maintainers
    on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    community-request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions