Skip to content

fix(truncate): correct cycle layer assignment and hide __start__/__end__ labels#14

Merged
cristipufu merged 1 commit intomainfrom
fix/truncate-cycle-and-type-label
Feb 15, 2026
Merged

fix(truncate): correct cycle layer assignment and hide __start__/__end__ labels#14
cristipufu merged 1 commit intomainfrom
fix/truncate-cycle-and-type-label

Conversation

@cristipufu
Copy link
Member

Summary

  • Fix truncate_graph() cycle handling: modified Kahn's algorithm force-processes the highest-layer unprocessed node when topo sort stalls on cycles, and skips layer updates for already-processed nodes to prevent back-edge inflation (e.g. deep-agent sample now renders fully with -d 5 -b 2)
  • Fix _type_label() to check node.name in addition to node.type against hidden labels, so __start__/__end__ nodes with type="node" no longer show a spurious "node" border label
  • Bump to v0.1.8 and regenerate screenshots

Test plan

  • 102 tests pass (added test_cyclic_graph_no_truncation and test_longest_path_reconverging)
  • uv run graphtty samples/deep-agent/graph.json -d 5 -b 2 renders all 7 nodes
  • uv run graphtty samples/supervisor-agent/graph.json__start__ no longer shows "node" label
  • Ruff format/lint clean, ty type check clean

🤖 Generated with Claude Code

…start__/__end__ type labels

- Fix truncate_graph cycle handling: use modified Kahn's algorithm that
  force-processes the highest-layer unprocessed node when topo sort stalls
  on cycles, and skip layer updates for already-processed nodes to prevent
  back-edge inflation
- Fix _type_label to check node.name (not just node.type) against hidden
  labels, so __start__/__end__ nodes with type="node" are correctly hidden
- Bump to v0.1.8 and regenerate screenshots

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cristipufu cristipufu merged commit 76ad0ac into main Feb 15, 2026
7 checks passed
@cristipufu cristipufu deleted the fix/truncate-cycle-and-type-label branch February 15, 2026 12:46
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