Repository navigation
fix(run): the edges inside a workflow instance are drawn from the run it nests - #239
Merged
Merged
Conversation
… it nests A nested workflow answered by a past run (child(instance="wf-out/<run>")) runs nothing when its parent runs: the parent's runs hand on what that run recorded and record nothing inside the instance. Stepped into from the parent, the view took the latest run of any workflow on the trail, the parent's once it had run, and its edges showed no token. - The producer's meta.workflowInstance.run is carried on the node (WorkflowDiagramMetadata.RECORDED_RUN), and on the crumb a drill-down adds (recordedRun), kept by the client's breadcrumb, the extension's trail rewrite and the server's trail parse. - recorded-run.ts: the view's run is the deepest crumb's past run, resolved as the producer reads it (relative to the file of the crumb above, ~, a run folder or its record). - A view at or below that crumb reads that run's overlay, its instance paths measured from the crumb; its agents come from that run; the run picker lists that run alone. The latest or chosen run of the parent no longer applies there. Claude-Session: https://claude.ai/code/session_011UYzzUKxNqKPdmLsRmJ6Xu
- Back at the parent, the client carries the instance's run as the one chosen: a run asked for that is none of the view's runs is not chosen there (runChosenFor), so the parent draws its own latest run and its picker selects one of its runs. - Open View of an instance answered by a past run (a view the node offers) keeps the run on its crumb: the context menu item, the WorkflowOpenViewAction and requestView carry recordedRun. - The recorded run is read where it was found: its outDir is the folder it was found in (the queue trace and wf:viewerOverlayOutDir follow a moved run), and nothing runs in it (running false, nothing active). - The run picker lists the recorded run by its folder's name when it cannot be read; a run not found is logged. - `~\` is the home folder too; a record's workflow name is trimmed. Claude-Session: https://claude.ai/code/session_011UYzzUKxNqKPdmLsRmJ6Xu
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.
What was wrong
A wfpy workflow instance,
c = counted(instance="wf-out/<run>"), nests a past run. When the parent runs, it hands on the outputs that run recorded and runs nothing ofcounted, so the parent's run records nothing insidec.Stepping into
cfrom the parent, the view took the latest run of any workflow on its trail. Once the parent had run, that was the parent's run, so none of the edges inside the instance were green.What changes
Node:
GraphGModelSourcecarries the producer'smeta.workflowInstance.runasWorkflowDiagramMetadata.RECORDED_RUN(wf:recordedRun). wfpy already exports it, so no producer change is needed.Crumb: a drill-down into such a node puts the run on the crumb it adds (
recordedRun). It is kept by:buildNavigationTrail,parseTrail,normalizeTrail);glsp-activation.ts);parseNavigationTrailArg).Server (
recorded-run.ts): the run a view is drawn from is the deepest crumb's past run. It is resolved as the producer reads it: relative to the file of the crumb above, with~for the home folder, and either the run's folder or its record.Storage: a view at or below that crumb is drawn from that run:
run.wf-agent-context.json;The parent's latest or chosen run no longer applies inside the instance.
Tests
recorded-run-overlay.test.tsuses a real run log in whichcountedran first andparentafter it:recordedRun, the view takes the parent's run (the old behaviour, with no tokens);recordedRunOfTrailresolution;recorded-run-crumb.test.ts: a double-click on an instance node puts the run on the crumb, and the breadcrumb keeps it for views further down. An ordinary nested workflow gets no run on its crumb.Live check (wfpy harness)
inst_child.py(counted:Produce → Double → Num) was run first, theninst_parent.py, which nests that run asc. I openedinst_parent.pyand stepped intoc:An ordinary nested workflow (
sub_agents.py›child) still shows 12 of 12 green.Review (
/code-review medium), fixed in 8085ee1runChosenFor), and the parent draws its own latest run. Checked live: afterc, clicking theparentcrumb shows 4 of 4 green.outDir. The overlay'soutDiris now the folder the run was found in.WorkflowOpenViewActionandrequestViewnow carryrecordedRun.running. A recorded run is drawn as finished, with nothing active: the instance runs nothing.~\paths are now read as the home folder.https://claude.ai/code/session_011UYzzUKxNqKPdmLsRmJ6Xu