Skip to content

fix(endpoint): remove stray page-header JSX spliced into renderModelGroup - #11366

Closed
echel0nn wants to merge 8 commits into
diegosouzapw:release/v3.8.50from
echel0nn:fix/endpoint-page-header-splice
Closed

echel0nn wants to merge 8 commits into
diegosouzapw:release/v3.8.50from
echel0nn:fix/endpoint-page-header-splice

Conversation

@echel0nn

Copy link
Copy Markdown
Contributor

Problem

next build aborts on the /dashboard/endpoint route:

src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx
Error: Unterminated regexp literal

Commit 65e8115 ("fix(ollama): route models by advertised capability", #11088) spliced a block of endpoint page header markup (endpoint.title, endpoint.subtitle, base URL, endpoint.advancedProtocols) into the middle of the ProviderModelsModal renderModelGroup .map() callback. The injected <div className="flex flex-col gap-4"> wrapper is never closed, so the JSX is unbalanced. Turbopack reports it as "Unterminated regexp literal" and the production build fails.

The dev server compiles routes on demand, so the break stays invisible until the endpoint route is compiled or next build runs over every route.

Fix

Restore the renderModelGroup map callback to return only the model row, matching the clean state in v3.8.49 (c9d4a45f1). Net change: 1 insertion, 13 deletions.

Verification

  • esbuild EndpointPageClient.tsx parses cleanly (hard parse error before).
  • The keys endpoint.title / endpoint.subtitle / endpoint.advancedProtocols / endpoint.testEndpoint appear nowhere else in the file and did not exist in v3.8.49, confirming the injected block was spurious.

diegosouzapw and others added 8 commits August 8, 2026 00:08
…ouzapw#189, diegosouzapw#190)

Bumps: nanoid ^3.3.17 (was transitive, now overridden), dompurify ^3.4.13
(with monaco-editor scoped override). Closes Dependabot diegosouzapw#189, diegosouzapw#190.

Remaining diegosouzapw#182-diegosouzapw#188 (js-yaml + mermaid) already closed by diegosouzapw#9651 merge —
awaiting Dependabot re-scan.

npm audit → 0 vulnerabilities.
…egosouzapw#190

Closes Dependabot diegosouzapw#189 (dompurify 3.4.13) and diegosouzapw#190 (nanoid 3.3.17). npm audit → 0.
_tasks is a SEPARATE nested git repo (gitignored). The pattern _tasks/ (trailing
slash) ignores only a directory, not a SYMLINK named _tasks. A self-referential
_tasks symlink can slip in via git add -A and, once pulled, checkout materializes
it over the real _tasks repo (destroying plans/specs/hands-off). Anchored /_tasks
ignores the symlink too, preventing re-capture.
…pw#10026)

Mirror the request-time exclusion rule (provider_specific_data.excludedModels)
in the unified catalog builder: a model is hidden when its provider has
connections but none of them is eligible for it. Applied across the
PROVIDER_MODELS, synced, custom, alias-backed, and managed-fallback loops
so ghost models no longer appear as available.

Co-authored-by: ritheshcn25 <ritheshcn25@users.noreply.github.com>
…osouzapw#10055)

* fix(models): memoize getModelsDevPricing for /v1/models catalog

resolveCatalogPricing called getModelsDevPricing once per model while
building GET /v1/models. Each call re-scanned models_dev_pricing and
JSON.parsed every row (~10k SQL scans + multi-GB parse work), pegging
the event loop so even /healthz timed out (diegosouzapw#9685, diegosouzapw#10052).

Memoize the parsed map until saveModelsDevPricing / clearModelsDevPricing
and add a unit test for invalidation.

Signed-off-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>

* fix(db): invalidate modelsDevPricing cache on DB reset (diegosouzapw#10055)

Copilot review fixes:
1. Register invalidateModelsDevPricingCache() with DB state reset system
   so resetDbInstance() clears the process-local memo, preventing stale
   pricing data from surviving across DB reset/restore operations.
2. Add test assertion verifying DB reset bypasses the memo (Copilot diegosouzapw#10055).

The process-local memo at modelsDevSync.ts:204 caches getModelsDevPricing()
results until saveModelsDevPricing()/clearModelsDevPricing() to avoid
re-scanning all pricing rows on every /v1/models request. Without this hook,
backup restore and test DB resets would serve stale cached data from the
previous connection.

Tests: npm run test:unit:serial -- tests/unit/modelsDevSync-extended.test.ts

---------

Signed-off-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>
Co-authored-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
⭐5 — Fornecedores locais compartilhados (ollama-local, LM Studio, vLLM) declaram passthroughModels:true no registry, mas hasPerModelQuota() não consultava o registry compartilhado — fallha de modelo faltante virava cooldown de conexão inteira. Broadens a classificação de model-lockout. TDD + 78/291 testes + typecheck + lint verdes. Fecha diegosouzapw#11071.
Landed with the design call resolved per the owner's pick — **option 1**: the synced store is now endpoint-agnostic (persistDiscoveredModels and managedModelImport no longer drop non-chat models at write time), and chat selectability moved to read time (auto-pool expansion in autoStrategy applies filterChatSelectableModels; the models-route projection already had its chatOnly filter). Your discovery test now passes end-to-end (3/3): /api/show capabilities persist per connection and image/embedding requests route through the advertising host.

Reconciliation notes: conflicted areas merged onto the current tip (adobe discovery import, requestedModel preflight signature, resolvedProvider fast-path coexists with the synced-route override — explicit resolution wins); carried base-red drains (diegosouzapw#10055 memoization, diegosouzapw#11071 test variants) dropped as already-landed; the managed-model-import exclusion test was propagated to the new contract (image/video models persist; the read filter still hides them from chat pickers — pinned by a new assertion). Full battery: 205/206 focused (the one red is a confirmed periodic-timer timing flake on the loaded devbox — 20/20 isolated), autoCombo vitest 30/30, combo suites 46/46, gates + typecheck clean.

Thank you @yourspraveen — the capability probe + routing design was right; it just needed the store contract opened up. Fixes diegosouzapw#11087.
…roup

Commit 65e8115 spliced a block of endpoint page header markup (title,
subtitle, base URL, advancedProtocols) into the middle of the
ProviderModelsModal renderModelGroup map callback. The extra
`<div className="flex flex-col gap-4">` wrapper is never closed, leaving
unbalanced JSX that Turbopack reports as "Unterminated regexp literal"
and that aborts `next build` on the /dashboard/endpoint route.

Restore the map callback to return only the model row, matching the
clean state in v3.8.49 (c9d4a45).
@echel0nn
echel0nn requested a review from diegosouzapw as a code owner August 24, 2026 08:21
@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.50 August 24, 2026 14:36
@diegosouzapw

Copy link
Copy Markdown
Owner

Verified subsumed: cherry-picked your fix commit (36f8839a) directly against the current release/v3.8.50 tip and it applied as a clean no-op (nothing to commit, working tree clean) — the exact bug you diagnosed (stray page-header JSX spliced into renderModelGroup's .map() callback by #11088) has already been fixed by a subsequent, unrelated change to EndpointPageClient.tsx already on the release branch. Your diagnosis of the root cause was correct and matched. Closing as already covered — thanks for the catch!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants