fix(core): report completed run status from RUN lifecycle#176
Open
abhay-codes07 wants to merge 1 commit into
Open
fix(core): report completed run status from RUN lifecycle#176abhay-codes07 wants to merge 1 commit into
abhay-codes07 wants to merge 1 commit into
Conversation
…lder TreeBuilder.computeRunStatus returned "running" whenever any event carried a "running" status. The v0.1 to persisted bridge writes each node as a started event (status "running") followed by a completed event, so a fully finished run still contained "running" started rows and the whole run was reported as running. explain reads run trees through openTrace and surfaced this as run.status "running" for a completed run, while list and view (extractMetadata / buildRunSummary) correctly showed success. Derive the run status from the RUN node lifecycle instead, matching manualTraceEventsToRunTree and extractMetadata: the run is running only until its RUN completion event is present, then it takes that terminal status. Traces with no RUN node keep the previous any-error / any-running fallback. Also normalize the explain status output to the user-facing vocabulary (success/error/running) so explain agrees with list/view for the same run, as the issue requests. Fixes rajudandigam#173
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Summary
Fixes #173:
explainreportedrun.status: "running"for a run that had already completed successfully, whilelistandviewshowedsuccessfor the same run.Root cause is in
TreeBuilder.computeRunStatus(packages/core/src/logs/tree-builder.ts), whichexplainreaches throughopenTrace. It returned"running"whenever any event carried a"running"status. The v0.1 to persisted bridge (from-trace-event.ts) writes each node as a started event (status"running") followed by a completed event, so a finished run still contains"running"started rows and the whole run was reported as running.list/viewgo throughextractMetadata/buildRunSummary, which read the RUN completion status, so they were already correct.Changes:
computeRunStatusnow derives the run status from the RUN node lifecycle, matchingmanualTraceEventsToRunTreeandextractMetadata: a run is"running"only until its RUN completion event is present, then it takes that terminal status (ok/error). Traces with no RUN node (log-only ingestion) keep the previous any-error / any-running fallback. This also lets completed runs read throughopenTracepopulateendedAt/durationMs, which were previously suppressed because the status was stuck at"running".explainnow maps the run-tree status vocabulary (ok/error/running) to the user-facingsuccess/error/runningvocabulary thatlist/view/statsuse, so the command output and therun.statusfact agree with the sibling commands.How I verified
Repro from the issue, before vs after:
Type of change
Product boundaries
Packages touched
@agent-inspect/core@agent-inspect/cli(test only)Validation
Checklist