sphinx-tribes icon indicating copy to clipboard operation
sphinx-tribes copied to clipboard

Add webhook_url to Stakwork's call

Open gonzaloaune opened this issue 9 months ago • 4 comments

Context

webhook_url to be added to this struct: https://github.com/stakwork/sphinx-tribes/blob/40399b9df8ce9cfabea8a92a34b95d2aaefa6d43/handlers/chat.go#L57

It should point to a Hive endpoint

Here for the build functionality: https://github.com/stakwork/sphinx-tribes/blob/40399b9df8ce9cfabea8a92a34b95d2aaefa6d43/handlers/chat.go#L548

A successful Request will look like this:

{
  "project_output": {
    "set_var": {
      "output": {},
      "completion_time": 0.106324959
    }
  },
  "workflow_id": 1358,
  "workflow_version_id": 6155,
  "workflow_version": 6155,
  "project_status": "completed"
}

An errored Request will look like this:

{
  "project_output": {
    "set_var": {
      "output": {},
      "completion_time": 0.180757458
    },
    "sssss": {
      "output": {
        "error": ""
      }
    }
  },
  "workflow_id": 1358,
  "workflow_version_id": 6161,
  "workflow_version": 6161,
  "project_status": "error",
  "error": {
    "message": "Error: couldn't connect to the website because couldn't find the address.",
    "workflow_id": 1357,
    "workflow_version_id": 1357,
    "step_name": "req",
    "skill_name": "request"
  }
}

Design

Acceptance Criteria

  • [ ] I've tested on Chrome
  • [ ] I've created a test that...
  • [ ] I have rebased and tested locally before submitting my PR
  • [ ] I can submit a pr within 2 days of taking the bounty

Here is an example backend test

gonzaloaune avatar Mar 18 '25 13:03 gonzaloaune

@tomsmith8 @gonzaloaune If available for work, could you please assign me?

aliraza556 avatar Mar 18 '25 13:03 aliraza556

@humansinstitute could you review to see if any more details are required.

TLDR: How to make Hive aware then we'll never here back from stak workflow again

  • We should send webhook_url on initial chat when creating the project
  • We need a endpoint to HALT or error out the workflow

tomsmith8 avatar Mar 19 '25 10:03 tomsmith8

this is instead of using logs e.g Project error as that approach is flaky

tomsmith8 avatar Mar 19 '25 10:03 tomsmith8

@gonzaloaune

  1. What other Status types are available here? Are you able to enumerate the full list with example objects and i'll make sure we deal with the all appropriately?

  2. Is there a status output for projects that are "Sat waiting for a webhook response" - as I think we'll have a bunch of those in the Hivechat / Autogen integration

humansinstitute avatar Apr 01 '25 05:04 humansinstitute