Skip to content

feed.research named the tool and threw its papers away - #13

Merged
mgoldey merged 1 commit into
mainfrom
fix/research-answers-name-its-papers
Sep 18, 2026
Merged

mgoldey merged 1 commit into
mainfrom
fix/research-answers-name-its-papers

Conversation

@mgoldey

@mgoldey mgoldey commented Sep 18, 2026

Copy link
Copy Markdown
Owner

What

feed.ask routed a research question correctly, called feed.research, and then dropped its results. The reader got a count and an apology.

Measured from a live Discord session, 2026-09-18. Asked to "research orthogonalized mixtures of experts", the agent answered that it had "only a summary count rather than the specific details or titles". Asked for "the explicit corpus" it apologised; asked to "retrieve the full assets" it said it would need an ID first. It was not being evasive — _compose really did hand it nothing else.

Two causes, both in mcp/ask.py

1. papers was not in _RESULT_KEYS. The tuple listed items, which is what feed.list returns, but feed.research returns papers. So _summarise fell through to the bare message. This is the exact failure that tuple's own comment warns about:

A route whose result key is absent here degrades to a bare count, which is silent.

Same bug already fixed once for kg.path and kg.neighbors; it recurred on the next route added.

2. refs was built only from rows carrying item_id. A research hit is a library row and has no item_id, so every paper was filtered out and the reader was told about work it had no way to open. Papers now ride on the doi/arXiv id cite.lookup takes.

Before / after

Same payload through _compose:

before  answer: "3 paper(s) from arxiv, pubmed; 3 new in the library"
        refs:   []

after   answer: "3 paper(s) from arxiv, pubmed: Towards a Statistical
                 Understanding of Mixture-of-Experts; COEC: Calibrated
                 Orthogonal-Equivalence Compensation"
        refs:   [{paper_id: 2609.03501, url: https://arxiv.org/abs/2609.03501},
                 {paper_id: 2608.21142, url: https://arxiv.org/abs/2608.21142}]

For contrast, feed.list was always fine — it returns items.

Gates

Both gates that pushed back were right, and neither was worked around:

  • complexity refused the inline version (_compose at 14 against a limit of 10), so _refs is split out. The gate's call, not a preference.
  • size ratchet 379 → 383, with the reason recorded beside the entry.

All eight pass: ruff format, ruff check, ty, uv.lock, complexity, bandit, xenon, pytest (1863 passed).

Regression test is test_feed_research_answer_names_the_papers_and_carries_their_links, pinned the same way as the kg.ask one it rhymes with.

Not fixed here

That session's library holds 3 PubMed rows and zero arXiv, though every paper shown was arXiv: arXiv intermittently answers 406 to the research client. Retries of the identical URL succeed and curl succeeds, so it reads as throttling rather than a malformed request. Worth watching — if it persists, ArxivSearch wants retry-on-406 — but not worth building machinery against one afternoon's evidence.

🤖 Generated with Claude Code

MEASURED from a live Discord session 2026-09-18. Asked to "research
orthogonalized mixtures of experts", the agent routed correctly, called
feed.ask, and then told the reader it had "only a summary count rather than
the specific details or titles". Asked for "the explicit corpus" it
apologised; asked to "retrieve the full assets" it said it would need an ID
first. It was not being evasive -- `_compose` really did hand it nothing
else, and the reader spent ten minutes negotiating with a tool that already
had the answer.

Two causes, both in mcp/ask.py:

`_RESULT_KEYS` listed `items` but not `papers`, which is the key
feed.research returns, so `_summarise` fell through to the bare message --
"3 paper(s) from arxiv, pubmed; 3 new in the library". That is the exact
failure `_RESULT_KEYS`'s own comment warns about ("a route whose result key
is absent here degrades to a bare count, which is silent") and the same one
already fixed once for kg.path and kg.neighbors.

`refs` was built only from rows carrying `item_id`. A research hit is a
library row and has no item_id, so every paper was filtered out and the
reader was told about work it had no way to open. Papers now ride on the
doi/arXiv id cite.lookup takes.

`_refs` is split out of `_compose` because the complexity gate refused the
inline version at 14 against a limit of 10 -- the gate's call, not a
preference. ask.py's size cap goes 379 -> 383 with the reason recorded
beside it.

Not fixed here, and not a code defect: arXiv intermittently answers 406 to
the research client, which is why that session's library holds three PubMed
rows and no arXiv ones. Retries of the identical URL succeed, so it reads as
throttling rather than a malformed request.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mgoldey
mgoldey merged commit f3cb03f into main Sep 18, 2026
7 checks passed
@mgoldey
mgoldey deleted the fix/research-answers-name-its-papers branch September 18, 2026 19:52
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