docs: reorganize sidebar into a task-based reading order#107
Merged
Conversation
The docs sidebar was autogenerated with no explicit ordering, so pages fell back to alphabetical. That surfaced advanced "Admin" internals second and pushed Usage to the bottom, with an internal TypeScript "History Module" reference sitting among end-user pages. Reorder to follow install -> use -> configure -> extend -> develop: - Add sidebar_position frontmatter to every page and _category_.json to each folder (label + position + landing index). - Move Cost into Configuration (it pairs with API keys/pricing). - Move the History Module reference into a new "Developer API" group, out of the end-user flow. - Order Configuration as Overview -> Supported Services -> Cost -> Permissions -> Chat (Overview now leads, as its own text directs). - Add a new Agents page, filling a gap where Agents were referenced throughout (Glossary, Permissions, Tools, Context Providers) but never documented. No internal links pointed at the moved files, so nothing breaks. Content is otherwise unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy-edit pass across the docs plus three correctness fixes verified against the core PHP source: - Context Providers implement `\modAI\ContextProviders\ContextProviderInterface`, not `\modAI\Tools\ToolInterface` (the section was pasted from Tools). - Anthropic's per-service server-execution setting is `modai.api.anthropic.execute_on_server`; `claude` is not a valid service token (Anthropic::getServiceName() returns "anthropic"). - The "enable only for ChatGPT" example used the anthropic key; ChatGPT's service name is `openai`, so it's `modai.api.openai.execute_on_server`. Also removed a stray `}` from the setting format. Plus typo/grammar fixes: valide->valid, alway->always, tokes->tokens, controles->controls, Defaul->Default, "users groups"->"user groups", ever->every, "make sense"->"makes sense", subject-verb and missing-article fixes in Overview/Initialization, fragment cleanups in Tools/Chat, and Usage no longer claims modAI only uses the ChatGPT API. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
matdave
approved these changes
Jun 5, 2026
Fills the gaps between the docs and the codebase, all verified against core/components/modai source: - Chat: rewrite the page to cover the global chat assistant — opening it, text/image modes, DB-persisted history, pinning, public chats, search, clone, automatic titles (+ settings), agents/tools/context providers in chat, media-browser integration, and the permission model. - Tools: add a Built-in Tools reference (all 13 seeded tools), the clear_cache config, the ToolInterface signature, and an Availability note explaining the enabled/default/agent-attached rules. - Context Providers: document the built-in Pinecone provider (config reference, setup, integrated embedding + reranking retrieval, and auto-indexing via the modai.contexts.* settings), plus the accurate ContextProviderInterface signature. - Supported Services: add "Registering Custom Services" (modAIOnServiceRegister, the AIService interface, model-prefix resolution, AIResponse builder), fix the custom-service compatibility setting key, and note the OpenAI custom service supports text/vision/image/edit. - Overview: correct the stale default models/sizes/quality (gpt-5.5, gpt-5-nano, gpt-image-2, 1024x1024, auto), add base_output/context_prompt and the image media_source/path/download_domains settings, document the init.global_chat / init.media_browser / cache.lit settings, and add ImageCropper TV support. - Prompt Library: document the seeded Text/Image categories and the library's permissions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
A documentation overhaul for the
docs/site (Docusaurus). Three focused commits: a structural reorganization, a grammar/correctness pass, and a large content expansion that closes gaps between the docs and the actual codebase. All new content was verified againstcore/components/modai/source.Commits
1. Reorganize the sidebar into a task-based reading order (
ecc8e3c)The sidebar was autogenerated with no explicit ordering, so pages sorted alphabetically — advanced admin internals showed up second and Usage landed at the bottom.
sidebar_positionfrontmatter to every page and a_category_.json(label + position + landing page) to each folder.2. Fix typos, grammar, and incorrect setting names (
29f0ae0)Copy-edit pass plus three correctness fixes verified against the PHP source:
\modAI\ContextProviders\ContextProviderInterface, not\modAI\Tools\ToolInterface.modai.api.anthropic.execute_on_server(claudeis not a valid service token —Anthropic::getServiceName()returnsanthropic).openai. Also removed a stray}from the setting format.3. Document chat, built-in tools, Pinecone, custom services & more (
2e85527)Researched the implementation and wrote up the major undocumented surface area:
clear_cacheconfig, theToolInterfacesignature, and an Availability note (enabled vs. default vs. agent-attached).modai.contexts.*settings; plus the correctContextProviderInterface.modAIOnServiceRegister, theAIServiceinterface, model-prefix resolution, theAIResponsebuilder); fixed the custom-servicecompatibilitysetting key; noted the OpenAI custom service supports text/vision/image/edit.base_output/context_promptand the imagemedia_source/path/download_domainssettings, documentedinit.global_chat/init.media_browser/cache.lit, and added ImageCropper TV support.Verification
npm run build(production) passes with no broken links or anchor warnings.npm start) compiled cleanly throughout.Reading the built-in Tool classes to document them surfaced three genuine bugs. They are not addressed in this docs PR (and the docs intentionally describe correct/intended behavior, not the buggy behavior). Filing here for visibility; they should be fixed in a separate code PR.
Bug 1 —
namefilter searches by the wrong argument (get_chunks,get_templates)In the
namebranch, the WHERE clause is built from$arguments['query']instead of$arguments['name'].core/components/modai/src/Tools/GetChunks.php:86→['name' => $arguments['query']]core/components/modai/src/Tools/GetTemplates.php:86→['templatename' => $arguments['query']]Repro: invoke
get_chunkswith{"name": "myChunk"}and noquery. Theif (!empty($arguments['name']))branch fires, but the filter value is$arguments['query']— which is unset (null) — so it searches for a chunk literally namednulland returns nothing. Even if both are supplied, thenamevalue is ignored and thequeryvalue is used. Fix: use$arguments['name']in that branch.Bug 2 —
create_resourceJSON-Schemarequiredlist doesn't match its propertiescore/components/modai/src/Tools/CreateResource.php:53declares"required" => ["name", "description", "content"], but the itemproperties(lines 36–48) arepagetitle,template,parent,content. So the schema marks two non-existent properties (name,description) as required, while omittingtemplateandparent— which the tool body does enforce at runtime (CreateResource.php:102–107returns "parent is required" / "template is required").Repro: have an agent call
create_resource. The advertised schema tells the modelname/descriptionare required (they're ignored) and lets it legally omittemplate/parent. When the model omits them,runToolrejects the call with a runtime "required" error — a contradiction the schema should have prevented. Fix: set"required" => ["pagetitle", "template", "parent", "content"](or whichever subset is truly mandatory). Note:CreateChunkandCreateTemplateare correct — their properties genuinely arename/description/content.Bug 3 —
edit_chunkcache refresh is unreachable on successcore/components/modai/src/Tools/EditChunk.php:96–104:On a successful save the method returns before the
clearCacheblock, so the cache is never refreshed after a chunk edit (even thoughclear_cachedefaults to on); the refresh is only reachable on the failed-save path, where it does nothing useful.Repro: with
clear_cacheenabled (default), edit a cached chunk via the tool — the rendered output keeps serving the stale cached version until the cache is cleared another way. Fix: move theclearCacherefresh before the successreturn(mirroringEditTemplate, which has the correct order: it returns early only on failure, then refreshes, then returns success — soEditTemplateis not affected).🤖 Generated with Claude Code