Description: When a workflow is deleted via the web dashboard or API, it disappears from the UI. However, after restarting the openfang daemon/gateway, the deleted workflow reappears. This happens because the workflow's .json file is not removed from ~/.openfang/workflows/ when the workflow is deleted.
Expected Behavior: A workflow should remain deleted after deletion, even after daemon restart.
Steps to Reproduce:
- Create a new workflow via the web dashboard
- Verify the workflow's
.json file exists in ~/.openfang/workflows/
- Delete the workflow via the web dashboard
- Verify the workflow disappears from the dashboard UI
- Check that the
.json file still exists in ~/.openfang/workflows/ (BUG: file not deleted)
- Restart the openfang daemon/gateway
- Observe that the deleted workflow reappears in the dashboard
Root Cause:
remove_workflow() in crates/openfang-kernel/src/workflow.rs:235-238 only removes from in-memory HashMap, does NOT delete the .json file
- Workflow creation in
crates/openfang-api/src/routes.rs:985-1001 correctly persists to disk
- On startup,
load_workflows_from_dir() in crates/openfang-kernel/src/kernel.rs:4634-4650 loads all .json files, re-importing "deleted" workflows
Description: When a workflow is deleted via the web dashboard or API, it disappears from the UI. However, after restarting the openfang daemon/gateway, the deleted workflow reappears. This happens because the workflow's
.jsonfile is not removed from~/.openfang/workflows/when the workflow is deleted.Expected Behavior: A workflow should remain deleted after deletion, even after daemon restart.
Steps to Reproduce:
.jsonfile exists in~/.openfang/workflows/.jsonfile still exists in~/.openfang/workflows/(BUG: file not deleted)Root Cause:
remove_workflow()incrates/openfang-kernel/src/workflow.rs:235-238only removes from in-memoryHashMap, does NOT delete the.jsonfilecrates/openfang-api/src/routes.rs:985-1001correctly persists to diskload_workflows_from_dir()incrates/openfang-kernel/src/kernel.rs:4634-4650loads all.jsonfiles, re-importing "deleted" workflows