Skip to content

docs: add panic contract doc comment to prepareClaudeToolsForAllowedList - #48984

Merged
pelikhan merged 2 commits into
mainfrom
copilot/add-missing-panic-doc-contract
Jul 29, 2026
Merged

docs: add panic contract doc comment to prepareClaudeToolsForAllowedList#48984
pelikhan merged 2 commits into
mainfrom
copilot/add-missing-panic-doc-contract

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

prepareClaudeToolsForAllowedList panics on an invariant violation but lacked a doc comment describing this contract, relying solely on the BUG: message prefix to satisfy the panicinlibrarycode linter. Other exempted panic sites in the repo use explicit "Panics if …" doc comments.

Changes

  • pkg/workflow/claude_tools.go — adds a doc comment to prepareClaudeToolsForAllowedList using the "Panics if" phrasing per repo convention:
// prepareClaudeToolsForAllowedList expands neutral tool definitions into Claude-specific
// format. Panics if tools already contains a "claude" section key, since callers must only
// ever pass neutral tool definitions at this stage (an internal invariant violation).
func (e *ClaudeEngine) prepareClaudeToolsForAllowedList(tools map[string]any) map[string]any {

No behavior change.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add missing panic doc contract to prepareClaudeToolsForAllowedList docs: add panic contract doc comment to prepareClaudeToolsForAllowedList Jul 29, 2026
Copilot AI requested a review from pelikhan July 29, 2026 22:01
@pelikhan
pelikhan marked this pull request as ready for review July 29, 2026 22:02
Copilot AI review requested due to automatic review settings July 29, 2026 22:02
@pelikhan
pelikhan merged commit b349dcd into main Jul 29, 2026
@pelikhan
pelikhan deleted the copilot/add-missing-panic-doc-contract branch July 29, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds the missing panic contract documentation for prepareClaudeToolsForAllowedList, resolving #48969 without changing behavior.

Changes:

  • Documents the method’s purpose and panic condition.
  • Uses the repository’s established “Panics if” convention.
Show a summary per file
File Description
pkg/workflow/claude_tools.go Adds the panic contract doc comment.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Medium

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.

[Code Quality] Add missing panic doc contract to prepareClaudeToolsForAllowedList

3 participants