AgentFilesPlugin writes md files to frontend_path subdir#6536
Conversation
This change is required because the build step that moves top-level dirs into the frontend_path subdir of the output directory uses `overwrite=True` by default. So any same-named directories in the output root silently overwrite the existing pre-rendered HTML files in the basename dir. When the plugin just writes the markdown files into the basename dir itself, then there is no mv step that blows them away.
Greptile SummaryThis PR fixes a bug where
Confidence Score: 5/5The change is a narrow, targeted fix confined to a single method in one file, with correct logic for both the default and the frontend_path cases. The fix correctly prepends the stripped frontend_path to the public root, ensuring markdown files land at the same URL they are referenced under in llms.txt. When frontend_path is empty the existing behavior is preserved. The only observation is that two local re-imports of get_config become redundant after the new top-level import, but this does not affect runtime behaviour. docs/app/agent_files/_plugin.py — the redundant local imports in _llms_url_for_path and _docs_home_url are a minor cleanup opportunity. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[get_static_assets called] --> B{frontend_path configured?}
B -->|No| C[root = public]
B -->|Yes| D[root = public/frontend_path]
C --> E[Files written to public/url_path]
D --> F[Files written to public/frontend_path/url_path]
E --> G[Build step post-processes output]
F --> G
G --> H[Old: public dir at root moved to output/frontend_path]
G --> I[New: files already under frontend_path subdir]
H --> J[Overwrites pre-rendered HTML - BUG]
I --> K[No collision with HTML - FIXED]
|
This change is required because the build step that moves top-level dirs into the frontend_path subdir of the output directory uses
overwrite=Trueby default. So any same-named directories in the output root silently overwrite the existing pre-rendered HTML files in the basename dir.When the plugin just writes the markdown files into the basename dir itself, then there is no mv step that blows them away.