Files
OpenViking/openviking/prompts
8ab07b1e4c fix(semantic): use Markdown links instead of [N] indices in L1 overview (#4251)
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>
2026-08-24 17:50:33 +08:00
..