Skip to content

fix(kanban): validate artifact file existence before accepting completion - #53723

Closed
liuhao1024 wants to merge 13 commits into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-53699-kanban-artifact-validation
Closed

fix(kanban): validate artifact file existence before accepting completion#53723
liuhao1024 wants to merge 13 commits into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-53699-kanban-artifact-validation

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

kanban_complete accepts an artifacts list 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_complete returns a tool_error listing the missing files so the worker can create them before completing.

Related Issue

Fixes #53699

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • tools/kanban_tools.py: Added os.path.isfile() validation for each artifact path after normalization, before merging into metadata. Returns tool_error listing missing files.
  • tests/tools/test_kanban_tools.py: Updated 3 existing artifact tests to create real temp files instead of using hardcoded /tmp/ paths. Added test_complete_rejects_missing_artifacts regression test.

How to Test

  1. pytest tests/tools/test_kanban_tools.py -q — all 91 tests should pass
  2. The new test_complete_rejects_missing_artifacts test verifies that kanban_complete rejects a mix of existing and missing artifact paths with a clear error message listing the missing files.
  3. Existing artifact tests (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

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 26.4.1

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

…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
@alt-glitch alt-glitch added type/bug Something isn't working comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have labels Jun 27, 2026
@teknium1

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: kanban_complete accepts completion referencing a nonexistent durable artifact

3 participants