Skip to content

bug: an unhashable value in an agent's operator-queue file silently stops answer delivery to that agent #3313

Closed

Description

@vybe

Summary

services/operator_queue_service.py::_sync_agent raises a TypeError when an agent's queue entry holds a list or dict where a scalar is expected. Each poll cycle runs its syncs through asyncio.gather(..., return_exceptions=True), which discards the error without logging it. The sync fails again every 5 seconds, and no operator answers are written back to that agent while the bad entry is there.

Trigger Where it raises
"id": ["x"] if req_id in open_by_rid is the one membership check with no isinstance guard
An ingested entry's priority rewritten to a list changed_fields → _comparable_priority
A list or dict priority on ingest _clamp_ingested_item. Its contract says it never raises; here the ask gets quarantined instead.

Context

The queue file is written by the agent, which means by an LLM, so malformed shapes are realistic. One bad entry should cost only that entry, not the whole agent's answer channel. Found by the 2026-10-06 /edge-cases sweep.

Acceptance Criteria

  • An entry with a non-scalar id, priority or other scalar field is skipped or quarantined on its own. Every other entry for that agent still syncs and gets its answers.
  • _clamp_ingested_item never raises on any JSON value.
  • Exceptions from an agent's sync are logged, not silently dropped by gather.
  • These strict-xfail tests in tests/unit/test_ec_operator_queue_edges.py pass with their markers removed:
    • TestUnhashableEntryValues::test_an_unhashable_id_does_not_stop_the_agents_answers
    • ::test_an_unhashable_priority_rewrite_is_a_change_not_a_crash
    • ::test_the_clamp_never_raises_on_an_unhashable_priority

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions