Files
openproject-mcp/tests
Lucas WintherandClaude Opus 5 fa05fcc1c6 fix(wikis): judge discovery completion on cache growth, not absolute size
The completion guard added in a8d3c23 read `cacheMap.size > 0`, but
`cacheMap` is the tenant-wide map that `getWikiPage` also writes to on
every single-page fetch. One prior `openproject_get_wiki_page` call on
the same cache key therefore leaves the map non-empty before the probe
loop issues its first request, and a scan in which every probe fails
with a 500 inherits that entry and marks itself discovery-complete
anyway — permanently, for the process lifetime.

"Get a wiki page, then search" is an ordinary LLM tool sequence, so the
contaminated path is likely rather than exotic, and it lands back in
exactly the failure this branch exists to eliminate: wiki search returns
[] forever and the model tells the user their pages do not exist.

Completion is now judged on growth during the scan (`cacheMap.size >
cachedBefore`), captured before the probe loop. The cold-cache
behaviour is unchanged, since `cachedBefore` is then 0 and the condition
is equivalent — both existing F5b tests stay green.

A permanently-failing instance now re-probes on every search. That is
the accepted cost of retrying rather than caching a lie.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-24 09:38:30 +02:00
..