ultravioletrs / cocos

Cocos AI - Confidential Computing System for AI
https://ultraviolet.rs/cocos.html
Apache License 2.0
23 stars 9 forks source link

COCOS-181 - Add failed state for algo execution #197

Closed SammyOina closed 1 month ago

SammyOina commented 1 month ago

What type of PR is this?

This a feature as it adds a new failed state to agent

What does this do?

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

No

Did you document any new/modified feature?

Will update cocos docs

Notes

SammyOina commented 1 month ago

@SammyOina What do you think about this:

When a user attempts to fetch results before they are ready, return a warning that results are not ready and do not transition to the next state on the state machine.

Can this also be handled in this PR?

agent already returns results not ready warning. agent will not transition from running state unless results are ready or algo execution failed.

SammyOina commented 1 month ago

image

We have two indications of failed, I would say we only have:

Running -> Failed

And remove:

Failed -> failed

Failed state exits for two reasons, one is for result consumers to see the reason for failed computation, another is to allow agent to remain in this state after running, it cannot remain in failed state perpetually. i.e running failed is not an actual state. agent state machine is still running. see https://github.com/SammyOina/cocos-ai/blob/cocos-181/agent/state.go