Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

Tool configuration types (GitHubToolName, GitHubAllowedTools, etc.) provide compile-time safety but were undocumented. Additionally, interface{} remained in production code despite Go 1.18+ any being standard.

Changes

specs/go-type-patterns.md

  • Added "Tool Configuration Types" section documenting typed slice pattern:
    // Semantic type + typed slice with conversion helpers
    type GitHubToolName string
    type GitHubAllowedTools []GitHubToolName
    
    func (g GitHubAllowedTools) ToStringSlice() []string { ... }
  • Documented typed slices vs []any decision criteria
  • Added before/after migration examples showing benefits
  • Updated summary tables with tool configuration domain

pkg/workflow/copilot_logs.go

  • Replaced map[string]interface{}map[string]any (2 occurrences)

AGENTS.md

  • Added pkg/workflow semantic types section listing tool configuration types
Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Document type pattern guidelines and complete migration</issue_title>
<issue_description>## Objective

Document the new type patterns established by the previous issues and complete any remaining interface{} to any migrations for consistency.

Context

From discussion #10816: After implementing typed slices for tool configurations, we need to:

  1. Document the new patterns in the codebase
  2. Complete the migration from interface{} to any for Go 1.18+ consistency
  3. Update specs/go-type-patterns.md with examples from the refactoring

Approach

  1. Update specs/go-type-patterns.md:

    • Add examples of semantic types for tool configurations (BashCommand, GitHubToolName, etc.)
    • Document when to use typed slices vs []any
    • Show before/after examples from the refactoring
  2. Update AGENTS.md if needed:

    • Reference the new semantic types in pkg/constants or pkg/workflow
    • Update type pattern guidance
  3. Search for remaining interface{} usages:

    grep -r "interface{}" pkg/ --include="*.go" | grep -v "_test.go"
  4. Replace interface{} with any where appropriate:

    • Focus on non-test files
    • Keep legitimate uses in test files (acceptable)
    • Exclude cases where interface{} is required for reflection
  5. Run full test suite to verify changes

Files to Modify

  • Update: specs/go-type-patterns.md (add semantic type examples)
  • Update: AGENTS.md (if needed for type pattern guidance)
  • Update: Any files with interface{}any changes
  • Review: All pkg/*.go files for interface{} usage

Acceptance Criteria

  • specs/go-type-patterns.md includes examples of semantic types from tool configuration
  • Guidance on when to use typed slices vs []any is documented
  • Remaining interface{} in non-test files are migrated to any
  • All existing tests pass
  • Run make agent-finish successfully before committing

AI generated by Plan Command for discussion #10816

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Add tool configuration type examples to go-type-patterns.md
  - Document GitHubToolName and GitHubAllowedTools typed slices
  - Add before/after migration examples
  - Explain when to use typed slices vs []any
- Update AGENTS.md to reference tool configuration types
- Replace interface{} with any in copilot_logs.go
- Update summary tables with tool configuration examples

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Document type pattern guidelines and complete migration Document typed slice patterns and complete interface{} migration Jan 21, 2026
Copilot AI requested a review from mnkiefer January 21, 2026 00:12
@pelikhan pelikhan marked this pull request as ready for review January 21, 2026 00:26
@pelikhan pelikhan merged commit c9de305 into main Jan 21, 2026
136 checks passed
@pelikhan pelikhan deleted the copilot/document-type-pattern-guidelines branch January 21, 2026 00:33
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.

[plan] Document type pattern guidelines and complete migration

3 participants