Problem
extractContextCandidates only accepts identifier-shaped tokens (snake_case, 3-8 char acronyms, camelCase with a lower→upper transition, quoted strings). A natural-language task like fix search ranking — the documented input shape for codedb_context ('Takes a natural-language task…') — produces zero candidates and the handler dead-ends with no candidate identifiers found. Found in both audit rounds (2026-06-10): every all-lowercase task tried ("fix search ranking", "add lazy symbol index loading…", "implement path glob starvation fix…") returned the error.
Failing Test
test "issue-570: codedb_context falls back to plain words for all-lowercase tasks" in src/test_mcp.zig (branch fix/issue-570-context-fallback): task fix search ranking must not emit no candidate identifiers and must use 'ranking' as a keyword. Verified failing on release/0.2.5825: 106/107.
Expected
When zero identifier-shaped tokens exist, fall back to the task's plain words — longest first (longer = more specific), common glue/generic words dropped — so the composer orients instead of erroring. The error remains only when even the fallback finds nothing.
Fix
Add extractContextFallbackWords (words ≥4 chars, stopword-filtered, sorted longest-first, capped at CONTEXT_MAX_CANDIDATES) invoked in handleContext when the identifier pass returns empty.
Problem
extractContextCandidatesonly accepts identifier-shaped tokens (snake_case, 3-8 char acronyms, camelCase with a lower→upper transition, quoted strings). A natural-language task likefix search ranking— the documented input shape for codedb_context ('Takes a natural-language task…') — produces zero candidates and the handler dead-ends withno candidate identifiers found. Found in both audit rounds (2026-06-10): every all-lowercase task tried ("fix search ranking", "add lazy symbol index loading…", "implement path glob starvation fix…") returned the error.Failing Test
test "issue-570: codedb_context falls back to plain words for all-lowercase tasks"insrc/test_mcp.zig(branchfix/issue-570-context-fallback): taskfix search rankingmust not emitno candidate identifiersand must use 'ranking' as a keyword. Verified failing on release/0.2.5825: 106/107.Expected
When zero identifier-shaped tokens exist, fall back to the task's plain words — longest first (longer = more specific), common glue/generic words dropped — so the composer orients instead of erroring. The error remains only when even the fallback finds nothing.
Fix
Add
extractContextFallbackWords(words ≥4 chars, stopword-filtered, sorted longest-first, capped at CONTEXT_MAX_CANDIDATES) invoked inhandleContextwhen the identifier pass returns empty.