Skip to content

fix(operator-queue): one malformed entry no longer stops answer delivery to its agent (#3313) - #3333

Merged
vybe merged 1 commit into
devfrom
feature/3313-opqueue-unhashable-entry
Oct 7, 2026
Merged

vybe merged 1 commit into
devfrom
feature/3313-opqueue-unhashable-entry

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

Summary

One malformed entry in an agent's operator-queue file (a list or object where id or priority should be a scalar) raised TypeError out of _sync_agent. _poll_cycle's gather(return_exceptions=True) dropped it unlogged, so no operator answers reached that agent while the entry was there, and nothing showed in the logs.

  • Non-string id: checked before any lookup. A pending entry is held as invalid_id (the same treatment as the create-side shape check); any other status is skipped. Every other entry for that agent still syncs.
  • Write-back loop: also crashed on the same id, a site the issue didn't list. It now skips non-string ids, which can never name a row.
  • priority: _clamp_ingested_item and _comparable_priority check it's a string before the set lookup; a list or object becomes medium. The clamp's never-raises contract holds again.
  • Logging: each agent's sync exception from the gather is logged at ERROR with the agent name and error type.

Tests

  • test_ec_operator_queue_edges.py::TestUnhashableEntryValues: three strict-xfail markers removed.
  • New test_3313_operator_queue_sync_error_logged.py drives the real _poll_cycle with two agents, one of whose syncs raises.
  • All 45 unit files importing operator_queue_service: 1645 passed, 11 xfailed (other issues' markers).
  • Mutation check: with the service change reverted, all 5 new or unmarked cases fail; restored byte-identical.

Fixes #3313

🤖 Generated with Claude Code

…ery to its agent (#3313)

A list/object `id` reached the unguarded `in open_by_rid` (and the write-back's
`in response_map`) and raised out of `_sync_agent`; a list/object `priority`
raised in `_clamp_ingested_item` (breaking its never-raises contract) and in
`_comparable_priority` via `changed_fields`. `_poll_cycle`'s
gather(return_exceptions=True) then dropped the error unlogged, so the agent's
answers stopped being written back every 5 s with nothing in the logs.

- Non-string id: held as invalid_id when pending, skipped otherwise, before any
  lookup; skipped in the write-back loop (it names no row).
- Priority: isinstance-guarded in the clamp and _comparable_priority (-> medium).
- Per-agent sync exceptions from the gather are logged with the agent name.

Tests: the three TestUnhashableEntryValues strict-xfails are unmarked, and new
test_3313_operator_queue_sync_error_logged drives the real _poll_cycle. With the
fix reverted, all five went red (unhashable id, priority rewrite, clamp
list/object, gather logging).

Fixes #3313

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vybe vybe 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.

merge-train: batch validated on train/20261007-1609 (#3349)

@vybe
vybe merged commit 3237ace into dev Oct 7, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants