Skip to content

[dead-code] chore: remove dead functions — 4 functions removed - #67443

Merged
pelikhan merged 1 commit into
mainfrom
chore/remove-dead-functions-38059215038-950f0cc37d35b03e
Oct 10, 2026
Merged

pelikhan merged 1 commit into
mainfrom
chore/remove-dead-functions-38059215038-950f0cc37d35b03e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Caution

Protected files were modified in this change.
This pull request is in request-review mode and requires explicit human scrutiny before merge.

Protected files: README.md

Functions Removed

Function File
matchesDeclaredModel pkg/cli/token_usage_declared_subagents.go
FormatPromptMessageStderr pkg/console/destination_aliases.go
FormatVerboseMessageStderr pkg/console/destination_aliases.go
RenderStructStderr pkg/console/render.go

Tests Removed

  • TestMatchesDeclaredModelEffectiveIDs (exclusive test)
  • Single assertions referencing removed functions in TestDeclaredSubagentModelsExcludeDetectionUsage and TestRenderStructStderrWidthBudget

Verification

  • go build ./...
  • go vet ./... (pkg/cli, pkg/console)
  • go vet -tags=integration ./... (pkg/cli, pkg/console)
  • make fmt (JS prettier unavailable in sandbox; gofmt clean)

https://github.com/github/gh-aw/actions/runs/38059215038

Generated by 🧹 Dead Code Removal Agent · copilot · auto · 26.2 AIC · ⌖ 0.851 AIC · ⊞ 9.8K · ◷

  • expires on Oct 13, 2026, 6:30 AM UTC-08:00

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@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.

Protected files were modified in this pull request and require manual scrutiny before merge.

Please verify that each protected-file change is intentional, policy-compliant, and safe:

  • Protected files: README.md

@pelikhan
pelikhan marked this pull request as ready for review October 10, 2026 14:39
Copilot AI balanced review requested due to automatic review settings October 10, 2026 14:39
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #67443

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed for PR #67443: no 'implementation' label and 0 new lines in default business logic directories (threshold 100, 6 files changed, no custom .design-gate.yml).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 10, 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 Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ PR Code Quality Reviewer completed the code quality review.

Reviewed PR #67443; using noop while testing write bridge availability.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@pelikhan
pelikhan merged commit 77122d8 into main Oct 10, 2026
72 of 86 checks passed
@pelikhan
pelikhan deleted the chore/remove-dead-functions-38059215038-950f0cc37d35b03e branch October 10, 2026 14:42

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.

🟡 Changes recommended

It breaks documented public APIs and removes unique model-matching coverage.

3 open findings
What changed in this PR

Removes four functions identified as dead code and updates related tests and API documentation.

Changes:

  • Removes one model-matching wrapper and associated tests.
  • Removes three exported console compatibility APIs.
  • Updates console documentation and width tests.
File Description
pkg/​cli/​token_usage_declared_subagents.go Removes the model-matching wrapper.
pkg/​cli/​token_usage_declared_subagents_test.go Removes wrapper-specific coverage.
pkg/​console/​README.md Removes two API entries.
pkg/​console/​destination_aliases.go Removes two stderr aliases.
pkg/​console/​render.go Removes stderr struct rendering API.
pkg/​console/​table_width_test.go Removes the deleted renderer assertion.

🧠 Review effort: Balanced

Comment on lines 9 to 10
func FormatProgressMessageStderr(message string) string { return FormatProgressMessage(message) }
func FormatPromptMessageStderr(message string) string { return FormatPromptMessage(message) }
func FormatVerboseMessageStderr(message string) string { return FormatVerboseMessage(message) }
func FormatListItemStderr(item string) string { return FormatListItem(item) }
Comment thread pkg/console/render.go
@@ -37,11 +37,6 @@ func RenderStructStdout(v any) string {
return renderStructWithRenderer(v, RenderTableStdout)
}

}
}

