[xwiki-contrib/ai-llm] ff26a7: [Misc] SolrConnector must not close the platform's...
Branch: refs/heads/experimental Home: https://github.com/xwiki-contrib/ai-llm Commit: ff26a75a57316a36e50b556f361a219369118bed https://github.com/xwiki-contrib/ai-llm/commit/ff26a75a57316a36e50b556f361a2... Author: Paul Pantiru <[email protected]> Date: 2026-07-27 (Mon, 27 Jul 2026) Changed paths: M application-ai-llm-index/application-ai-llm-index-api/src/main/java/org/xwiki/contrib/llm/SolrConnector.java M application-ai-llm-index/application-ai-llm-index-api/src/test/java/org/xwiki/contrib/llm/SolrConnectorTest.java Log Message: ----------- [Misc] SolrConnector must not close the platform's shared Solr client * All nine Solr operations wrapped the client obtained from solr.getCore("aillm").getClient() in try-with-resources - but the platform caches ONE client per core for the instance lifetime and only closes it at dispose; no platform caller ever closes it * Works today only by accident of topology: the embedded EmbeddedSolrServer is constructed container-not-owned, so close() is a no-op. With solr.type=remote (the supported cluster topology, also valid single-node) the client is an HttpSolrClient whose close() destroys the shared connection pool - the first chunk operation would kill the cached client and every later store/delete/search fails until restart * Found by the cluster-readiness analysis of the index module (the rest came out clean: local listeners + instance-scoped TaskManager + shared core = exactly-once indexing, no duplicate embedding spend) * Fix: fetch the client into a local variable, never close (checked SolrException from getCore stays inside the existing catch at the catch-sites, declared at the no-catch sites); the test that pinned client.close() now pins never-close with the lifecycle rationale Commit: f4368817748663c20b36e97ff8e33823c90852b2 https://github.com/xwiki-contrib/ai-llm/commit/f4368817748663c20b36e97ff8e33... Author: Paul Pantiru <[email protected]> Date: 2026-07-27 (Mon, 27 Jul 2026) Changed paths: M application-ai-llm-mcp/application-ai-llm-mcp-api/src/main/java/org/xwiki/contrib/llm/mcp/MCPToolSupport.java M application-ai-llm-mcp/application-ai-llm-mcp-api/src/test/java/org/xwiki/contrib/llm/mcp/MCPToolSupportTest.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPEditDocumentTool.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteDocumentTool.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteObjectTool.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteSchemaTool.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteSupport.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/test/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPEditDocumentToolTest.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/test/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteDocumentToolTest.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/test/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteObjectToolTest.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/test/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteSchemaToolTest.java Log Message: ----------- LLMAI-165: Optional hidden flag on the four write tools * write_document, edit_document, write_object and write_schema accept an optional tri-state hidden boolean with the title convention: omitted leaves the flag untouched (an ordinary edit can never silently unhide a page), true/false applied in the same save, echoed only on an actual change (Marked hidden. / Marked visible.) * Born from live AWM testing: agents could build an app but not hide its Code space - class/sheet/template pages were all left visible. write_schema's man page now teaches the convention (class pages are technical pages, pass hidden=true) * Two platform gotchas baked into shared MCPWriteSupport helpers (hiddenChanged/applyHidden/hiddenLine/editableWithHidden), rationale in applyHidden's Javadoc: setHidden(false) clears the metadata-dirty flag (an unhide-only save would persist without a version bump), so the flag is forced back on - AWM's own defensive pattern; and api.Document.setHidden bypasses the wrapper's lazy clone (would mutate the store cache in place), so the flag is applied on an explicit XWikiDocument clone, which provably carries both the value and the dirty markers through later lazy re-clones. write/edit document clone conditionally - the hidden-omitted path is untouched * edit_document accepts a hidden-only call (guard message now offers edit, title or hidden) and its version comment gains ", marked hidden" / ", marked visible" * With locale the flag applies to the translation row being saved, matching the platform edit form and the Solr per-row hidden field * mcp-api: MCPToolSupport gains boolOrNull, the tri-state boolean accessor (bool coerces absent to false, which would have broken omitted-means-untouched) * Tests: four-quadrant tri-state suite per tool incl. the dirty-flag regression pin (hidden-only unhide must bump the version) and combined title+hidden echo-join pins; mcp-api 61, mcp-server 856, checkstyle 0, jacoco met. Live-validated post-redeploy: Solr exclusion/includeHidden, real-Hibernate version bump on unhide, omitted-stays-hidden, per-row fr/en translation split, single-save creation on all four tools Commit: de0ed4fe1806cd4f8a0205df887cad41967bab4a https://github.com/xwiki-contrib/ai-llm/commit/de0ed4fe1806cd4f8a0205df887ca... Author: Paul Pantiru <[email protected]> Date: 2026-07-27 (Mon, 27 Jul 2026) Changed paths: M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPManTool.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteSchemaTool.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/test/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPManToolTest.java Log Message: ----------- LLMAI-166: man reference page for application structure (AWM) * New man awm reference page teaching agents the AWM app shape and build recipe: the hidden Code space, sheet binding, a four-step core recipe, Create-dialog integration, the #livetable home page, the AWM-citizenship objects, and rights/limits. Grounded in the platform AWM generators * REFERENCE_PAGES switched Map.of -> sorted unmodifiable TreeMap: renderUnknown joins the key set into an agent-facing string, and Map.of iteration order is JVM-random * write_schema's man page cross-references man awm Commit: cd75fa880044d45445b5f33a99caab91900d569c https://github.com/xwiki-contrib/ai-llm/commit/cd75fa880044d45445b5f33a99caa... Author: Paul Pantiru <[email protected]> Date: 2026-07-27 (Mon, 27 Jul 2026) Changed paths: M application-ai-llm-mcp/application-ai-llm-mcp-api/src/main/java/org/xwiki/contrib/llm/mcp/MCPToolSupport.java M application-ai-llm-mcp/application-ai-llm-mcp-api/src/test/java/org/xwiki/contrib/llm/mcp/MCPToolSupportTest.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPEditDocumentTool.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteDocumentTool.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteObjectTool.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/main/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteSupport.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/test/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPEditDocumentToolTest.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/test/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteDocumentToolTest.java M application-ai-llm-mcp/application-ai-llm-mcp-server/src/test/java/org/xwiki/contrib/llm/mcp/internal/tool/MCPWriteObjectToolTest.java Log Message: ----------- [Misc] Close two write-tool gaps found in live app building * An explicit empty title now CLEARS the title on write_document, edit_document and write_object (echo: Title cleared.); omitted still means untouched. mcp-api gains stringOrEmpty, the accessor distinguishing an absent parameter from a present-but-empty one * write_object accepts an empty fields map: creates marker objects carrying only the class defaults; an update with no fields, no title and no hidden is refused as nothing-to-change; the class-defaults note is only echoed when the object was created * Shared titleLine helper in MCPWriteSupport replaces the three per-tool title echo blocks * mcp-api 65 tests, mcp-server 871, checkstyle 0, jacoco met Compare: https://github.com/xwiki-contrib/ai-llm/compare/62803e9fc97d...cd75fa880044 To unsubscribe from these emails, change your notification settings at https://github.com/xwiki-contrib/ai-llm/settings/notifications
participants (1)
-
XWiki Notifications