Skip to content

Point fragments on a paged field to nodes - #114

Merged
joadan merged 1 commit into
mainfrom
agent-paged-fragments
Oct 15, 2026
Merged

joadan merged 1 commit into
mainfrom
agent-paged-fragments

Conversation

@joadan

@joadan joadan commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

From the second eval run: the agent wrote animals { ... on Spider { name } } and got "A fragment on Spider cannot apply to AnimalsConnection", which does not say what to do.

  • QueryValidator.FragmentType: a fragment on a connection's node type (or one of its possible types) now gets the paged-field fix: "This field is paged; put ... on Spider inside nodes { ... on Spider { ... } }".
  • Eval questions:
    • "What is the speed of each animal?" (expects Kalle 5, Imse 11). speed comes from a second interface, so it can only be read through fragments, and it can't be sorted on; "Which animal is the fastest?" was answered twice by sorting on legs, which happens to give the same animal.
    • "Which animal has the most legs?" became "What is the name of the animal with the most legs?"; "Spider, with 8 legs." is a fair answer to the old wording but fails the name check.

Eval against Foundry (gpt-5.4-mini) with the fix: the agent fixed the fragment error in one step in every run where it hit it. Tests: 297 passed, 0 warnings.

A fragment on the node type selected directly on a connection
(animals { ... on Spider { ... } }) got "A fragment on Spider cannot
apply to AnimalsConnection", which does not say what to do. It now gets
the same paged-field fix as a plain field.

Eval: ask for the speed of each animal (only answerable through the
fragments, unlike 'fastest', which sorting by legs answered by luck),
and ask for the animal's name rather than 'which animal'.
@joadan
joadan merged commit bd33f04 into main Oct 15, 2026
2 checks passed
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