Skip to content

[dead-code] chore: remove dead functions — 5 functions removed - #52508

Merged
pelikhan merged 2 commits into
mainfrom
chore/remove-dead-code-modelsdev-e5db5e37fd1b9011
Aug 15, 2026
Merged

[dead-code] chore: remove dead functions — 5 functions removed#52508
pelikhan merged 2 commits into
mainfrom
chore/remove-dead-code-modelsdev-e5db5e37fd1b9011

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes unused pricing-catalog logic from pkg/modelsdev: the FindPricing public API, its supporting helpers (ensureCatalog, downloadAndParseCatalog, parseCatalog, parseCostMap), and the associated types/constants/vars (rawCatalog, rawProvider, rawModel, pricingCache, catalogCache, httpClientFactory, catalogURL, fetchTimeout, maxBodyBytes, pkgLog). These functions had no remaining callers. Corresponding unit and spec tests for the removed code were deleted along with the implementation.

Change Classification

  • Type: refactor
  • Scope: pkg/modelsdev
  • Breaking: No — FindPricing and its helpers were unused dead code; no external callers existed.

Key Changes

File Change Impact
pkg/modelsdev/catalog.go Removed FindPricing, ensureCatalog, downloadAndParseCatalog, parseCatalog, parseCostMap, and related types/vars/constants; trimmed now-unused imports High
pkg/modelsdev/catalog_test.go Removed tests for deleted functions (TestParseCatalog, TestParseCostMap, TestFindPricing); kept TestNormalizeProvider Medium
pkg/modelsdev/spec_test.go Removed spec tests validating FindPricing behavior and provider-alias handling via FindPricing; kept TestSpec_PublicAPI_NormalizeProvider Medium

Impact Assessment

  • No downstream impact identified — the removed functions had no remaining call sites in the codebase.
  • Reduces pkg/modelsdev surface area and removes now-unnecessary dependencies on net/http, encoding/json, io, context, strconv, time, pkg/logger, and pkg/syncutil from catalog.go.
  • Test suite shrinks proportionally; no behavioral regression expected since remaining tests (NormalizeProvider) are unaffected.

Commits

0883e5a3d Merge branch 'main' into chore/remove-dead-code-modelsdev-e5db5e37fd1b9011
eef4ff47a chore: remove dead functions in pkg/modelsdev
```> Generated by [PR Description Updater](https://github.com/github/gh-aw/actions/runs/31865472773) for #52508 · auto · 51 AIC · ⌖ 3.02 AIC · ⊞ 7.2K · [◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw+%22gh-aw-workflow-call-id%3A+github%2Fgh-aw%2Fpr-description-caveman%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: PR Description Updater, engine: copilot, model: auto, id: 31865472773, workflow_id: pr-description-caveman, run: https://github.com/github/gh-aw/actions/runs/31865472773 -->

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review August 13, 2026 17:39
Copilot AI balanced review requested due to automatic review settings August 13, 2026 17:39
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed test quality analysis.

No new or modified behavioral tests in this PR. PR #52508 is a dead code removal that deletes tests for 5 removed functions (TestParseCatalog, TestParseCostMap, TestFindPricing, TestSpec_PublicAPI_FindPricing, TestSpec_DesignDecision_ProviderAliases). Remaining tests in catalog_test.go and spec_test.go are unmodified. Test Quality Sentinel: No action required.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Ponytail Reviewer completed successfully!

Diff is a pure dead-code deletion (0 additions besides file headers, 396 deletions) with no new logic or abstractions introduced. Nothing to cut under a ponytail/over-engineering review.

Generated by Ponytail Reviewer for #52508

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (0 additions detected).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The PR cleanly removes 5 dead functions (FindPricing, ensureCatalog, downloadAndParseCatalog, parseCatalog, parseCostMap) along with all supporting types, variables, and their tests. No callers remain in the codebase. The removal is correct and complete.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 15 AIC · ⌖ 6.35 AIC · ⊞ 5.4K

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

Removes the models.dev pricing lookup implementation and its associated tests.

Changes:

  • Removes FindPricing and catalog download/parsing infrastructure.
  • Removes pricing-specific tests and fixtures.
  • Retains provider and model-ID normalization utilities.
Show a summary per file
File Description
pkg/modelsdev/catalog.go Removes pricing lookup and catalog handling.
pkg/modelsdev/catalog_test.go Removes pricing and parsing tests.
pkg/modelsdev/spec_test.go Removes pricing API specification tests.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread pkg/modelsdev/catalog.go
Comment on lines 3 to 4
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"strconv"
"strings"

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Request changes

This is not a safe dead-code removal as submitted: it deletes a documented public API and its entire behavior/tests without updating the package contract or the user-facing pricing story.

Blocking theme
  • pkg/modelsdev/README.md still documents FindPricing as public API and includes a usage example that no longer compiles after this PR.
  • The repository docs still describe AIC pricing as coming from the models.dev catalog, but this PR removes the implementation without showing the replacement path.
  • Because the change is pure deletion, there is no compensating migration note, deprecation path, or contract update here.

That makes this a breaking behavior/API change mislabeled as dead-code cleanup. The implementation can be removed, but only alongside the corresponding contract updates or an explicit replacement.

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 8.49 AIC · ⌖ 4.63 AIC · ⊞ 6.5K
Comment /review to run again

Comment thread pkg/modelsdev/catalog.go
@@ -1,222 +1,13 @@
package modelsdev

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removing this file’s entire pricing implementation without simultaneously updating the package contract leaves pkg/modelsdev/README.md and the public API spec claiming FindPricing still exists, which will break users and downstream automation that treat those docs/specs as authoritative.

💡 Update the contract docs or keep the API until callers are migrated

This PR deletes FindPricing and all of its behavior/tests, but the package README still documents FindPricing as part of the public API and still shows a compiling usage example. The repo also has broader docs that describe AIC pricing as being sourced from the models.dev catalog. If this removal is intentional, the docs/spec surface needs to be updated in the same change so consumers do not merge a broken contract.

Suggested follow-up in this PR:

- remove the `FindPricing` entry and example from `pkg/modelsdev/README.md`
- update any user-facing docs that describe gh-aw pricing lookup via models.dev
- explain the replacement source of pricing data in the PR body / changelog

Right now this is a breaking API deletion disguised as dead-code cleanup.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /codebase-design — clean dead-code removal, no actionable issues.

📋 Summary
  • ✅ All 5 removed functions have zero remaining callers
  • ✅ Tests removed in lock-step with the implementation
  • ✅ Supporting declarations fully pruned — no orphaned scaffolding
  • ✅ Build, vet, and fmt verified per the PR checklist

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 17.6 AIC · ⌖ 6.53 AIC · ⊞ 7K
Comment /matt to run again

@github-actions github-actions Bot mentioned this pull request Aug 13, 2026
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Quick triage for maintainer-ready follow-up:

Unresolved review threads (newest first):

Failed checks:

  • None listed in compact candidate set.

Please refresh the branch if needed, address the unresolved review feedback, rerun validation, and use the skill before handing back.

Run: https://github.com/github/gh-aw/actions/runs/31864810198

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 11.6 AIC · ⌖ 7.05 AIC · ⊞ 8.5K ·
Comment /souschef to run again

@pelikhan
pelikhan merged commit b672f6c into main Aug 15, 2026
@pelikhan
pelikhan deleted the chore/remove-dead-code-modelsdev-e5db5e37fd1b9011 branch August 15, 2026 04:51
Copilot stopped work on behalf of pelikhan due to an error August 15, 2026 04:51
Copilot AI requested a review from pelikhan August 15, 2026 04:51
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.86.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants