Skip to content

fix(artifact_handler): resolve webhook errors, await message delivery, and sync job statuses - #240

Open
Tharickv75 wants to merge 28 commits into
devfrom
artifact_bug
Open

Tharickv75 wants to merge 28 commits into
devfrom
artifact_bug

Conversation

@Tharickv75

Copy link
Copy Markdown
Contributor

Summary

This PR resolves critical notification and execution issues within the artifact handler workflow.

Key changes:

  • Webhook Routing: Scoped notify endpoints to wildcard routes (/api/artifact_handler_action/notify/*) and registered first-party routes early to eliminate 403 and 404 errors on Lambda.
  • Lambda Execution: Awaited message delivery inline within notify requests to prevent Lambda from freezing before WhatsApp/Messenger notifications are sent.
  • Status Sync & Persistence: Enforced reverse-index persistence during job registration and updated status synchronization to prevent jobs from being trapped in queued.
  • Cleanup: Added post-import cleanup via DELETE /v1/artifacts/{job_id}.

Eldon Marks and others added 25 commits September 13, 2026 22:59
Drop graph-repair edge_ids sync phases; pin jvspatial==0.0.19.

Co-authored-by: Cursor <cursoragent@cursor.com>
Covers harness excellence (#232), jvchat debug tick replay (#230),
artifact-handler document answers (#231), and hiding harness journal
blobs from Debug export (#233).
release: promote dev to main (pre-0.1.8rc13)
chore(release): 0.1.8rc15 / jvspatial 0.0.21 work-kernel CAS
- Updated `register_job` to fail the ingest if the reverse-index cannot be saved, preventing jobs from getting stuck in a queued state.
- Enhanced the notify webhook to reload actions from the database before job lookups, log unknown jobs, and return a 503 status for retries.
- Introduced `_persist_job_index` method to handle job index persistence with error logging.
- Added `confirm_artifact_imported` method to delete retained jvforge artifacts after successful pull-imports.
- Implemented job status updates in the conversation vault for better tracking of pending jobs.
- Updated the artifact handler to await channel sends for WhatsApp/Messenger notifications, preventing Lambda from freezing during send operations.
- Introduced new methods to manage job notifications and reverse-index entries, ensuring proper job status updates and retries on failures.
- Added extensive logging for better traceability of message sending failures and job processing.
- Updated tests to verify the new notification behavior and error handling.
Co-authored-by: Cursor <cursoragent@cursor.com>
…pshot

Register the jvforge import callback on the live FastAPI app so Lambda no longer 404s after processing.

Co-authored-by: Cursor <cursoragent@cursor.com>
…webhook

- Added detailed warning logs for various failure scenarios in the artifact handler's notify webhook, including webhook URL minting and job ID processing.
- Updated the remounting logic to log the status of live routes and potential 404 issues.
- Improved the handling of API key checks and missing parameters in the notify route.
- Ensured consistent logging levels across the artifact handler for better traceability.
…iming logs

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Updated artifact handler to mint API keys with a glob pattern for notify endpoints, allowing for cross-agent usage without 403 errors.
- Changed PageIndex webhook path from `/api/pageindex_retrieval_interact_action/interact/webhook/{agent_id}` to `/api/pageindex/interact/webhook/{agent_id}` to streamline interactions.
- Enhanced tests to verify new webhook URL generation and key minting behavior, ensuring proper permissions and endpoint scoping.
Co-authored-by: Cursor <cursoragent@cursor.com>
- Reformatted context manager in `test_pageindex_llm_webhook_mints_new_path` and `test_pageindex_llm_webhook_remints_legacy_prefix` for better clarity and maintainability.
- Ensured consistent structure across test cases for improved readability.
- Removed excessive warning logs in the artifact handler, replacing them with error logs for critical failures to improve clarity and severity distinction.
- Updated the version in `version.py` to 0.1.8rc15 and adjusted Dockerfile to clone from the main branch.
- Modified GitHub Actions to trigger on the main branch for version bumps.
@Tharickv75 Tharickv75 self-assigned this Sep 22, 2026
@Tharickv75
Tharickv75 requested a review from eldonm as a code owner September 22, 2026 19:39
…gging

- Removed the remounting logic for the artifact handler notify webhook from core embed endpoints, ensuring it only registers when the action is loaded.
- Updated tests to verify that the notify route is correctly mounted after action import, preventing 404 errors.
- Enhanced logging to focus on critical failures while reducing excessive warning logs for improved clarity.
… bump version to 0.1.8rc15-dev7

- Changed the Dockerfile to clone the jvagent repository from the 'artifact_bug' branch.
- Updated the GitHub Actions workflow to trigger on pushes to the 'artifact_bug' branch.
- Bumped the version in `version.py` to 0.1.8rc15-dev7 for development tracking.
…nd enhance security

- Changed the artifact handler notify webhook to no longer mint an API key, relying instead on a known reverse-index job_id and trusted jvforge artifact URL for authorization.
- Updated the notify webhook URL generation logic to ensure it does not include an API key query.
- Enhanced logging and validation to ensure only trusted artifact URLs are processed.
- Bumped version to 0.1.8rc15-dev8 in `version.py` for development tracking.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants