Skip to content

fix(visualization): preserve nodes with duplicate names - #4512

Merged
seratch merged 1 commit into
openai:mainfrom
tandede:agent/preserve-duplicate-graph-nodes
Aug 19, 2026
Merged

seratch merged 1 commit into
openai:mainfrom
tandede:agent/preserve-duplicate-graph-nodes

Conversation

@tandede

@tandede tandede commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request fixes graph visualization when distinct agents, tools, MCP servers, or handoffs share the same display name.

Graphviz node identifiers were previously derived directly from display names, so colliding names were merged into one node, could create self-loops, and caused same-name agents to be skipped during traversal. A per-render identity registry now assigns identifiers by entity identity, generates deterministic identifiers only for collisions and reserved virtual-node names, and preserves the existing DOT output for collision-free graphs.

The implementation also preserves traversal through live handoff() targets, honors caller-supplied visited names, and detects collisions after DOT escaping so CR, LF, and CRLF variants cannot collapse into one identifier.

Regression coverage includes cross-type name collisions, separate agents with the same name through both direct and handoff() branches, escaped-identifier collisions, caller-supplied visited names, and an agent whose name matches the virtual start node.

Test plan

  • pytest -q tests/test_visualization.py (19 passed)
  • .agents/skills/code-change-verification/scripts/run.sh (format, lint, type checking, and full tests passed)

Issue number

N/A

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass

@tandede
tandede force-pushed the agent/preserve-duplicate-graph-nodes branch from df4343b to a71b2a9 Compare August 19, 2026 11:59
@tandede
tandede marked this pull request as ready for review August 19, 2026 11:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a71b2a94f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/extensions/visualization.py Resolved
@tandede
tandede force-pushed the agent/preserve-duplicate-graph-nodes branch from a71b2a9 to a001cb4 Compare August 19, 2026 13:30
@seratch seratch added this to the 0.22.x milestone Aug 19, 2026
@seratch
seratch merged commit fe34ba3 into openai:main Aug 19, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants