Repository navigation
feat(combo): Auto-Combo snapshot generation/duplication in the UX - #10354
diegosouzapw merged 3 commits into
Conversation
| } | ||
|
|
||
| const providerPool = [...new Set(effectivePool.map((c) => c.provider))]; | ||
| const snapshotScores = computeSnapshotWeights(effectivePool, weights); |
There was a problem hiding this comment.
@diegosouzapw
Need confirmation from product team that this is desired and is a bug that was fixed. This isn't an area I'm familiar with.
| @@ -3203,213 +3212,232 @@ function ComboFormModal({ isOpen, combo, onClose, onSave, activeProviders, combo | |||
| {builderSelectionMode === "step" && ( | |||
| <> | |||
| <div className="grid grid-cols-1 md:grid-cols-3 gap-2 mt-3"> | |||
There was a problem hiding this comment.
@diegosouzapw These huge sections here are due to reformatting from Prettifier. I think this is automatic.
|
Deferido para revalidação do head atual. A rodada anterior registrou um hold de ownership, mas a inspeção atual não confirmou esse worktree; por favor, reconfirme o head e os checks antes da decisão final. |
…y term - Route /api/combos/duplicate read request.json() without validateBody()/ .safeParse(), failing the t06 CI gate (Hard Rule #7). Add duplicateAutoComboSchema and route the body through validateBody(). - zh-CN string for duplicateAutoComboSnapshotMsg used the glossary synonym 提供商 instead of the canonical 提供者 for "provider", failing the i18n glossary consistency gate. Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
Babysit summary (Unit Tests fast-path 4/4)Root cause (from run 31853607931, job
Fix (commit
Verification:
Threads left unresolved (not addressed by this fix, out of scope):
Ready for CI to finish + human review/merge. |
|
New CI run (32438457440, after the fix push) shows 2 additional reds unrelated to this PR's diff — both are inherited base drift, not caused by this branch:
Original target ("Unit Tests fast-path (4/4)") is fixed by commit |
74c9e7e
into
cheaper-inference:release/v3.8.50
…eaper-inference#10354) Adds a snapshot-generation button to each Auto-Combo catalog card: computeSnapshotWeights() scores candidates (taskFit/stability/tierPriority/costInv) at combo-creation time instead of the previous hardcoded weight:1, and the new POST /api/combos/duplicate endpoint materializes any auto/* template into a persistent, editable static combo with normalized weights. Closes cheaper-inference#10231. Validated in an isolated worktree boarded onto origin/release/v3.8.50 (0 conflicts, 51 files): - 19/19 focused tests pass (snapshot-weights, combos-duplicate-route, combos-duplicate-resolution-audit) — covers auth gate (401/403), input validation (400/422), success shape, weight normalization, naming/dedup, and error-response sanitization (no stack traces). - check-file-size, check-changelog-integrity: OK. - typecheck:core: clean. - check-complexity / check-cognitive-complexity: OK, both under baseline. Co-authored-by: swingtempo <swingtempo@users.noreply.github.com>
Summary
auto/best-coding) has a button to generate a snapshot of the combo so a user can see and edit itRelated Issues
What Changed
1. Snapshot Weight Computation (
open-sse/services/autoCombo/virtualFactory.ts)computeSnapshotWeights()scores candidates at combo creation time using:weight: 1increateVirtualAutoComboFromPrepared()with computed scores normalized to[0, 1].2. Duplicate Endpoint (
src/app/api/combos/duplicate/route.ts) — NEW/api/combos/duplicateresolves anauto/*template (e.g.auto/best-coding,auto/glm) into a static combo snapshot.createVirtualAutoCombo().static-{name} copy), and preserves the original weight pack in config.3. Dashboard UI Updates
src/app/(dashboard)/dashboard/combos/page.tsxhandleComboCreated()callback to auto-scroll newly created combo cards; wired it into<AutoComboCatalog />. Refactored ComboFormModal provider builder grid layout.src/app/(dashboard)/dashboard/combos/AutoComboCatalog.tsxonComboCreatedprop for post-creation scroll behavior.4. Tests (Rule #18)
tests/unit/snapshot-weights.test.tstests/unit/combos-duplicate-route.test.tstests/unit/combos-duplicate-resolution-audit.test.ts5. Utilities & i18n
scripts/ad-hoc/dump-auto-combos.ts: CLI helper to dump resolved auto-combo candidates (debug / inspection).src/i18n/messages/*.json.Why This Matters
1) to every model, ignoring capability differences./api/combos/duplicatematerializes anyauto/*template as a persistent combo with preserved weights and metadata.API Reference — Duplicate Endpoint
Response (201):
{ "id": "...", "name": "static-best-coding copy", "models": [ { "model": "anthropic/claude-sonnet-4-20250514", "weight": 35 }, { "model": "openai/gpt-4.1", "weight": 28 } ], "strategy": "priority", "config": { "sourceAutoCombo": "auto/best-coding", "weightPack": { "taskFit": 0.3, "stability": 0.25, ... } } }Error codes:
400(missing/invalid name),401/403(auth),422(unknown template or no matching models),500(server error).Files Changed (51 files, +1412 / −249)
open-sse/services/autoCombo/virtualFactory.tssrc/app/api/combos/duplicate/route.ts(new)src/app/(dashboard)/dashboard/combos/page.tsx,AutoComboCatalog.tsxtests/unit/snapshot-weights.test.ts(new),tests/unit/combos-duplicate-route.test.ts(new),tests/unit/combos-duplicate-resolution-audit.test.ts(new)src/i18n/messages/scripts/ad-hoc/dump-auto-combos.ts(new)Testing
Notes for Reviewers
NOTE! Prettifier page.tsx impact there are too many changes in page.tsx because Prettifier made a bunch of formatting changes. Main change is the OnComboCreated handler passed to AutoComboCatalog! Confirmed with AI that the large page.tsx changes are purely formatting.
[0, 1], then normalized so all model weights sum exactly to100in the duplicate endpoint (with remainder distributed round-robin).