Skip to content

Remove unused files#1591

Draft
dimaMachina wants to merge 18 commits intomainfrom
remove-unused-files
Draft

Remove unused files#1591
dimaMachina wants to merge 18 commits intomainfrom
remove-unused-files

Conversation

@dimaMachina
Copy link
Copy Markdown
Collaborator

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 27, 2026

🦋 Changeset detected

Latest commit: d3df486

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@inkeep/agents-core Major
@inkeep/agents-sdk Major
@inkeep/agents-api Major
@inkeep/agents-cli Major
@inkeep/agents-manage-ui Major
@inkeep/agents-work-apps Major
@inkeep/ai-sdk-provider Major
@inkeep/create-agents Major
@inkeep/agents-manage-mcp Major
@inkeep/agents-mcp Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 5, 2026 3:21pm
agents-docs Ready Ready Preview, Comment Feb 5, 2026 3:21pm
agents-manage-ui Ready Ready Preview, Comment Feb 5, 2026 3:21pm

Request Review

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 27, 2026

Claude finished @dimaMachina's task —— View job


Code Review: Remove unused files

Todo List

  • Examine repository structure and understand codebase context
  • Analyze each deleted file for potential impacts
  • Review the new knip.config.ts configuration
  • Evaluate the major version bump strategy in changeset
  • Check for missing considerations or side effects
  • Provide comprehensive review feedback

Review Summary

This PR removes several unused files and adds tooling to detect unused code in the future. The changes are generally well-considered, but there are several important concerns that need attention.

🚨 Critical Issues

1. Breaking Change to agents-cli vitest configuration

agents-cli/vitest.config.ts:2 imports the deleted vitest.config.ci.ts file:

import vitestCIConfig from './vitest.config.ci';

Impact: This will cause the agents-cli package to fail to run tests, breaking CI/CD pipelines.

Recommendation: Update the vitest config to handle the missing CI config or provide an alternative solution.

2. Changeset Version Strategy Mismatch

The changeset in .changeset/neat-lies-attend.md uses minor bumps for file removals:

"@inkeep/agents-sdk": minor
"@inkeep/agents-api": minor  
"@inkeep/agents-cli": minor

Issue: According to the repo's CLAUDE.md semver guidelines:

  • Minor: Schema changes requiring migration, significant behavior changes
  • Patch: Bug fixes, additive features, non-breaking changes

Recommendation: File cleanup should be patch level unless removing files constitutes a breaking API change. The CLAUDE.md guidance states: "Major: Reserved - do not use without explicit approval" and typically file removals (if truly unused) should be patch-level changes.

⚠️ Moderate Concerns

3. Coverage Script Reference Still Exists

package.json:23 still references generate-badges.mjs which was deleted:

"coverage:badges": "node scripts/generate-badges.mjs"

Impact: Coverage workflow will fail when trying to generate badges.

Options:

  • Remove the script reference entirely if badges are no longer needed
  • Replace with an alternative badge generation solution
  • Keep a simplified version if badges are still required

4. Knip Configuration Scope

The new knip.config.ts has extensive ignore rules but may be missing some validation:

Considerations:

  • Large ignore list (30+ entries) may hide legitimate unused code issues
  • Consider whether some ignored paths could be cleaned up instead
  • The config looks comprehensive but should be validated against actual usage

Good Practices Observed

  1. Systematic Approach: Using knip to identify truly unused files
  2. Conservative Ignores: The knip config appropriately ignores template files, documentation, and tooling configs
  3. Clean Deletions: Removed files appear to be genuinely unused based on grep searches

Files Analyzed & Assessment

File Purpose Removal Justification Risk
.opencode/plugin/notification.js OpenCode IDE notifications ✅ IDE-specific, not core functionality Low
agents-api/src/__tests__/manage/utils/cleanup.ts Test utilities ✅ Likely unused test helper Low
agents-api/workflow-bootstrap.ts Workflow setup ⚠️ Could be infrastructure - verify not needed Medium
agents-cli/src/commands/pull-v3/__tests__/test-introspect-cli.ts Manual CLI test ✅ Manual test script, not automated test Low
vitest.config.ci.ts CI-specific test config 🚨 Still referenced in agents-cli High
agents-docs/src/lib/analytics/posthog-*.ts PostHog analytics ✅ No references found in codebase Low
packages/agents-sdk/example-project.ts SDK examples ✅ Example code, likely moved to cookbook Low
scripts/generate-badge.mjs Badge generation ⚠️ Still referenced in package.json Medium

