Repository navigation
feat(codewiki): graph tools on writing agents, remove additional paths CU-17tkuw66ma4 - #134
Conversation
…b's code-graph tools CodeWiki now parses only the repository it documents. Code that repository imports from another repository is looked up on demand by every writing agent through the Flamingo hub's code-graph tools (GET/POST /api/ci/code-documentation/tools, Bearer WEBHOOK_SECRET), served per repository and registered as pydantic_ai tools from the hub's own JSON schemas. A failed call is a ToolFailed result the model sees; no env or an unreadable list means no graph tools. The multi-path support is removed entirely: the --additional-paths option, Config.additional_source_paths, all_source_paths, is_multi_path_mode, the multi-repository parser, Node.is_from_deps, the test-multi-path fixtures, the example and the docs about them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦩 Flamingo Code Review✅ Tests and checks passed on this commit (1 lane). 3 findings: 🔴 0 action required · 🟠 0 recommended · 🔵 3 informational Advisory: findings do not block the merge. 3 defects outside any rule
🔵 Informational (3)
✅ What this change does well
Inline comments: 3 new 8 possible problems checked and ruled out
🧪 Tests and mutationChecks
No Python test lane is planned for this repository (only Trivy ran, and passed with no fixable HIGH or CRITICAL vulnerability); the tests were run by hand on this commit: 34 passed. The repository's .gitignore excludes tests/, so those tests are not part of the pull request. No mutation testing: no Python mutation tool is configured for this repository. End to end on the local replica: renovate ran every step on this commit (CodeWiki 5 modules, 0 failed, gpt-5.6-terra with caching); openframe-oss-frontend placed 1,077 of 1,077 components in 45 modules with 0 failures. What the surviving mutations leave unverified
🤖 Prompt for AI agents: fix every findingNext: commit a suggestion, or hand a comment's prompt to your coding agent. React 👍 on a finding that helped and 👎 on one that is wrong: the reviewer learns from both. Review again. New commits are not reviewed until you ask:
Or comment Updated 2026-11-13 21:03 UTC · reviewed from Michael Assraf's machine |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…merge them into the run's usage file Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s ecosystem facts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…one module-level logger in config Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…natively with caching; retry passing provider errors gpt-5.6-terra refused every tool call on chat completions, so each agent request fell back to Claude, sent through the OpenAI-compatible endpoint with no prompt caching. The agent model is now chosen by its provider's host: the Responses API on api.openai.com, the native Messages API with cache breakpoints on api.anthropic.com, chat completions elsewhere. SDK calls retry dropped connections, rate limits and 5xx, and a module whose run still fails on such an error is run again after 1 and 5 minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The clustering prompt told the model to leave out components that are not essential, and nothing checked what it left out: openframe-oss-frontend's run grouped 376 of 1,077 components, so two thirds of the repository were never documented. The prompts now ask for every component, and after each clustering call the components still left out are placed in an existing module, by the model in batches and then by the longest shared directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Read the code-graph tool list once in a worker thread before any agent is built, never on the event loop. - Placement IDs go through the shared normalizer, which logs each rejected ID; an unknown module name is logged too. - A retried module starts from the state its first attempt started with and does not run sub-modules a failed attempt already finished. - Every agent run goes through run_and_record, which records a failed attempt's tokens before raising, so a retry counts every attempt (failed_attempts in the stage 2 funnel). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lds out of what is documented A repository that ships its front end's libraries beside its own scripts had them clustered and documented as its own modules once every component was placed: on meshcentral most of the 143 modules, and both failures (a Chart.js tree of repeated names, and Font Awesome's 1.2M-token file no model can read). The file walk now leaves out, by FORM and LOCATION and never by a list of library names: - minified .js/.css files (average line over 110 characters, GitHub Linguist's rule); - files that open with a /*! library banner; - vendored folders (vendor, third_party, bower_components, ...). It logs what it left out and why. On meshcentral: 69 files and the vendored folder, 13 MB of 21.7 MB of script and style; on ten other repositories: nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ten never stops a run Writing the usage file could raise out of every model call (a read-only path, a full disk, a file that is not the expected object) and abort documentation for a report. Any such failure is now logged and the run carries on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng line; refuse --additional-paths with its reason - A file averaging over 110 characters a line is minified only if it also has fewer than 200 ordinary lines (non-empty, at most 110 characters), counted over the whole file: meshcentral's agents/meshcmd.js (2,673 ordinary lines plus one 268,000-character data line) is kept, every library still left out (the most any had was 33). - --additional-paths is refused with a message naming what replaced it (the hub's code-graph tools), instead of click's bare "no such option"; nothing is accepted or ignored. CHANGELOG.md records the breaking removal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ents or prompts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Set: feat-codewiki-reads-code-graph
Depends-On: https://github.com/flamingo-stack/multi-platform-hub/pull/1832
ClickUp task: CU-17tkuw66ma4 Code Documentation: CodeWiki reads other repositories through the code graph, not copied dependencies
Design-Doc: https://product-hub.flamingo.so/admin/design-docs/codewiki-reads-other-repositories-through-the-code-graph-not-copied-dependencies
Why
CodeWiki parsed the dependency repositories the Code Documentation workflow copied in through
--additional-paths, and documented them as the repository. One run had 20 own components against 16,827 copied ones, cost about $800 and was killed after six hours. CodeWiki now parses only the repository and looks other repositories up on demand.What
codewiki/src/be/agent_tools/code_graph.py:HUB_BASE_URL,WEBHOOK_SECRETandGITHUB_REPOSITORYset, it reads the hub's documentation toolset once per process (GET /api/ci/code-documentation/tools). It wraps each tool as a pydantic_aiTool.from_schemawith the served schema.ToolFailed, so the agent run continues.agent_orchestrator.py,generate_sub_module_documentations.py).SYSTEM_PROMPT/LEAF_SYSTEM_PROMPT: a new<OTHER_REPOSITORIES>section.resolve_code_imports,get_code_symbolandget_repo_ecosystem.--additional-pathsadditional_source_paths,all_source_pathsandis_multi_path_modeNode.is_from_depspydantic-ai>=2.16(forToolFailed),httpx>=0.27.str_replace_editor.pynow usessys.stdout.reconfigure. The oldTextIOWrapperreplacement closed pytest's capture stream.Tests
tests/test_code_graph.py: 13 passed. HTTP is mocked against the hub contract.codewiki generate --additional-paths xanswers "No such option".find_code_symbolsreturned a fenced answer, and bad arguments became a tool error.Merge order
After flamingo-stack/multi-platform-hub#1832 and the Setup Workflow re-push. An old installed workflow still passes
--additional-paths, which this version rejects.🤖 Generated with Claude Code
Change set
flamingo-stack/codewiki#134: these pull requests are one change, reviewed together.Linked work
Linked by the
Depends-On/Change-Setlines in these descriptions; this block is maintained by the hub.