Skip to content

Conversation

@triepod-ai
Copy link

Summary

Adds DestructiveHint: true annotation to the delete_project_item tool to be consistent with other delete operations that properly indicate destructive behavior.

Changes

  • Added DestructiveHint: jsonschema.Ptr(true) to delete_project_item tool in pkg/github/projects.go
  • Aligned field formatting for consistency

Why This Matters

The delete_project_item tool permanently removes a project item, making it a destructive operation. Other delete tools in the codebase (delete_file, delete_workflow_run_logs) correctly have this annotation set. This ensures LLMs receive consistent semantic metadata about tool behavior:

Tool Current Annotations
delete_file ReadOnlyHint: false, DestructiveHint: true
delete_workflow_run_logs ReadOnlyHint: false, DestructiveHint: true
delete_project_item ReadOnlyHint: false ❌ → Fixed

Testing

  • Code follows existing annotation patterns in the codebase
  • Uses same jsonschema.Ptr(true) pattern as other destructive tools

🤖 Generated with Claude Code

Add DestructiveHint: true to the delete_project_item tool to be
consistent with other delete operations (delete_file and
delete_workflow_run_logs) that properly indicate destructive behavior.

This helps LLMs better understand that this tool permanently removes
data and should be used with appropriate caution.

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings December 21, 2025 17:48
@triepod-ai triepod-ai requested a review from a team as a code owner December 21, 2025 17:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the DestructiveHint: true annotation to the delete_project_item tool to properly indicate its destructive behavior, maintaining consistency with other delete operations in the codebase like delete_file and delete_workflow_run_logs.

Key Changes:

  • Added DestructiveHint: jsonschema.Ptr(true) to delete_project_item tool annotations
  • Aligned annotation field formatting for consistency (Title, ReadOnlyHint, DestructiveHint)

Comment on lines +903 to +905
Title: t("TOOL_DELETE_PROJECT_ITEM_USER_TITLE", "Delete project item"),
ReadOnlyHint: false,
DestructiveHint: jsonschema.Ptr(true),
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The toolsnap file for delete_project_item needs to be updated to reflect the addition of DestructiveHint. After making this code change, you need to run UPDATE_TOOLSNAPS=true go test ./... to update the snapshot file at pkg/github/toolsnaps/delete_project_item.snap. The snapshot should include "destructiveHint": true in the annotations object, similar to delete_file.snap and delete_workflow_run_logs.snap. The updated snapshot file must be committed along with this code change.

Copilot uses AI. Check for mistakes.
Add destructiveHint: true to the snapshot file to match the code change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@triepod-ai
Copy link
Author

Thanks for the review feedback! I've run UPDATE_TOOLSNAPS=true go test ./pkg/github/... -run DeleteProjectItem and committed the updated snapshot file with the destructiveHint: true annotation.

The snapshot at pkg/github/__toolsnaps__/delete_project_item.snap now matches the code change.

Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this, this was a good spot.

@SamMorrowDrums SamMorrowDrums merged commit 6c0bbb8 into github:main Dec 22, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants