MCPcopy Create free account
hub / github.com/compozy/agh / newTaskRetryCommand

Function newTaskRetryCommand

internal/cli/task.go:1926–1960  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

1924}
1925
1926func newTaskRetryCommand(deps commandDeps) *cobra.Command {
1927 var metadataRaw string
1928
1929 cmd := &cobra.Command{
1930 Use: "retry <run-id>",
1931 Short: "Retry one failed task run",
1932 Args: cobra.ExactArgs(1),
1933 Example: ` # Re-enqueue one failed run
1934 agh task retry run-123`,
1935 RunE: func(cmd *cobra.Command, args []string) error {
1936 runIDs, err := requiredTaskRunIDs(args)
1937 if err != nil {
1938 return err
1939 }
1940 request := RetryTaskRunRequest{}
1941 if cmd.Flags().Changed("metadata") {
1942 request.Metadata, err = parseAgentTaskJSONFlag("metadata", metadataRaw)
1943 if err != nil {
1944 return err
1945 }
1946 }
1947 client, err := clientFromDeps(deps)
1948 if err != nil {
1949 return err
1950 }
1951 record, err := client.RetryTaskRun(cmd.Context(), runIDs[0], request)
1952 if err != nil {
1953 return err
1954 }
1955 return writeCommandOutput(cmd, retryTaskRunBundle(&record))
1956 },
1957 }
1958 cmd.Flags().StringVar(&metadataRaw, "metadata", "", "Optional retry metadata JSON")
1959 return cmd
1960}
1961
1962func newTaskRunRecoverCommand(deps commandDeps) *cobra.Command {
1963 var (

Callers 1

newTaskCommandFunction · 0.85

Calls 6

requiredTaskRunIDsFunction · 0.85
parseAgentTaskJSONFlagFunction · 0.85
clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
retryTaskRunBundleFunction · 0.85
RetryTaskRunMethod · 0.65

Tested by

no test coverage detected