Skip to content

feat(autocomplete): Add Qwen multi-file FIM template for repository-level autocompletion#10612

Open
hiepau1231 wants to merge 1 commit intocontinuedev:mainfrom
hiepau1231:feature/qwen-multifile-fim-template
Open

feat(autocomplete): Add Qwen multi-file FIM template for repository-level autocompletion#10612
hiepau1231 wants to merge 1 commit intocontinuedev:mainfrom
hiepau1231:feature/qwen-multifile-fim-template

Conversation

@hiepau1231
Copy link

@hiepau1231 hiepau1231 commented Feb 18, 2026

Summary

  • Add qwenMultifileFimTemplate supporting repository-level autocompletion for Qwen models
  • Uses <|repo_name|>, <|file_sep|> tokens for multi-file context
  • Falls back to basic FIM when no snippets are provided
  • Resolves issue New Qwen FIM multi file template #3589

Changes

  • Added new qwenMultifileFimTemplate in core/autocomplete/templating/AutocompleteTemplate.ts
  • Updated getTemplateForModel to use the new template for Qwen Coder models

Description

This PR implements the Qwen multi-file FIM template as requested in issue #3589. The template supports:

  1. Repository-level context: When snippets are provided, includes repo name and file references
  2. File separation: Uses <|file_sep|> token to separate multiple file contents
  3. FIM tokens: Properly wraps prefix/suffix with <|fim_prefix|>, <|fim_suffix|>, <|fim_middle|> tokens
  4. Backward compatibility: Falls back to basic FIM when no snippets are available

The implementation follows the pattern established by codestralMultifileFimTemplate and is based on the code snippet provided in the issue.

Testing

  • Manual testing was performed by the issue author
  • The template should work with any Qwen Coder model (e.g., qwen2.5-coder)

Continue Tasks: ▶️ 2 queued · ▶️ 7 not started · ✅ 6 no changes — View all


Summary by cubic

Added a Qwen multi-file FIM template for repository-level autocompletion and set it as the default for Qwen Coder models. Falls back to basic FIM when no snippets are provided.

  • New Features
    • Includes repo name and multi-file contents using <|repo_name|> and <|file_sep|>; adds repository-level separator <|system_separator_istruction_repository_level|>.
    • Computes shortest unique relative paths for snippet file references.
    • Wraps prefix/suffix with <|fim_prefix|>, <|fim_suffix|>, <|fim_middle|>, placing them after the repository separator when present; adds stop sequences for FIM and repo tokens.

Written for commit a8ac197. Summary will update on new commits.

I have read the CLA Document and I hereby sign the CLA

@hiepau1231 hiepau1231 requested a review from a team as a code owner February 18, 2026 07:33
@hiepau1231 hiepau1231 requested review from sestinj and removed request for a team February 18, 2026 07:33
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 18, 2026
@github-actions
Copy link

github-actions bot commented Feb 18, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="core/autocomplete/templating/AutocompleteTemplate.ts">

<violation number="1" location="core/autocomplete/templating/AutocompleteTemplate.ts:102">
P1: `relativePaths[i]` returns an object `{ uri, uniquePath }`, not a string. Direct interpolation will emit `[object Object]` in the prompt instead of the file path. Extract the `uniquePath` property like other multi-file templates do (e.g., `relativePaths[i].uniquePath` or via a helper function).</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@hiepau1231 hiepau1231 force-pushed the feature/qwen-multifile-fim-template branch from 15a027e to 7122b0f Compare February 18, 2026 07:43
@hiepau1231
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

…evel autocompletion

- Add qwenMultifileFimTemplate supporting repository-level context
- Uses <|repo_name|>, <|file_sep|> tokens for multi-file context
- Falls back to basic FIM when no snippets provided
- Resolves issue continuedev#3589
@hiepau1231 hiepau1231 force-pushed the feature/qwen-multifile-fim-template branch from 7122b0f to a8ac197 Compare February 18, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant

Comments