fix(jobs): pre-flight workspace check before gapfill/FBA; humanize errors#216
Closed
VibhavSetlur wants to merge 2 commits into
Closed
fix(jobs): pre-flight workspace check before gapfill/FBA; humanize errors#216VibhavSetlur wants to merge 2 commits into
VibhavSetlur wants to merge 2 commits into
Conversation
…rors When users navigate to a model ref whose backing workspace object is missing (a reconstruct that never completed, or a stale/bookmarked link) and click Run FBA / Run GapFilling, the frontend was enqueuing a celery job that the backend could only fail with the cryptic PATRIC workspace text `_ERROR_Object not found!_ERROR_`. Live Flower shows 543 of these failed jobs across modelseed.gapfill (392) and modelseed.fba (151) — many users retrying the same broken ref 10-20 times — and complements the new clearer backend message José added. This adds a single fix: - New `lib/utils/jobErrors.ts#formatJobError` translates both the legacy `_ERROR_Object not found!_ERROR_` and the explicit "Object not found" substrings into actionable wording that names the missing path and points users at their reconstruct job. The new backend message is recognised and passed through unchanged. - `app/model/[...path]/page.tsx#submitModelJob` now calls `workspaceGet([modelRef])` before submitting, throws the friendly error if the object is missing, and routes both the pre-flight and any backend rejection through `formatJobError`. The doomed celery job is never enqueued. - `app/(user-data)/my-jobs/page.tsx` runs the displayed `errorMsg` through `formatJobError` so older failed-job rows show the new actionable wording too, substituting the job's own model ref. Unit-tested with 7 new cases in `tests/unit/utils/jobErrors.test.ts` (empty/null inputs, legacy form with/without ref, bare "Object not found", new backend message passthrough, unrelated errors untouched, Error-instance coercion). Local lint/typecheck/build clean, 98/98 unit tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Biochem Integration Tests suite intentionally degrades to "skipped" when staging.modelseed.org is unreachable, but the live probe in beforeAll had no internal timeout — on slow CI networks the vitest hookTimeout (10s) fired before the catch block could mark isApiAvailable = false, turning the whole suite (and CI) red. Race the probe against an explicit 7s timer so the catch path always runs first; observed master CI flake matched this same signature on 2026-06-03. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Closing to re-route through the correct flow: this branch should go into my fork's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Live Flower (poplar:5555) currently shows 543 failed
modelseed.gapfill+modelseed.fbajobs all dying withWorkspaceError('_ERROR_Object not found!_ERROR_')— the same handful of broken model refs being retried 10–20 times each by frustrated users.modelseed.gapfillObject not foundmodelseed.fbaObject not foundEvery payload shape is identical:
model = '/<user>/modelseed/<name>/model'where the workspace object truly does not exist. The frontend builds that ref purely from URL params (app/model/[...path]/page.tsx:1457-1474) and submits the job without verifying the object exists.This complements José's backend change (
exceptiontext now readsNo model found at '<path>'. Check that your reconstruct…) by:_ERROR_string in My Jobs.What
lib/utils/jobErrors.ts— newformatJobError(raw, modelRef?)helper. Translates legacy_ERROR_Object not found!_ERROR_(and bareObject not found) into actionable wording; passes the new backend message through unchanged; returnsundefinedfor empty input.app/model/[...path]/page.tsx—submitModelJobnow callsworkspaceGet([modelRef])before submitting; throws the friendly error if the object is missing; routes both pre-flight and backend errors throughformatJobError. The doomed celery job is never enqueued.app/(user-data)/my-jobs/page.tsx— the displayederrorMsgis run throughformatJobError(job.error, args.model)so older failed-job rows show the friendly wording too, with the missing path substituted.tests/unit/utils/jobErrors.test.ts— 7 new unit tests covering empty/null inputs, legacy form with/without ref, bare "Object not found", new backend message passthrough, unrelated errors untouched, Error-instance coercion.What is NOT changed
Test plan
npm run lint— 0 errors (pre-existing warnings only, none in touched files)npx tsc --noEmit— cleannpm run test:run— 98/98 pass (7 new forformatJobError)npm run build—/model/[...path],/team,/my-jobsall build successfullynpm audit --omit=dev --audit-level=high— 0 vulnsGET /model/missingowner/modelseed/no-such-modelreturns 200; client pre-flight runs on Run-FBA / Run-Gapfill click🤖 Generated with Claude Code