Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions rust/kcl-lib/src/execution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,9 @@ impl ExecutorContext {
reapply_settings,
ast: changed_program,
} => {
if reapply_settings
&& self
let mut reapply_failed = false;
if reapply_settings {
if self
.engine
.reapply_settings(
&self.settings,
Expand All @@ -660,8 +661,19 @@ impl ExecutorContext {
grid_scale,
)
.await
.is_err()
{
.is_ok()
{
cache::write_old_ast(GlobalState::with_settings(
Copy link
Contributor Author

@andrewvarga andrewvarga Nov 28, 2025

Choose a reason for hiding this comment

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

Previously we never called write_old_ast in this CheckImportsOnly arm of the match after reapply_settings so the value was never updated in the cache, so next time the grid changed it was compared against an outdated cached value.

This is similar code to further below in this function which also calls write_old_ast after reapply_settings.

cached_state.clone(),
self.settings.clone(),
))
.await;
} else {
reapply_failed = true;
}
}

if reapply_failed {
(true, program, None)
} else {
// We need to check our imports to see if they changed.
Expand Down
Loading