func TestModelIdentityResolverFoldsAliasAndDatedIDs(t *testing.T) {
@github-actions

Copy link
Copy Markdown
Contributor Author

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-10T14:42:44Z
review_event: REQUEST_CHANGES
top_themes:
- exported-pkg-console-api-removal
- public-api-docs-and-fixtures-out-of-sync
- lost-provider-normalization-regression-coverage
files_reviewed:
- pkg/cli/token_usage_declared_subagents.go
- pkg/cli/token_usage_declared_subagents_test.go
- pkg/console/README.md
- pkg/console/destination_aliases.go
- pkg/console/render.go
- pkg/console/table_width_test.go
comment_count: 3

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 45.8 AIC · ⌖ 5.76 AIC · ⊞ 20K · ◷
Comment /review to run again

@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.

Requesting changes: this removes exported pkg/console API wrappers that are still documented as public surface and also drops targeted provider-normalization regression coverage in token usage tests.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 45.8 AIC · ⌖ 5.76 AIC · ⊞ 20K
Comment /review to run again

Comments that could not be inline-anchored

pkg/console/destination_aliases.go:10

Removing these exported wrappers is a breaking pkg/console API change, so callers using the documented FormatPromptMessageStderr or FormatVerboseMessageStderr helpers will stop compiling.

<details><summary>💡 Why this blocks merge</summary>

These are exported compatibility aliases, not private implementation details, and pkg/console/README.md still documents the stderr entry points as public API. A dead-code sweep inside this repo is not enough evidence that external imports do not ex…

pkg/console/render.go:41

Deleting RenderStructStderr is another source-breaking API removal, and this PR already shows the symbol is still part of the supported surface because the package README and the consolestderr linter fixture both still refer to it.

<details><summary>💡 Why this blocks merge</summary>

If a function is still documented and still mirrored in compatibility testdata, it is not safely proven dead. Removing it here turns a cleanup PR into an unannounced breaking change for downstream imports and…

pkg/cli/token_usage_declared_subagents_test.go:461

This drops the only regression check that pins provider-qualified OpenRouter aliases against observed Anthropic model IDs, so a future tweak to resolver.matches can silently break subagent attribution without a failing test.

<details><summary>💡 Why this matters</summary>

The production code still calls resolver.matches(..., provider) from multiple attribution paths, so the provider-normalization behavior is not dead just because the local helper was removed. After this deletion, the suit…

@github-actions github-actions Bot mentioned this pull request Oct 10, 2026

@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 and /improve-codebase-architecture — no actionable issues found.

📋 Verification & Highlights

Verification performed

  • go build ./... — passes
  • Confirmed no remaining references to the 4 removed functions (matchesDeclaredModel, FormatPromptMessageStderr, FormatVerboseMessageStderr, RenderStructStderr) anywhere in the real codebase; the only hit is an unrelated golden-test stub under pkg/linters/consolestderr/testdata that independently re-declares a same-named no-op function for linter fixture purposes.
  • Re-ran the surviving tests in pkg/console and pkg/cli touching the modified files (TestRenderStructStderrWidthBudget, TestDeclaredExperimentalSubagentModelAudit, TestModelIdentityResolverFoldsAliasAndDatedIDs, TestDeclaredSubagentModelsExcludeDetectionUsage) — all pass.
  • The removed test assertions (TestMatchesDeclaredModelEffectiveIDs, and the single assertions in TestDeclaredSubagentModelsExcludeDetectionUsage/TestRenderStructStderrWidthBudget) were exclusively exercising the deleted functions; the underlying logic they called through (modelIdentityResolver.matches, RenderStructWithOptions) remains covered by other tests in the same files.
  • README row removals in pkg/console/README.md correctly track the deleted public API surface.

Positive Highlights

  • ✅ Removal is surgical — matching code, tests, and docs were deleted together with no orphaned references.
  • ✅ No remaining call sites or exported-API consumers found for the removed functions.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 108.4 AIC · ⌖ 15.4 AIC · ⊞ 10.3K
Comment /matt to run again

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.

2 participants