Fix: find_active_run treats skill artifacts as loop-state candidates (GH-36) - #38
Merged
Merged
Conversation
…H-36) find_active_run globbed every *.json under a job directory and treated missing status as non-terminal, so a skill artifact written into the same directory (e.g. validate's validation-report.json, which has no status, loop_name, or task_id) was mistaken for a second live run, raising AmbiguousActiveRun on every loop_advance/loop_continue call. A JSON file is now only a run candidate if it actually carries loop_name, task_id, and status. Anything else in the job directory is skipped outright. Fixes #36
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.
Fixes #36.
Problem
find_active_runglobbed every*.jsonunder.dmx/jobs/{job_id}/and treated a missingstatusfield as non-terminal. A skill's own artifact written into the same directory — e.g.validatewritingvalidation-report.json(nostatus/loop_name/task_id, perspec_adherence.py's expected shape) — was therefore mistaken for a second, permanently-non-terminal loop run, andloop_advance/loop_continueraisedAmbiguousActiveRunon every attempt to proceed.Fix
A JSON file is now only treated as a loop-state candidate if it actually has
loop_name,task_id, andstatusall present. Anything else under the job directory — including any future skill artifact, not just this one — is skipped outright instead of defaulting to "non-terminal."Testing
TestFindActiveRun: artifact alongside a real paused run (must still resolve the real run, not raise), artifact alone with no real run (must returnNone), and a non-dict JSON file (must not crash the scan).