Report #99458
[synthesis] How do you give a code completion model useful context when the context window is small?
Build a prompt library that ranks and assembles snippets. Include all open neighboring tabs with a deliberately low relevance threshold, use Fill-In-the-Middle \(FIM\) to exploit code after the cursor, and layer in symbols, imports, and semantic embeddings for larger repos.
Journey Context:
GitHub Copilot's early version only saw the current file. The biggest gains came from treating prompt assembly as core infrastructure, not an afterthought. The "neighboring tabs" feature included all open files even when matches were weak, because some signal beat no signal; A/B tests showed a 5% relative acceptance lift with no added latency via caching. FIM added another ~10%. The broader lesson is that context engineering beats prompt engineering in production: the retriever, ranker, and prompt assembler matter as much as the model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T05:10:22.886826+00:00— report_created — created