Skip to content

Staging sync: fix canonical model refs and FBA detail loading#181

Merged
VibhavSetlur merged 3 commits intoModelSEED:stagingfrom
VibhavSetlur:staging
May 5, 2026
Merged

Staging sync: fix canonical model refs and FBA detail loading#181
VibhavSetlur merged 3 commits intoModelSEED:stagingfrom
VibhavSetlur:staging

Conversation

@VibhavSetlur
Copy link
Copy Markdown
Collaborator

@VibhavSetlur VibhavSetlur commented May 5, 2026

Summary

  • Syncs latest VibhavSetlur:staging into ModelSEED:staging.
  • Includes two commits focused on FBA/model-detail correctness and API client coverage.

Included Commits

  • b93af2b fix(model-detail): use canonical model ref for FBA and gapfills
  • 5fda9ba fix(fba-detail): load FBA detail data by fba_id

Files Changed

  • app/model/[...path]/page.tsx
  • app/fba/[...path]/page.tsx
  • lib/api/modelseed.ts
  • tests/unit/api/modelseed-client.test.ts

Why

  • Ensures detail routes resolve against canonical model references.
  • Prevents mismatches in FBA detail retrieval by using fba_id consistently.
  • Adds unit-test coverage for affected client behavior to reduce regression risk.

Validation

  • Branch divergence reviewed against upstream/staging.
  • Diff inspected for changed files and commit scope.

Test plan

  • Unit tests for modelseed client changes are included in this branch.
  • Verify model detail page renders FBA and gapfills with canonical refs.
  • Verify FBA detail page loads by selected fba_id from model detail links.

Made with Cursor

VibhavSetlur and others added 2 commits May 5, 2026 12:30
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 17:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Syncs staging changes that correct how the UI resolves ModelSEED model/FBA references when loading model-linked data, and adds unit coverage for the updated API client behavior.

Changes:

  • Add a new ModelSEED API client wrapper to fetch FBA “detail data” by ref + fba_id (with 404 → null semantics).
  • Update the FBA detail page to prefer the new detail endpoint before falling back to the list endpoint / workspace fetch.
  • Update the model detail page to use a “canonical” model ref for FBA/gapfill lookups.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
app/model/[...path]/page.tsx Changes how the model ref used for FBA/gapfill API calls is derived (intended to be canonical).
app/fba/[...path]/page.tsx Adds a first-attempt fetch of FBA detail data by fba_id before list/workspace fallbacks.
lib/api/modelseed.ts Introduces getModelFbaDataFromApi(ref, fbaId) calling /api/models/fba/data.
tests/unit/api/modelseed-client.test.ts Adds unit tests asserting query-string construction, decoding behavior, and 404 handling for the new wrapper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/model/[...path]/page.tsx Outdated
Comment on lines +1441 to +1448
const modelApiRef = useMemo(() => {
// Only fetch model-linked data if we're on a specific model, not a folder.
const segments = workspacePath.split('/').filter(Boolean);
if (segments.length >= 3 && !workspacePath.toLowerCase().endsWith('/modelseed')) {
const modelPath = workspacePath.endsWith('/model') ? workspacePath : `${workspacePath}/model`;
return modelPath;
if (segments.length < 3 || workspacePath.toLowerCase().endsWith('/modelseed')) {
return null;
}
return null;
}, [workspacePath]);
return apiCandidates[0] ?? null;
}, [workspacePath, apiCandidates]);
Comment on lines +12 to +19
beforeEach(() => {
vi.restoreAllMocks();
vi.resetModules();
process.env.NEXT_PUBLIC_USE_MODELSEED_API = 'true';
process.env.NEXT_PUBLIC_MODELSEED_API_URL = 'http://localhost:8000';
localStorage.clear();
setAuthToken();
});
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@VibhavSetlur VibhavSetlur merged commit fe91a4e into ModelSEED:staging May 5, 2026
2 checks passed
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.

2 participants