Recommended Actions

  1. IMMEDIATE: Fix the breaking vitest import in agents-cli/vitest.config.ts
  2. IMMEDIATE: Update or remove the coverage:badges script reference
  3. CONSIDER: Downgrade changeset from minor to patch for most packages (unless APIs are affected)
  4. OPTIONAL: Validate the knip configuration catches genuinely unused files without being overly broad

Test Strategy Validation

The PR should be tested by:

  1. Running pnpm build across all packages to catch import issues
  2. Running pnpm test to ensure test configurations work
  3. Running pnpm coverage:badges to verify script references
  4. Running the new knip configuration to ensure it works as expected

@dimaMachina dimaMachina changed the base branch from main to simplify-autotypetable January 28, 2026 08:13
@dimaMachina
Copy link
Copy Markdown
Collaborator Author

@claude verify pr from scratch

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 28, 2026

Claude finished @dimaMachina's task in 4m 10s —— View job


PR Verification Complete

Todo List

  • Check for broken imports in agents-cli vitest config
  • Check coverage script references
  • Analyze changeset version strategy
  • Check what files are actually deleted in this PR
  • Verify knip configuration completeness
  • Identify any other broken references
  • Provide comprehensive verification summary

Verification Results

🚨 Critical Issues Found

1. Broken Import in agents-cli/vitest.config.ts

  • Issue: Line 2 imports vitestCIConfig from './vitest.config.ci' but vitest.config.ci.ts was deleted from the root
  • Impact: The agents-cli package vitest config will break when CI environment is detected (line 32)
  • Fix needed: Either restore the file or update the config to handle the missing import

2. Missing Script File Referenced in package.json

  • Issue: Lines 23 and 25 in package.json reference scripts/generate-badge.mjs which was deleted
  • Note: The file scripts/generate-badges.mjs (with 's') exists, but generate-badge.mjs was deleted
  • Impact: Coverage scripts may fail if they depend on the deleted file
  • Fix needed: Update references or ensure the correct file is used

⚠️ Version Strategy Concerns

3. Inappropriate Version Bumps in Changeset

The changeset uses minor version bumps for all packages:

"@inkeep/agents-core": minor
"@inkeep/agents-sdk": minor
"@inkeep/agents-api": minor
"@inkeep/agents-cli": minor

Issue: According to CLAUDE.md guidelines:

  • Minor: Schema changes requiring migration, significant behavior changes
  • Patch: Bug fixes, additive features, non-breaking changes

Recommendation: File cleanup should be patch level changes unless the removed files constitute breaking API changes

Verified Items

Files Successfully Deleted (21 files total):

  1. .opencode/plugin/notification.js - IDE-specific config ✓
  2. agents-api/src/__tests__/manage/utils/cleanup.ts - Unused test utility ✓
  3. agents-api/workflow-bootstrap.ts - Workflow setup file ✓
  4. agents-cli/src/commands/pull-v3/__tests__/test-introspect-cli.ts - Manual test ✓
  5. agents-cli/src/commands/pull-v3/utils/component-tracker.ts - Unused utility ✓
  6. agents-cli/src/exports.ts - Unused exports ✓
  7. agents-cli/src/types/agent.ts - Unused types ✓
  8. agents-cli/src/utils/file-finder.ts - Unused utility ✓
  9. agents-cli/src/utils/json-comparison.ts - Unused utility ✓
  10. agents-cli/src/utils/mcp-runner.ts - Unused utility ✓
  11. agents-cli/src/utils/profile-config.ts - Unused utility ✓
  12. agents-cli/src/utils/schema-introspection.ts - Unused utility ✓
  13. agents-docs/content/talk-to-your-agents/types.ts - Unused types ✓
  14. agents-docs/content/typescript-sdk/types.ts - Unused types ✓
  15. agents-docs/src/lib/analytics/posthog-events.ts - Analytics code ✓
  16. agents-docs/src/lib/analytics/posthog-server.ts - Analytics code ✓
  17. packages/agents-core/src/utils/tracer.ts - Unused tracer ✓
  18. packages/agents-sdk/example-project.ts - Example code ✓
  19. packages/agents-sdk/src/module-hosted-tool-manager.ts - Unused manager ✓
  20. scripts/generate-badge.mjs - Badge generation script ✓
  21. vitest.config.ci.ts - Root CI config ✓

References Check:

  • No imports found for any of the deleted files (except the known issues above)
  • Knip configuration appears comprehensive with appropriate ignores

📋 Recommended Actions

  1. IMMEDIATE: Fix the vitest import in agents-cli/vitest.config.ts:

    • Option A: Remove the CI-specific logic and use the same config for all environments
    • Option B: Move the CI config logic directly into the main config file
  2. IMMEDIATE: Update or remove the coverage script references in package.json

  3. CONSIDER: Change version bumps from minor to patch in the changeset unless there are breaking changes

  4. OPTIONAL: The knip configuration looks good but consider running pnpm knip to ensure it catches genuinely unused files

