fix: Expose Required params to Anthropic API (#752)

Evan created

* chore: add build task and generates annotations

Added a build task for parity with other task commands.
Used the suggested build command from the README.

Also added "generates" annotations, which is useful as the
Taskfile grows.

Signed-off-by: Evan Wies <evan@neomantra.net>

* fix: expose Required params to Anthropic client

Signed-off-by: Evan Wies <evan@neomantra.net>

* fix: typo in cla.yml  precomment -> prcomment

Signed-off-by: Evan Wies <evan@neomantra.net>

---------

Signed-off-by: Evan Wies <evan@neomantra.net>

Change summary

.github/workflows/cla.yml          | 2 +-
Taskfile.yaml                      | 9 +++++++++
internal/llm/provider/anthropic.go | 2 +-
3 files changed, 11 insertions(+), 2 deletions(-)

Detailed changes

.github/workflows/cla.yml 🔗

@@ -31,6 +31,6 @@ jobs:
           branch: "main"
           allowlist: charmcli,charmcrush,dependabot[bot]
           custom-pr-sign-comment: "I have read the Contributor License Agreement (CLA) and hereby sign the CLA."
-          custom-notsigned-precomment: "Thank you for your submission. We really appreciate it! Like many open-source projects, we ask that you sign our [Contributor License Agreement](https://github.com/charmbracelet/crush/blob/main/CLA.md) before we can accept your contribution. You can sign the CLA by just posting a Pull Request comment same as the below format."
+          custom-notsigned-prcomment: "Thank you for your submission. We really appreciate it! Like many open-source projects, we ask that you sign our [Contributor License Agreement](https://github.com/charmbracelet/crush/blob/main/CLA.md) before we can accept your contribution. You can sign the CLA by just posting a Pull Request comment same as the below format."
           lock-pullrequest-aftermerge: false
           signed-commit-message: "chore(legal): @$contributorName has signed the CLA"

Taskfile.yaml 🔗

@@ -28,6 +28,13 @@ tasks:
     env:
       GOEXPERIMENT: null
 
+  build:
+    desc: Run build
+    cmds:
+      - go build .
+    generates:
+      - crush
+
   test:
     desc: Run tests
     cmds:
@@ -70,3 +77,5 @@ tasks:
     cmds:
       - go run main.go schema > schema.json
       - echo "Generated schema.json"
+    generates:
+      - schema.json

internal/llm/provider/anthropic.go 🔗

@@ -178,7 +178,7 @@ func (a *anthropicClient) convertTools(tools []tools.BaseTool) []anthropic.ToolU
 			Description: anthropic.String(info.Description),
 			InputSchema: anthropic.ToolInputSchemaParam{
 				Properties: info.Parameters,
-				// TODO: figure out how we can tell claude the required fields?
+				Required:   info.Required,
 			},
 		}