fix: correct graph_enabled logic in process configuration

- Updated the logic for `graph_enabled` in `UploadConfirmDialog.vue` to require both `nodeExtractConfig.enabled` and `graphEnabled` to be true.
- Added a new test case in `knowledge_process_config_test.go` to ensure that `GraphEnabled` is false when `ExtractConfig.Enabled` is false.
- Adjusted the `ResolveProcessConfig` function to reflect the updated dependency between graph and extract configurations, ensuring proper behavior in the process configuration resolution.
This commit is contained in:
wizardchen
2026-06-09 18:29:22 +08:00
committed by lyingbug
parent ed9e780c8c
commit 76dc23226d
3 changed files with 20 additions and 5 deletions
@@ -49,6 +49,9 @@ func ResolveProcessConfig(kb *types.KnowledgeBase, overrides *types.KnowledgePro
eff.ExtractConfig = mergeExtractConfig(eff.ExtractConfig, overrides.ExtractConfig)
}
// Match KnowledgeBase.IsGraphEnabled: graph fan-out requires extract to be on.
eff.GraphEnabled = eff.GraphEnabled && eff.ExtractConfig.Enabled
return eff
}
@@ -178,9 +181,7 @@ func mergeExtractConfig(base types.ExtractConfig, override *types.ExtractConfig)
return base
}
result := base
if override.Enabled {
result.Enabled = true
}
result.Enabled = override.Enabled
if override.Text != "" {
result.Text = override.Text
}