Skip to content

chore: remove dead exported symbols in internal/ (#119) - #128

Merged
ezynda3 merged 1 commit into
masterfrom
chore/119-remove-dead-internal-symbols
Sep 8, 2026
Merged

ezynda3 merged 1 commit into
masterfrom
chore/119-remove-dead-internal-symbols

Conversation

@ezynda3

@ezynda3 ezynda3 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

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 the kit/ext/ext namespace). Each symbol was verified with a grep across internal/, pkg/, and cmd/ 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.onResourcesChanged and Runner.customEventSubs. EmitCustomEvent now dispatches only to handlers registered via api.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

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Chore / cleanup

Removed symbols

Package Symbols
internal/app RunOnce, RunOnceResult
internal/agent GenerateWithLoop, GetSystemPrompt
internal/ui SetItemGap, ItemGap, AtTop, ScrollPercent, SelectedItem, PendingImageCount, SetCurrentPath
internal/message AddPart, AddToolCall
internal/session GetCwd, AddLLMMessages, ValidateParentChain
internal/tools SetOAuthFlow, GetConnectionStats, TaskConfig, SetOnResourcesChanged, RefreshServerResources
internal/extensions SubscribeCustomEvent
internal/core DefaultMaxLineLen (exported alias; private defaultMaxLineLen kept)

Out of scope, per the issue: daemon/tunnel.go StatusCh/Exited, agent.GetExtraToolCount, app.RunOnceWithDisplay.

Checklist

  • Code follows the project style (gofmt, go vet clean)
  • Self-reviewed the diff
  • go test -race ./... passes
  • golangci-lint run reports 0 issues
  • Tests added (none needed — deletion only)
  • Docs updated (no public surface changed; internal/ only)

Additional Information

  • 14 files changed, +13 / −325
  • No changes to pkg/kit/ or any public SDK surface
  • No behaviour change for extensions or the CLI

Summary by CodeRabbit

  • Bug Fixes

    • Quiet, non-interactive runs now correctly include attached files when sending requests to the agent.
    • File-aware execution is now used consistently, whether or not attachments are provided.
  • Documentation

    • Updated non-interactive execution guidance to reflect the current file-capable workflow.

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
@mark-iii-labs-huly

Copy link
Copy Markdown

Connected to Huly®: KIT-129

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 9e642577-5fc0-42da-9cf3-01a995571456

📥 Commits

Reviewing files that changed from the base of the PR and between e217d6b and a6eb881.

📒 Files selected for processing (14)
  • cmd/root.go
  • internal/agent/agent.go
  • internal/app/app.go
  • internal/core/truncate.go
  • internal/extensions/runner.go
  • internal/message/content.go
  • internal/session/tree_manager.go
  • internal/session/tree_validation.go
  • internal/tools/connection_pool.go
  • internal/tools/mcp.go
  • internal/ui/input.go
  • internal/ui/popup_list.go
  • internal/ui/scrolllist.go
  • internal/ui/session_selector.go
💤 Files with no reviewable changes (9)
  • internal/ui/input.go
  • internal/ui/popup_list.go
  • internal/ui/session_selector.go
  • internal/ui/scrolllist.go
  • internal/core/truncate.go
  • internal/session/tree_validation.go
  • internal/message/content.go
  • internal/session/tree_manager.go
  • internal/tools/mcp.go

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

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

Changes

Internal API cleanup

Layer / File(s) Summary
Execution API cleanup
cmd/root.go, internal/app/app.go, internal/agent/agent.go
Quiet execution documentation now uses RunOnceWithFiles. Legacy RunOnce, RunOnceResult, and GenerateWithLoop APIs are removed.
Session and message cleanup
internal/session/*, internal/message/content.go, internal/core/truncate.go
Unused session accessors, the batch message bridge, message mutation helpers, parent-chain validation export, and DefaultMaxLineLen are removed.
Tool and extension cleanup
internal/extensions/runner.go, internal/tools/*
Dynamic custom-event subscriptions, connection statistics, OAuth replacement, resource refresh callbacks, and task configuration accessors are removed.
UI accessor cleanup
internal/ui/*
Unused input, popup-list, scroll-list, and session-selector accessors are removed. Existing UI state and rendering logic remain.
Documentation updates
internal/app/app.go, cmd/root.go
Documentation references the remaining file-aware and display execution APIs.

Estimated code review effort: 2 (Simple) | ~15 minutes

Merge Risk: ⚪ Minimal · up to a6eb8

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: mge1512

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: removing unused exported symbols from internal packages.
Linked Issues check ✅ Passed The changes implement the deletion of the issue-listed dead exported symbols and related write-only private fields in [#119]. The explicitly out-of-scope symbols remain unchanged.
Out of Scope Changes check ✅ Passed All changes support [#119], including updating callers and documentation after symbol removal. No unrelated or explicitly out-of-scope changes are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/119-remove-dead-internal-symbols

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ezynda3
ezynda3 merged commit 20cf530 into master Sep 8, 2026
4 checks passed
@ezynda3
ezynda3 deleted the chore/119-remove-dead-internal-symbols branch September 8, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: remove 18 dead exported symbols in internal/

1 participant