Skip to content

auto-triage: reconstruct returns structured failure when bio1 absent - #7

Draft
jplfaria wants to merge 3 commits into
mainfrom
auto-triage/issue-35-bio1-fallback
Draft

jplfaria wants to merge 3 commits into
mainfrom
auto-triage/issue-35-bio1-fallback

Conversation

@jplfaria

@jplfaria jplfaria commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Fixes ModelSEED/modelseed-api-ops#35\n\n## Root cause\n\nThe reconstruct Celery task raised RuntimeError when the built model had no bio1 biomass reaction (line 747, tasks.py). This made the Celery task fail with an exception, causing failure_watcher to file a bug - even though this is a user-input condition.\n\n## Changes\n\n- tasks.py: replace raise RuntimeError with a structured return dict (consistent with the mdlutl-is-None guard at line 679)\n- job_scripts/reconstruct.py: add bio1/bio* guard before setting the objective (was a bare unguarded assignment)\n- tests/unit/test_reconstruct_bio1_guard.py: unit tests for the guard logic\n\n## Prior art\n\nIssue 23 in modelseed-api-ops hit the same error; branch auto-triage/issue-23-bio1-objective-missing (PR 4) was never merged.

Preventing the Celery task from crashing with RuntimeError when
reconstructed model has no bio1 biomass reaction. Instead return a
structured {status: failed} result consistent with the mdlutl-is-None
guard. Also adds bio* fallback before giving up.

Closes ModelSEED/modelseed-api-ops#35
Mirror the tasks.py fix: if bio1 is missing fall back to
any bio* reaction so cobra does not raise invalid objective.

Refs ModelSEED/modelseed-api-ops#35
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.

1 participant