Summary

The PR successfully removes 21 unused files and adds knip configuration for future unused code detection. However, there are 2 critical issues that will break the build/tests if not addressed, and the version bump strategy should be reconsidered.

Base automatically changed from simplify-autotypetable to main February 2, 2026 18:07
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 5, 2026

Claude finished @dimaMachina's task in 4m 49s —— View job


PR Review Summary

1 Key Finding | Risk: Low

Important Correction: Previous review comments about broken imports were incorrect. After thorough verification:

  • agents-cli/vitest.config.ts imports from ./vitest.config.ci which resolves to the local agents-cli/vitest.config.ci.ts file (not the deleted root file) ✅
  • package.json references generate-badges.mjs (plural) which exists, not generate-badge.mjs (singular) which was deleted ✅
  • All 28 deleted files have no remaining imports or references in the codebase ✅

🟠🔶⚠️ Major (1) 🟠🔶⚠️

🟠 1) .changeset/neat-lies-attend.md Changeset uses minor bumps for file cleanup

Issue: The changeset uses minor version bumps for all 4 packages (@inkeep/agents-core, @inkeep/agents-sdk, @inkeep/agents-api, @inkeep/agents-cli), but this is a file cleanup PR that removes internal, unused code with no public API changes.

Why: Per CLAUDE.md semver guidance:

  • Minor: Schema changes requiring migration, significant behavior changes
  • Patch: Bug fixes, additive features, non-breaking changes

Removing unused internal files constitutes housekeeping, not a feature or behavioral change. Using minor for all packages may unnecessarily signal to consumers that there are meaningful changes when there are none.

Fix: Consider downgrading to patch for packages where no public API is affected:

---
"@inkeep/agents-core": patch
"@inkeep/agents-sdk": patch
"@inkeep/agents-api": patch
"@inkeep/agents-cli": patch
---

chore: remove unused files

Point-fix Edits (0)

No inline comments posted - the changeset versioning is a judgment call that doesn't warrant an inline fix.


💡 APPROVE WITH SUGGESTIONS

Summary: This is a clean, well-executed PR that removes 28 genuinely unused files identified by knip tooling. All deletions have been verified to have no remaining references in the codebase. The new root knip.config.ts provides appropriate ignore patterns for templates, configs, and tooling files. The only suggestion is to consider using patch version bumps instead of minor since this is internal cleanup with no public API changes.


Other Findings (3)

Potentially valid

Location Issue Reason Excluded
knip.config.ts Large ignore list (30+ entries) may hide legitimate issues Appropriate for a monorepo with templates, configs, and tooling that knip can't understand
agents-cli/README.md Removed dependency mentions (dotenv, ora, inquirer) but README still has other dependencies listed README accurately reflects current dependencies after removal

Discarded as invalid or not applicable

Location Issue Reason Excluded
agents-cli/vitest.config.ts:2 Previous reviews flagged "broken import" Invalid - Import resolves to local agents-cli/vitest.config.ci.ts which exists
package.json Previous reviews flagged missing script reference Invalid - generate-badges.mjs (plural) exists; generate-badge.mjs (singular) was correctly deleted
agents-cli/src/__tests__/utils/profile-config.test.ts Test file might be affected by deleted profile-config.ts Invalid - Test imports from ProfileManager in utils/profiles, not the deleted file

@dimaMachina
Copy link
Copy Markdown
Collaborator Author

@claude add a changeset based on changes in this PR

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Feb 5, 2026

Claude finished @dimaMachina's task in 1m 31s —— View job


✅ Changeset added for PR

Todo List

  • Review existing changeset
  • Analyze the actual changes in the PR
  • Create appropriate changeset with correct version bumps
  • Commit and push the changeset

Summary

I've added a new changeset file (.changeset/remove-unused-files.md) that properly reflects the changes in this PR:

Key improvements over the existing changeset:

  1. Correct version bumps: Used patch instead of minor for all packages, as removing unused files is a non-breaking change (following CLAUDE.md semver guidelines)
  2. Complete package list: Included all 6 affected packages (agents-core, agents-sdk, agents-api, agents-cli, agents-manage-ui, agents-work-apps)
  3. Descriptive message: Added a comprehensive description of what was changed:
    • Removal of 21 unused files
    • Addition of knip configuration
    • Dependency cleanup
    • Vitest configuration consolidation

The changeset has been committed and pushed to the PR branch.

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.

1 participant