Skip to content

refactor: remove obsolete code and compatibility paths - #20

Open
guilimao wants to merge 1 commit into
NERDSORG:mainfrom
guilimao:main
Open

refactor: remove obsolete code and compatibility paths#20
guilimao wants to merge 1 commit into
NERDSORG:mainfrom
guilimao:main

Conversation

@guilimao

@guilimao guilimao commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

清理未被引用的孤儿代码和兼容路径,删除已经完成的历史设计文档

Summary by Sourcery

Remove obsolete compatibility paths and unused project artifacts while standardizing shared tool caching and tightening build configuration.

Enhancements:

  • Remove unused code, deprecated compatibility APIs, obsolete types, imports, and legacy design documents across the application.
  • Consolidate tool-result caching behind a shared execution helper and adopt the current options-based agent tool-set API.
  • Use Express's built-in JSON middleware and simplify controller and sidebar interfaces.

Build:

  • Remove unused runtime dependencies and update the lockfile accordingly.
  • Enable TypeScript unused-local checks and remove type-check steps from CI and release workflows.

Documentation:

  • Update agent type design documentation for the current tool-set creation interface and remove completed historical design documents.

Tests:

  • Add coverage for enabled, disabled, and failed-operation tool-cache behavior.

Chores:

  • Clean up dependency and third-party license lists to reflect removed packages.

@MalachiteN

Copy link
Copy Markdown
Collaborator

@sourcery-ai review

@sourcery-ai

sourcery-ai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Reviewer's Guide

This refactor removes orphaned code, legacy compatibility APIs, unused dependencies, and completed design documents; it also standardizes tool-cache execution, tightens several constructor and context APIs, enables unused-local detection, and adds cache behavior tests while simplifying CI checks.

Sequence diagram for unified tool-cache execution

sequenceDiagram
    participant Caller
    participant ToolManager
    participant ToolExecutor
    participant Cache
    participant ToolSet

    Caller->>ToolManager: executeTool(name, args, context)
    ToolManager->>Cache: executeWithToolCache(name, args, shouldCache, operation)
    alt cached result
        Cache-->>ToolManager: cached result
    else cache miss or caching disabled
        Cache->>ToolSet: execute(name, args, context)
        ToolSet-->>Cache: result
        Cache-->>ToolManager: result
    end

    Caller->>ToolExecutor: executeToolCall(...)
    ToolExecutor->>Cache: executeWithToolCache(name, args, shouldCache, operation)
    Cache->>ToolSet: execute(name, args, context)
    ToolSet-->>Cache: result
    Cache-->>ToolExecutor: result
Loading

File-Level Changes

Change Details Files
Remove unused source code, interfaces, imports, compatibility wrappers, and completed design documents.
  • Delete obsolete adapter, agent, HTTP, utility, and metadata types/helpers.
  • Remove deprecated MCP, approval, tool-cache, and agent-tool-set compatibility APIs.
  • Delete completed historical design documents and update agent tool-set API references.
docs/.multi-provider-final-target.md
docs/tool-rename-plan.md
docs/AGENT_TYPES_DESIGN.md
docs/AGENT_TYPES_DESIGN_CN.md
src/adapters/interfaces.ts
src/adapters/types.ts
src/agent/agentOrchestrator.ts
src/agent/types.ts
src/agent/utils.ts
src/httpServer/stop.ts
src/httpServer/types.ts
src/mcp/registry.ts
src/notebook/serializer.ts
src/tools.d/permission.ts
src/tools.d/toolManager.ts
src/utils.ts
Consolidate tool-result caching behind a single execution helper and add focused tests.
  • Replace duplicated cache lookup/store logic in tool execution paths with executeWithToolCache.
  • Preserve disabled-cache, successful-result reuse, and rejected-operation retry behavior.
  • Make cache key generation internal and rename cache clearing to the unified API.
src/agent/toolExecutor.ts
src/tools.d/cache.ts
src/tools.d/toolManager.ts
tests/toolCache.test.ts
Tighten APIs and implementation dependencies after the cleanup.
  • Remove obsolete controller, notebook, sidebar, tool-context, and provider state parameters and fields.
  • Adopt express.json instead of body-parser and remove unused package dependencies.
  • Enable noUnusedLocals in TypeScript configuration.
src/agent/agentOrchestrator.ts
src/controller.ts
src/extension.ts
src/httpServer/index.ts
src/sidebar/agentSidebar.ts
src/sidebar/contextTreeProvider.ts
src/tools.d/interface.ts
src/package.json
package.json
package-lock.json
tsconfig.json
Remove CI type-check steps while retaining compilation and release packaging.
  • Drop check-types from CI and release workflows.
  • Keep compile as the workflow validation step and preserve release artifact configuration.
.github/workflows/ci.yml
.github/workflows/release.yml
Synchronize dependency documentation and clean residual unused imports and locals.
  • Remove partial-json and body-parser from both README dependency tables.
  • Remove unused imports, variables, and helper functions across RAG, context, LLM, registry, notebook, and tool modules.
README.md
README_zh.md
src/codebase/rag/service.ts
src/codebase/rag/utils.ts
src/config/loader.ts
src/config/types.ts
src/contextManagement/skillManager.ts
src/contextManagement/utils.ts
src/agent/agentRunner.ts
src/agent/titleGenerator.ts
src/httpServer/agents.ts
src/httpServer/chat.ts
src/llm/providerService.ts
src/notebook/completionProvider.ts
src/registry/agentTypeRegistry.ts
src/registry/toolSetRegistry.ts
src/sidebar/agentTreeProvider.ts
src/tools.d/tools/agent_control.ts
src/tools.d/tools/diagnostics.ts
src/tools.d/tools/system_info.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. This changes the release and CI gates while removing several compatibility APIs and refactoring shared tool-cache behavior. If the removed type check or compatibility paths were still needed, a broken release could be published or downstream callers could fail; reverting fixes future runs but does not undo an already-published artifact or its effects.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

2 participants