Repository navigation
[dead-code] chore: remove dead functions — 4 functions removed - #67443
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
|
✅ 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).
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review. Reviewed PR #67443; using noop while testing write bridge availability.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
There was a problem hiding this comment.
🟡 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
| 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) } |
| @@ -37,11 +37,6 @@ func RenderStructStdout(v any) string { | |||
| return renderStructWithRenderer(v, RenderTableStdout) | |||
| } | |||
|
|
|||
| } | ||
| } | ||
|
|
||
| func TestModelIdentityResolverFoldsAliasAndDatedIDs(t *testing.T) { |
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
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…
There was a problem hiding this comment.
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 underpkg/linters/consolestderr/testdatathat independently re-declares a same-named no-op function for linter fixture purposes. - Re-ran the surviving tests in
pkg/consoleandpkg/clitouching the modified files (TestRenderStructStderrWidthBudget,TestDeclaredExperimentalSubagentModelAudit,TestModelIdentityResolverFoldsAliasAndDatedIDs,TestDeclaredSubagentModelsExcludeDetectionUsage) — all pass. - The removed test assertions (
TestMatchesDeclaredModelEffectiveIDs, and the single assertions inTestDeclaredSubagentModelsExcludeDetectionUsage/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.mdcorrectly 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


Caution
Protected files were modified in this change.
This pull request is in
request-reviewmode and requires explicit human scrutiny before merge.Protected files:
README.mdFunctions Removed
Tests Removed
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