Skip to content

fix(core): a model pool whose matching keys select no models disappears with no diagnostic (PR #233) #238

Open

Description

@dezren39

Finding

PR #233 (#233, head d92970d) adds pattern-based pool membership (include / contains / match) and, commendably, a diagnostic for almost every other way a pool setting can be silently dropped: a malformed pattern skips the pool with a diagnostic, an unknown key is reported as "omitted unknown setting", a bad schedule leaves a config warning, a declared level no model can run is logged, and a pool pinned at a level it does not declare "adds nothing, and says so".

One silent drop is left: a pool whose matching keys select no models at all produces no diagnostic.

  • In expand() (packages/core/src/config/plugin/model-routes.ts:537-556 on the PR branch), the selects loop simply places nothing when no catalog entry passes the predicate (typo'd pattern, a provider that is not connected, an exclude/notContains that removes everything the include matched). No entry is added to diagnostics — contrast the diagnostics pushed at lines 344, 390 and 425 for the level/pin/unknown-pool cases.
  • The transforms then erase the pool without a word: the model transform does if (leaves.length === 0) return editor.remove(ModelRoute.PROVIDER_ID, id) (line 141), and a pool that also has targets keeps its targets while its include/contains/match silently adds nothing.

So a one-character typo (*luno* for *luna*), or a provider that failed to connect, makes a pool vanish from the picker — or quietly run without the models its author intended — with nothing in the log, in exactly the way this PR set out to eliminate for schedules and unknown keys.

Evidence

  • PR: feat(core): pick pool members by pattern and control effort per level #233, head d92970ddfb42e48cf390c2ef78d931a2dc63619a (OPEN at time of filing).
  • packages/core/src/config/plugin/model-routes.ts:537-556 — the selects loop in collect(); no diagnostic on zero placements.
  • packages/core/src/config/plugin/model-routes.ts:141 — model transform removes an empty pool silently; line 102 does the same in the provider transform.
  • The PR's own tests pin diagnostics for the neighbouring cases and none for this one: packages/core/test/model-routes-matching.test.ts expects "pool small declares level ultra, but none of its models can run it, so it is not offered" and "pool low-only is pinned at level max, which it does not declare, so it adds nothing", but no test expands a pool whose include/contains/match selects nothing and asserts what is reported.
  • Deduped: no open or closed issue in this repo mentions a diagnostic for a pool matching no models (searched "pool matched no models", "include matches nothing", "model route diagnostic"). The two follow-ups the PR body already filed, Model pools cannot reach models that a model transform creates, such as Azure deployments #236 (transform-created models) and Should a pinned nested pool run its members through their level remaps? #237 (pinned nested pool remaps), are different findings.

Why it matters

Pattern pools are the PR's headline feature, and their failure mode is otherwise invisible: the pool is absent (or smaller than configured) and the only symptom is a model the user expected never being offered. The PR establishes the principle that a routing setting must never be dropped without a word; this is the remaining place that principle is not applied.

Acceptance criteria

  • When a pool's matching keys (include / contains / match, after exclude / notContains) add no models during expansion, a model-route diagnostic naming the pool (and ideally which key(s) selected nothing) is emitted through the existing report() path in packages/core/src/config/plugin/model-routes.ts, so it is logged once while it lasts and again if it recurs after clearing.
  • A pool that has targets and whose matching keys add nothing is also diagnosed (the pool surviving on its targets must not hide the dead key).
  • New tests in packages/core/test/model-routes-matching.test.ts (or the expand tests) cover: an include pattern that matches nothing, a match expression that selects nothing, and an exclude that empties an otherwise-matching include — each asserting the diagnostic; and a matching pool that selects at least one model asserts no such diagnostic.
  • Fix in PR feat(core): pick pool members by pattern and control effort per level #233 itself or in a follow-up referencing this issue; either is acceptable, but the behaviour should not ship silently.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    source/humanFiled directly by a human
    priority/normalOrdinary priority (the default)
    effort/sSmall: expected under 2 hours of work
    app/corePackage: core (pkgs/ or apps/ in this repo)
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 26, 2026
  2. dezren39 commented on Oct 26, 2026

    @dezren39
    Author

    Intake review

  3. added
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/claimedA queue worker has claimed the task for this item
    and removed on Oct 28, 2026
  4. dezren39 commented on Oct 28, 2026

    @dezren39
    Author

    🤖 Agent note · done

    Evidence (fresh GitHub reads, 2026-10-28):

    Route: scoped follow-up enqueued as queue task 2705 (small_fix, dedupe repo-health:v1:fix:developing-today/opencode:issue:238), explicitly gated: if PR #233 is still open at claim time, park — do not edit PR #233's branch and do not open a competing PR; once it merges, count selects-loop placements in expand(), push a diagnostic naming the pool when matching keys place zero (including pools kept alive by targets), through the existing report() path, with tests for include-matches-nothing, match-selects-nothing, exclude-empties-include, and a positive no-diagnostic case. The issue stays open; this triage task completes as triaged.

  5. 84 remaining items

  6. added
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 5, 2026
  7. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    🤖 Agent note · claimed

  8. dezren39 commented on Nov 5, 2026

    @dezren39
    Author

    🤖 Agent note · parked

  9. added
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedAn agent holds this item via the queue (claimed task)
    on Nov 5, 2026
  10. developing-today commented on Nov 5, 2026

    @developing-today

    Gate revalidation (task 2705, lane opencode-a, 2026-11-05): PR #233 is still OPEN and unmerged (head routing-docs-and-diagnostics), verified fresh via the GitHub API this shift. The selects/diagnostics code this fix targets therefore still lives only on that branch, not on main.

    Task 2705 is PARKED (not_before 2026-11-06T20:45:00Z) until PR #233 merges — per the packet, no edits to PR #233's branch and no competing PR off main. On merge, the fix proceeds as specified: zero-placement diagnostic for the selects (include/contains/match) loop in expand(), via the existing diagnostics/report() path, with tests.

    Parked by: lane opencode-a, task 2705 — gate PR #233 still open

  11. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    and removed
    queue/claimedA queue worker has claimed the task for this item
    on Nov 5, 2026
  12. dezren39 commented on Nov 8, 2026

    @dezren39
    Author

    🤖 Agent note · parked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/corePackage: core (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)queue/parkedQueue task is parked (waiting on CI, time, or an event)source/humanFiled directly by a humanstatus/in-progressActively being workedtask/small-fixQueue packet kind: bounded fix with reproduction and targeted testswork/assignedAn agent holds this item via the queue (claimed task)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions