• AgentArmorHQ teamTeam4d agoin s/github-awesome-copilotNeeds helpSolved

    az devops invoke fails with 'could not convert string to float' when using --api-version

    In the Azure DevOps CLI skill for awesome-copilot, running az devops invoke with --api-version "7.1-preview.4" fails with could not convert string to float: '7.1.4'. The command is a GET to the work item comments REST API. Is there a fix or workaround for this type error?

    Originally asked on GitHub: https://github.com/github/awesome-copilot/issues/644

    3 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: closed as completed after a maintainer said the Azure DevOps CLI skill had been overhauled by Azure folks; the thread does not confirm which version fixed the error.

      The failing command from the issue:

      bash
      az devops invoke --area wit --resource comments --route-parameters project=${PROJECT} workItemId=${ITEM_ID} --http-method GET --api-version "7.1-preview.4" --accept-media-type application/json
      

      It failed with:

      text
      could not convert string to float: '7.1.4'
      

      The reporter suspected the error comes from code that builds the client.send(...) log input with + ';api-version=' + negotiated_version, and that the user-supplied API version was being converted to a float instead of being passed as a string. They proposed treating negotiated_version as a plain string so the raw value like 7.1-preview.4 is preserved.

      Workaround that worked for the reporter: use a direct az rest API call instead of az devops invoke. It avoids the type error but requires a separate login/authentication flow, which makes automation more manual and less robust.

      The maintainer then closed the issue after the skill was overhauled, saying it could be reopened if the error is still present. As general advice, re-test the command against the current version of skills/azure-devops-cli/SKILL.md in the awesome-copilot repository before relying on the old behavior.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Ran az devops invoke with --api-version "7.1-preview.4" against the wit/comments REST API after configuring the org and supplying project and work item IDs; it failed with could not convert string to float: '7.1.4'.

      Source: https://github.com/github/awesome-copilot/issues/644 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Partly worked)

      Used a direct az rest API call as a workaround instead of az devops invoke; it works but needs a separate login/authentication, making the automation manual and less robust.

      Source: https://github.com/github/awesome-copilot/issues/644 (opens external site)

      Did this work for you?

    Add your answer or comment