Skip to content

Update artifact graph only when no error #7072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pierremtb
Copy link
Contributor

Maybe fixes #6297

Copy link

vercel bot commented May 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 2:05pm

@@ -487,10 +487,10 @@ export class KclManager {
if (!errors.length) {
this.lastSuccessfulVariables = execState.variables
this.lastSuccessfulOperations = execState.operations
// updateArtifactGraph relies on updated executeState/variables
await this.updateArtifactGraph(execState.artifactGraph)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

execState.artifactGraph is empty on execution errors, so why would we update it? This allows for selections before the bad op (example adding a sweep on a non continuous path) to remain working.

But maybe execState.artifactGraph should actually not be empty in that case?

cc. @jtran @jessfraz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recording.2025-05-19.133425.mp4

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should have everything up until the point it failed so maybe the test needs to do a bit more, your current test only has a single batch, you need more than one batch for this for work, basically extrude something then fail after that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still seing an empty graph in execState with a broken sweep after a successful extrude

image

Copy link
Contributor

@jtran jtran Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are you trying to accomplish?

When there's an error, the artifact graph and operations are properties of the KCLError instance, and the execState is a dummy. See handleExecuteError().

execState: emptyExecState(),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider changing handleExecuteError() to copy artifactGraph and operations to the execState to present a uniform interface. But I know that some things are only done on success or only on error, so we need to be careful.

…t-back-on-errors-to-do-selections-on-whatever-did-work
…t-back-on-errors-to-do-selections-on-whatever-did-work
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.

use artifact graph we get back on errors to do selections on whatever did work
3 participants