Skip to content

fix(signatures): build_payload raises AttributeError when targets_meta is a dict #366

Open

Description

Description

SignatureManager.build_payload accepts targets_meta as a single dict (it is broadcast to every execution signature), but then reads it with attribute access (target.agent_id, target.asset_id, target.asset_group_id), so passing a dict raises AttributeError. Only objects with those attributes work, e.g. the injectors' msg_data.targets_meta entries.

if isinstance(targets_meta, dict):
    targets_meta = [targets_meta] * len(execution_signatures)
...
SignatureTarget(agent=target.agent_id, ...)

Environment

  1. OS: macOS 26
  2. Version: main (3.261014.1)
  3. Other environment details: Python 3.14

Reproducible steps

from pyoaev.signatures.models import ExecutionSignature
from pyoaev.signatures.signature_manager import SignatureManager

SignatureManager.build_payload(
    ExecutionSignature(),
    {"agent_id": "a", "asset_id": None, "asset_group_id": None},
    ["DETECTION"],
)

Expected output

The dict is used as the target metadata of every signature (or dicts are rejected with a clear error and the docstring/type hint says objects are required).

Actual output

AttributeError: 'dict' object has no attribute 'agent_id'

Additional information

No injector passes a dict today, so nothing is broken in production. Found while working on #352; #364 doesn't change this.

Activity

  1. added
    bug
    needs triage
    on Oct 19, 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

    bugneeds triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions