Repository navigation
Teach the real relationship_type parameter name (core#2200) - #2362
Conversation
The Relationship Management and Organization skill guidance instructed the model to pass relation_type at three call sites (creating a relationship, filtering get_related_nodes results, and adding a node to a collection), but create_relationship/get_related_nodes both require relationship_type and reject unknown fields via #[serde(deny_unknown_fields)] with no alias. A small local model, which reliably copies shapes it's shown, would follow the guidance verbatim and get rejected outright -- an error burns an iteration, and if the model trusts what it was just taught, the one permitted retry repeats the same wrong name and the turn fails. Fixed the guidance text at all three call sites to say relationship_type, matching what the tools actually require. Also added #[serde(alias = "relation_type")] to both CreateRelationshipParams and GetRelatedNodesParams, mirroring the existing node_id/id alias already on GetRelatedNodesParams for the analogous split. This is a defensive backstop, not the primary fix -- even with the corrected guidance, relation_type is arguably the more common general-knowledge-graph term, so a model could still drift toward it independent of what it was just shown. Added 5 tests: two confirming the alias accepts relation_type for both param structs (existing rejects_unknown_field tests already cover other wrong names and are unaffected), and a guidance-text regression test that cross-checks the seeded skill text against create_relationship's own required-parameters list -- mirroring the existing both_surfaces_agree_on_the_undeclared_key_rule pattern for Node Creation, so a future reword of either side that reintroduces the mismatch fails here instead of in an eval. Verified the guidance-text test via mutation testing: reverted one occurrence back to relation_type, confirmed the test failed, restored it, confirmed it passed. Left the ablation eval golden fixtures (packages/agent/goldens/) that also predate this fix untouched -- confirmed via grep that no test reads them; they're frozen historical snapshots for an unrelated ablation study, out of scope for this issue. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Code Review SummaryNet positive, correctly scoped, and well-verified fix for core#2200. The guidance-text correction is the primary fix and is complete and accurate at all three call sites. The added FindingsCritical Issues
Suggested Improvements
Nitpicks
Verification performed
Recommendation: REQUEST CHANGES |
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: REQUEST CHANGES (posted as a comment — GitHub blocks self-approval). Blocker: 4 doc/line comments embed the issue number (core#2200) directly in code, which this repo's CLAUDE.md documentation standard explicitly prohibits (two prior PRs this session were already sent back for the same violation). Everything else — the guidance-text fix itself, the serde alias backstop, and the new tests — is sound and independently verified. Full findings in the review comment above.
This repo's documentation standard prohibits embedding GitHub issue numbers in code comments -- four new comments violated this. Reworded all four to describe the fix's reasoning without the issue number. Addresses reviewer recommendations from PR #2362 review. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Address Review SummaryResponse to the pragmatic code review (REQUEST CHANGES, posted here). ✅ Addressed (the blocking finding):
⏭️ Acknowledged, no action needed (non-blocking):
🧪 Tests: 📝 Commit: 003fcb3 Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: Comment-only change, no logic touched. The fix's mechanism (guidance-text correction + defensive alias) was already reviewed and assessed as sound and proportionately scoped. The PR is ready for merge. |
Summary
Test plan
Closes #2200
🤖 Generated with Claude Code