Skip to content

A linked-pair request can now end with both types created but unlinked #2839

Closed

Description

@malibio

Summary

Relaxing the second-create_schema guard (PR #2818) makes a new end state reachable: the user asks for a linked pair, both types get created, and the relationship is never declared — two types, no edge, no error.

Why it is reachable now

The old guard refused any second create_schema in a turn, so "two types created" could not happen at all. It has been narrowed to refuse only types the user never named, which is what lets a legitimately-requested pair be created as two sequential calls.

The dangling-reference half is still fully covered: validate_relationship_targets_exist (packages/core/src/schema/mod.rs:375) rejects a relationship whose targetType does not exist. But targetType: None is deliberately unvalidated (mod.rs:402) — a relationship-free schema is legitimate on its own — so nothing notices when both halves of a requested pair land without one.

Why this was not fixed in that PR

The old guard did not really prevent this state so much as convert it into a strictly worse one: against a two-type request it silently delivered one type. Trading that for two-unlinked-types is an improvement, not a regression, so the relaxation stands on its own.

Closing it properly means tracking relationship materialization across a turn — knowing that a request was for a linked pair, and checking at turn end that an edge exists between them. That is a feature with its own design, not a line in a prose-fix PR.

Possible direction

At turn end, if more than one schema was created in the turn and no relationship connects any of them, surface it — either as a warning back to the model so it can add the relationship with add_schema_relationship, or as a note in the user-facing summary. Needs its own investigation; the detection signal ("was a linked pair asked for?") is the hard part, since it lives in the user's phrasing rather than in the tool calls.

Found via

Re-review of PR #2818.

Activity

  1. self-assigned this
    on Sep 23, 2026
  2. mstomar125 commented on Sep 23, 2026

    @mstomar125
    Contributor

    Frontend: 5264 passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions