mirror of
https://github.com/volcengine/OpenViking.git
synced 2026-10-01 01:38:07 +08:00
Directory L1 overviews previously fed the model bare `[N]` file indices and `[N] filename: summary` source lines, then post-processed by replacing `[N]` with the entry filename. Because the model naturally copied the filename next to the index (e.g. `### [1] filename` or `→ [1] filename`), the substitution produced duplicated headings like `### filename filename` in both Quick Navigation and Detailed Description sections. Replace the index-reference scheme with collision-free link placeholders: - Feed each entry a compact placeholder `(link: viking://input_sample_fN)` for files and `viking://input_sample_cN` for subdirectories, and instruct the model to emit standard Markdown links `[display title](placeholder)`. - Resolve placeholders back to real `viking://` URIs (built from `dir_uri + "/" + name`) in post-processing via `_replace_link_references`, replacing the old `_replace_index_references`. - Apply consistently across the single, truncated, and batched generation paths; batched partials resolve placeholders before merge so the merge step needs no further substitution. This eliminates the duplicated-heading class of bugs entirely (bare `[N]` collisions are far less likely than reused digits) and yields clickable, accurate resource links in the generated overview, matching the Markdown link convention already used elsewhere (session memory extraction). Co-authored-by: Maojia Sheng <shengmaojia@bytedance.com> Co-authored-by: TRAE CLI <traecli@bytedance.com>