fix(kanban): validate artifact file existence before accepting completion - #53723
Closed
liuhao1024 wants to merge 13 commits into
Closed
fix(kanban): validate artifact file existence before accepting completion#53723liuhao1024 wants to merge 13 commits into
liuhao1024 wants to merge 13 commits into
Conversation
…tion The gateway notifier uploads artifact paths as native attachments after task completion. Previously phantom paths (files not on disk) were stored silently, causing empty notifications with no error surfaced. Add os.path.isfile() check after artifact normalization; reject with tool_error listing missing files. Update existing artifact tests to use real temp files and add regression test for the missing-files path. Fixes NousResearch#53699
The _handle_complete artifact validation now rejects missing files at completion time, so the test can no longer pass a non-existent path. Create both files, complete the task, then delete the ghost file before the notifier runs — same resilience coverage, compatible with the new validation.
Contributor
|
Superseded by consolidated artifact fix #63619, which preserves scratch deliverables as durable task attachments, validates declared files, records attachment rows, keeps missing claims in flight, and supports strict gateway delivery. Thank you for the artifact-lifecycle work; the final implementation consolidated this cluster onto the existing attachment system. |
This was referenced Jul 31, 2026
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 does this PR do?
kanban_completeaccepts anartifactslist of file paths that the gateway notifier later uploads as native attachments. Previously, phantom paths (files that do not exist on disk) were silently stored in the completion event payload — the notifier would fail to upload them, producing empty notifications with no error surfaced to the worker or the human subscriber.This PR adds a file-existence check before accepting artifacts. If any listed path does not exist on disk,
kanban_completereturns atool_errorlisting the missing files so the worker can create them before completing.Related Issue
Fixes #53699
Type of Change
Changes Made
tools/kanban_tools.py: Addedos.path.isfile()validation for each artifact path after normalization, before merging into metadata. Returnstool_errorlisting missing files.tests/tools/test_kanban_tools.py: Updated 3 existing artifact tests to create real temp files instead of using hardcoded/tmp/paths. Addedtest_complete_rejects_missing_artifactsregression test.How to Test
pytest tests/tools/test_kanban_tools.py -q— all 91 tests should passtest_complete_rejects_missing_artifactstest verifies thatkanban_completerejects a mix of existing and missing artifact paths with a clear error message listing the missing files.test_complete_with_artifacts_lands_in_event_payload,test_complete_artifacts_accepts_single_string,test_complete_artifacts_merges_with_explicit_metadata_field) verify that valid artifact paths still work correctly.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A