fix(coding-agent): make rlm.find_models represent every provider and ignore word order - #855
Open
sashankh wants to merge 1 commit into
Open
Conversation
…ignore word order With no query every candidate scored 0, so ordering fell through to an alphabetical tiebreak on the selector before truncating to `limit`. With 155 models across 8 providers a bare `rlm.find_models()` returned 8 results from a single provider and nothing in the response marked it as a page, so an orienting agent could reasonably conclude the other providers were unreachable and route delegations through unnecessary shell-CLI fallbacks. Model matching also normalized the whole query into one string, so a reordered query such as "5.6 gpt sol" matched nothing while "gpt 5.6 sol" matched. - Round-robin ranked candidates by provider when the query is empty, so a bounded page reaches every provider instead of the alphabetical head of one - Return `total`, `truncated`, and per-provider match counts for the whole match set so a page cannot be mistaken for the full catalog - Score a multi-word query token-wise as a final tier, keeping exact, prefix, and partial ranking ahead of it, so word order no longer decides whether a model matches - Surface the page summary through the kernel bridge as `RLMModelPage`, a list subclass, so existing code that treats the result as a list is unaffected closes PrimeIntellect-ai#799 refs PrimeIntellect-ai#810
zhengr
pushed a commit
to zhengr/prime-agent
that referenced
this pull request
Aug 8, 2026
…rimeIntellect-ai#855) Add markdown.codeBlockIndent setting to customize indentation prefix for rendered code blocks. Default remains 2 spaces for visual clarity, but setting to empty string removes indentation for easier copy/paste of code snippets to scripts, editors, or other tools. Changes: - tui: add optional codeBlockIndent to MarkdownTheme interface - coding-agent: add MarkdownSettings with codeBlockIndent property - coding-agent: compose theme with settings at call sites (no global state) - coding-agent: update message components to accept optional MarkdownTheme Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With no query,
findRlmModelMatchesscored every candidate0, so ordering fell through to an alphabetical tiebreak on the selector before.slice(0, limit). With 155 models across 8 providers, a barerlm.find_models()returned 8 results from a single provider, and nothing in the return value marked it as a page.The failure mode is confident wrongness rather than an error. An orienting agent calls this bare as its first move before delegating, and can reasonably conclude the providers it cannot see are unreachable. Issue #799 records exactly that: an orchestrator routed three delegations through shell-CLI fallbacks that were unnecessary.
While in the same matcher, this also fixes the token-order half of #810: the query was normalized into a single string, so
"5.6 gpt sol"returned[]while"gpt 5.6 sol"matched. Theopenai-codexreachability half of #810 is out of scope here.Changes
total,truncated, and per-provider match counts for the whole match set, so a page cannot be mistaken for the full catalog.RLMModelPage, alistsubclass, so existing code that treats the result as a list keeps working whiletotal/truncated/providersare available.Non-empty-query ranking is otherwise unchanged.
Tests
New regression
packages/coding-agent/test/suite/regressions/799-find-models-provider-coverage.test.tscovers an unqualified page sampling every provider and reporting what it was cut from, a reordered query matching the same models as the original, and query ranking still taking precedence over provider coverage.Two pre-existing
ModuleNotFoundError: No module named 'mcp'errors in the Python runtime suite, and 4 pre-existing failures intest/resource-loader.test.ts, reproduce identically on unmodifiedorigin/mainand are unrelated to this change.closes #799
refs #810
Note
Fix
rlm.find_modelsto cover every provider and match query tokens in any orderfindRlmModelMatchesadds an order-independent token-matching tier after exact/prefix/partial ranking, so queries likegpt 4oand4o gptreturn the same results.find_modelsreturnsRLMModelPage(alistsubclass) withtotal,truncated, andprovidersmetadata instead of a plain list, in both Python (prime-agent-runtime) and TypeScript (rlm-runtime.ts).bootstrap.tsnow requiresRLMModelPageto be importable fromrlm.find_models/findRlmModelsthat expected a plain list or{ models }object now receive a richer result type with page metadata fields.Macroscope summarized cca59fd.