feat(taskactions): retry a parked task on the current workflow definition

This commit is contained in:
sam committed 2026-10-17 13:35:12 +11:00
1 parent c80d4750a8
commit 9d7287c647
18 files changed
+134 -58

No files matched your search

+15 -11
View File
@@ -36,6 +36,8 @@ type actionRequest struct {
Findings []string `json:"findings,omitempty"`
RetryMode taskstate.RetryMode `json:"retry_mode,omitempty"`
ResumeFrom string `json:"resume_from,omitempty"`
// CurrentDefinition moves a retry onto the current stored definition.
CurrentDefinition bool `json:"current_definition,omitempty"`
}
type actorPayload struct {
@@ -118,10 +120,11 @@ func Register(nc *nats.Conn, service taskactions.Service, log *slog.Logger) (fun
return
}
err := service.Apply(context.Background(), req.Identity, req.Actor.actor(), req.TaskID, req.Action, taskactions.ActionPayload{
Instructions: req.Instructions,
Findings: req.Findings,
RetryMode: req.RetryMode,
ResumeFrom: req.ResumeFrom,
Instructions: req.Instructions,
Findings: req.Findings,
RetryMode: req.RetryMode,
ResumeFrom: req.ResumeFrom,
CurrentDefinition: req.CurrentDefinition,
})
natsrpc.Respond(msg, log, "taskactions", actionResponse{
Envelope: natsrpc.NewEnvelope(err),
@@ -149,13 +152,14 @@ func (c Client) ApplyChatTaskAction(ctx context.Context, scope *string, actor ta
return gateway.TaskActionResult{}, fmt.Errorf("task action connection is unavailable")
}
request := actionRequest{
Identity: scope,
TaskID: id,
Action: action,
Instructions: res.Instructions,
Findings: res.Findings,
RetryMode: res.RetryMode,
ResumeFrom: res.ResumeFrom,
Identity: scope,
TaskID: id,
Action: action,
Instructions: res.Instructions,
Findings: res.Findings,
RetryMode: res.RetryMode,
ResumeFrom: res.ResumeFrom,
CurrentDefinition: res.CurrentDefinition,
Actor: &actorPayload{
ID: string(actor.Identity),
Kind: string(actor.Kind),