Repository navigation
refactor: remove unused wrappers and isolate test helpers - #4823
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for this API-surface cleanup.
No open issues 🎉
What changed in this PR
This refactor reduces docker-agent’s production API surface by removing unused wrappers and moving test-only helpers into test files. Tests now call the underlying production entry points directly.
Changes:
- Remove redundant wrappers and the unused concurrent
ForEachhelper. - Isolate clock, ID, logging, and telemetry test helpers.
- Preserve image-chunking coverage and add tests for configured log-backup limits.
| File | Description |
|---|---|
pkg/tui/image/image_test.go |
Relocate Kitty payload-chunking coverage here. |
pkg/tui/components/messages/selection_test.go |
Test selection using NewFastRenderer directly. |
pkg/tui/components/message/styled_lines_test.go |
Use NewFastRenderer in tests and benchmarks. |
pkg/tui/components/markdown/renderer.go |
Remove the redundant renderer constructor. |
pkg/telemetry/genai/stability.go |
Remove the production-exposed test reset helper. |
pkg/telemetry/genai/stability_test.go |
Define and use a local stability-reset helper. |
pkg/teamloader/teamloader_test.go |
Call RequiredEvaluatorEnvVars directly. |
pkg/skills/expand.go |
Remove the error-discarding expansion wrapper. |
pkg/skills/expand_test.go |
Test error-returning expansion directly. |
pkg/session/session.go |
Remove test-only clock and ID options. |
pkg/session/clock_test.go |
Define clock and ID options locally. |
pkg/promptfiles/lookup.go |
Remove the unused exported lookup wrapper. |
pkg/promptfiles/lookup_test.go |
Check internal lookup results and errors. |
pkg/logging/rotate.go |
Remove test-only rotation option constructors. |
pkg/logging/rotate_test.go |
Localize options and test backup limits. |
pkg/leantui/ui/image.go |
Remove the Kitty sequence wrapper. |
pkg/leantui/ui/image_test.go |
Remove coverage relocated to the image package. |
pkg/httpclient/safeclient.go |
Remove the private-IP client convenience wrapper. |
pkg/httpclient/safeclient_test.go |
Test the configurable client factory directly. |
pkg/creator/agent.go |
Remove the redundant Agent loader wrapper. |
pkg/creator/agent_test.go |
Test Load and its returned team directly. |
pkg/config/gather.go |
Remove the evaluator-environment wrapper. |
pkg/config/evaluators_test.go |
Use direct credential gathering with gateway options. |
pkg/concurrent/mapslice.go |
Remove unused concurrent ForEach. |
pkg/concurrent/mapslice_test.go |
Remove the deleted helper’s test. |
pkg/cli/runner.go |
Update comments to name the metadata-aware attachment function. |
pkg/chat/image.go |
Remove the unused base64 resize wrapper. |
pkg/chat/image_test.go |
Remove the deleted resize wrapper’s test. |
pkg/chat/attach.go |
Remove the attachment wrapper and consolidate documentation. |
pkg/chat/attach_test.go |
Exercise ProcessAttachmentWithMetadata directly. |
Review effort: Balanced
trungutt
approved these changes
Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
task build,task test,task lint