Skip to content

fix(pixel-agent-teams): tolerate missing conversation in agent view - #5945

Open
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-agent-teams-view-conversation
Open

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-agent-teams-view-conversation

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/extensions/services/dashboard-api/pixel_agent_teams.py, TeamManager.view(row) constructs the external sanitized presentation of team and agent records. When formatting agent review outcomes and retries, it iterates over agent['conversation'] directly:

if agent['status']=='failed' and not any(m['role']=='assistant' for m in agent['conversation']):

If an agent record failed early during initialization (before conversation arrays were populated), was interrupted during serialization, or contains non-dict message entries, accessing agent['conversation'] throws an unhandled KeyError or TypeError: 'NoneType' object is not iterable. This corrupts client status retrieval for the entire team.

This change uses safe dictionary retrieval conversation = agent.get("conversation") or [] and verifies isinstance(m, dict) before inspecting message roles. It also uses safe .get() methods across agent status, role, and retries attributes. Standard completed and failed agent views continue to render identically.

Validation

  • Tested baseline reproduction against unpatched code: calling TeamManager.view() on a team row with missing or None agent conversation failed with KeyError: 'conversation' / TypeError.
  • Tested post-fix behavior: rows with missing, null, or malformed conversations render cleanly with populated error strings and expected retry flags.
  • Telemetry statement: "Dashboard-api suites: 1 passed. New-test Ruff, py_compile, and diff checks pass; new regression wired into Linux CI."

Overlap check

Risk / AI disclosure

AI-assisted investigation, implementation, and regression test authoring. This hardens view projection safety and does not alter underlying data schemas, controller state machines, or network calls. Independent human review remains a gate.

Follow-up integration evidence

Composed cleanly on top of #5569, #5871, and #5875 at HEAD without conflicts. Production and test diffs passed together; adjacent pixel-agent and pixel-settings checks remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

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.

1 participant