Skip to content

WIP: restore custom completion and embedding endpoints#5

Draft
JegernOUTT wants to merge 25 commits into
mainfrom
feature/completion_emb_revival
Draft

WIP: restore custom completion and embedding endpoints#5
JegernOUTT wants to merge 25 commits into
mainfrom
feature/completion_emb_revival

Conversation

@JegernOUTT

Copy link
Copy Markdown
Owner

Summary

WIP task-planner implementation for restoring custom completion and embedding endpoint support.

Current included cards:

  • T-1: endpoint-style taxonomy and role contract foundations
  • T-3: capability-aware CustomProvider runtime

Planned follow-up cards will continue landing on this branch:

  • backend caps/default selection
  • provider HTTP/API roundtrip
  • completion and embedding adapters
  • GUI role-separated config/defaults
  • mock-server coverage and final compatibility sweep

Verification so far

  • cargo test -p refact-core provider_types
  • cargo test -p refact-core llm_types
  • cargo test -p refact-caps-core provider_config
  • cargo test -p refact-caps-core model_records
  • cargo test -p refact-providers custom
  • cargo test -p refact-providers instance

Notes

Draft/WIP PR. More commits will be pushed as task cards complete.

JegernOUTT and others added 23 commits June 7, 2026 16:15
(cherry picked from commit 9d96a053966165f1b1bc1f750f85e7b1e3074575)
(cherry picked from commit 2cc1ef0477462d23ae85b7a35266dfdf572963ed)
(cherry picked from commit 4aa8b6ef4243d54eb410f733b8780e51598688f0)
(cherry picked from commit e8b25ebb47d73194cfcf09eba06c73658f63687d)
(cherry picked from commit 9d17273d0012c828c667c5924986be6d11724caa)
…ps on config changes

(cherry picked from commit 19284803f3dda4a68a895233629ad10b426dff69)
…llback keys

(cherry picked from commit 48de09e9639f2ae9a67eb5aa2d4de7a50c5fd7c6)
(cherry picked from commit 59a9ccd214c83e9a139c8bacbbb944408be138a4)
(cherry picked from commit 66cced94e39bc9d1c24942b54d230a8c62675423)
(cherry picked from commit 62e647a8c3ee165557dc00e2a1fb5865ce01a3b1)
(cherry picked from commit 8998892b52e7cfd7b1b73424ea211a5fb96ac7cf)
(cherry picked from commit 17b85dafff77bc7552603214c4c7644006ce0280)
(cherry picked from commit 9693f1a8b4837891044ba45357febc9605daf567)
(cherry picked from commit 68d0b2528ec6bbab2e193fe1b3e3bde9bebc70ef)
(cherry picked from commit 73188795a252c2059ee00942be8206e7672ac849)
(cherry picked from commit b4887e387e97bdbea9edc83256869b50d835dff5)
(cherry picked from commit 1ee2183b97ac875372f6944dfc009981e6535270)
(cherry picked from commit 8db1a0571343cd11e5412eefdb809dfdc4d748d5)
(cherry picked from commit 6e7ae911d4c14672e765c3f104260da93deb73fe)
@JegernOUTT JegernOUTT linked an issue Jun 15, 2026 that may be closed by this pull request
Reconcile the new Refact UI design system (main) with the role-separated
custom completion + embedding feature:
- Engine: merge atomic imports in global_context.rs (AtomicU64 + AtomicUsize).
- GUI: rebuild ModelSelector, ModelSamplingParams, DefaultModels, ProviderForm
  on main's kit design; re-add chat/completion/embedding capability axis and
  completion/embedding default-model tabs.
- Reimplement RoleSeparatedModelConfig with the new Field/Select/SettingsGroup
  kit (aria-labels preserved for its tests).
- Drop dead RichModelSelectItem (superseded by kit ModelSelector); take main's
  vendor-detection modelProviders (drop feature prefix-first grouping + test).
- Replace orphaned Radix <Text> in ModelCardPopup with tokenized markup.

Verified: engine cargo check; GUI types + lint + full vitest (2599 passed).
@JegernOUTT

Copy link
Copy Markdown
Owner Author

🔀 Merged latest main into feature/completion_emb_revival

Pushed merge commit 22409e124 (22042c0c1..22409e124).

main shipped the new Refact UI kit (SettingsSection / SettingItem / Field / kit ModelSelector / Tabs, panel-less glass design, lucide icons) while this branch still used the old Radix Card/Flex/Text panels. The new design wins everywhere; the role-separated custom completion + embedding feature was re-implemented on top of it.

Conflict resolutions

Area Resolution
engine/global_context.rs merged atomic imports (AtomicU64 + AtomicUsize)
ModelSelector.tsx kit base + re-added capability (chat/completion/embedding)
ModelSamplingParams.tsx kit base + capability axis (embedding hidden, completion ctx)
DefaultModels.tsx (+test) tabbed SettingsSection + Completion & Embedding role tabs
ProviderForm.tsx kit base + re-wired RoleSeparatedModelConfig for custom providers
RoleSeparatedModelConfig.tsx rewritten in Field/Select/SettingsGroup kit (aria-labels preserved)
FormSelect.tsx, ModelSelector/AddCustomModel tests took main's new-design versions
RichModelSelectItem.* deleted — superseded by kit ModelSelector
modelProviders.ts (+test) reverted to main's vendor-detection (dropped feature prefix-first grouping that conflicted with main's authoritative test)
ModelCardPopup.tsx orphaned Radix <Text> → tokenized markup

Verification

  • Engine: cargo check -p refact-lsp → exit 0 (3 pre-existing benign warnings)
  • GUI: npm run types ✅ · npm run lint ✅ (0 warnings) · full vitest 2599 passed / 0 failed

Note: the feature's "prefix-first" model grouping (custom/…custom) was dropped during the merge because it was incompatible with main's openai/claude-…→Anthropic test stub. Display-grouping only; no functional impact.

Backend:
- custom provider embedding config round-trips the full object (name +
  size/batch/threshold/dimensions/prefixes); legacy bare-string preserved
- from_settings disk-fallback snapshot preserves enabled/disabled/custom/
  selected models so partial updates to disk-only providers don't wipe them
- reconcile caps.defaults.embedding_default_model with the resolved
  caps.embedding_model record

GUI:
- embedding form reads object + legacy string shapes (no blank model name)
- DefaultModels hides completion sampling (defaults contract can't persist it)
- isProviderDetailResponseWire validates role-separated settings shape;
  document that wire caps expose singular embedding_model only

Adds unit/integration tests for each fix.
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.

[Bug]: OOM when vecDB indexing

1 participant