Repository navigation
chore: remove dead exported symbols in internal/ (#119) - #128
Conversation
An AST cross-reference found 18 exported symbols in internal/ with no references anywhere in the module, in tests, or from Yaegi extensions. - app: RunOnce, RunOnceResult (thin wrappers over *WithFiles variants) - agent: GenerateWithLoop, GetSystemPrompt - ui: SetItemGap, ItemGap, AtTop, ScrollPercent, SelectedItem, PendingImageCount, SetCurrentPath - message: AddPart, AddToolCall - session: GetCwd, AddLLMMessages, ValidateParentChain - tools: SetOAuthFlow, GetConnectionStats, TaskConfig, SetOnResourcesChanged, RefreshServerResources - extensions: SubscribeCustomEvent - core: DefaultMaxLineLen alias (private constant kept) Also drop two private fields that became write-only once their setters were removed: MCPToolManager.onResourcesChanged and Runner.customEventSubs. Extension handlers registered via api.OnCustomEvent are unaffected. Fixes #119
|
Connected to Huly®: KIT-129 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (14)
💤 Files with no reviewable changes (9)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change removes unused exported symbols and legacy wrappers from internal packages. Non-interactive execution documentation now uses file-aware APIs. Custom event, tool manager, session, message, and UI APIs are reduced without replacing their remaining internal behavior. ChangesInternal API cleanup
Estimated code review effort: 2 (Simple) | ~15 minutes Merge Risk: ⚪ Minimal · up to This change removes unused internal APIs while retaining the supported file-aware execution, extension event registration, and OAuth retry paths. No merge-blocking production risk is currently identified. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Removes 18 exported symbols under
internal/that have no references anywhere in the module — not in non-test code, not in tests, and not reachable from Yaegi extensions (which only see thekit/ext/extnamespace). Each symbol was verified with a grep acrossinternal/,pkg/, andcmd/before deletion; the only hits were the declarations and their own doc comments.Two private fields became write-only once their setters were removed, so they are dropped as well:
MCPToolManager.onResourcesChangedandRunner.customEventSubs.EmitCustomEventnow dispatches only to handlers registered viaapi.OnCustomEvent, which is the only path that was ever populated — extension behaviour is unchanged.Doc comments that referenced the removed names (
NewAgent,App,GetClients,runNonInteractiveModeApp) now point to the surviving alternatives.Fixes #119
Type of Change
Removed symbols
internal/appRunOnce,RunOnceResultinternal/agentGenerateWithLoop,GetSystemPromptinternal/uiSetItemGap,ItemGap,AtTop,ScrollPercent,SelectedItem,PendingImageCount,SetCurrentPathinternal/messageAddPart,AddToolCallinternal/sessionGetCwd,AddLLMMessages,ValidateParentChaininternal/toolsSetOAuthFlow,GetConnectionStats,TaskConfig,SetOnResourcesChanged,RefreshServerResourcesinternal/extensionsSubscribeCustomEventinternal/coreDefaultMaxLineLen(exported alias; privatedefaultMaxLineLenkept)Out of scope, per the issue:
daemon/tunnel.goStatusCh/Exited,agent.GetExtraToolCount,app.RunOnceWithDisplay.Checklist
gofmt,go vetclean)go test -race ./...passesgolangci-lint runreports 0 issuesinternal/only)Additional Information
pkg/kit/or any public SDK surfaceSummary by CodeRabbit
Bug Fixes
Documentation