Skip to content

gut(stubs): sweep gutted CLI/command/agent stubs (#2303)#2333

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/2303-sweep-stubs
Apr 13, 2026
Merged

gut(stubs): sweep gutted CLI/command/agent stubs (#2303)#2333
alexey-pelykh merged 1 commit intomainfrom
gut/2303-sweep-stubs

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Closes #2303 — wave 2 of the MBP audit gut sweep. Removes ~1,200 LOC of dead-code stubs across src/cli, src/commands, and src/agents, and threads consumer cleanup through the call sites that still referenced the no-op exports.

remoteclaw --help no longer advertises the seven gutted ghost commands (models, skills, sandbox, secrets, clawbot, docs, approvals).

What was removed

  • src/cli — 7 sub-CLI stubs + matching entries in register.subclis.ts
  • src/commands
    • auth-choice* family (8 files, including the gutted-stub test files)
    • doctor-{bootstrap-size,memory-search,sandbox,gateway-auth-token}
    • model-default, google-gemini-model-default, openai-model-default, model-picker
    • gateway-install-token (and the duplicate at src/gateway/gateway-install-token.ts)
  • src/agents
    • pi-extensions/ (zero importers)
    • pi-embedded-helpers.ts + pi-embedded-helpers/ (importers rewritten to use agent-helpers/ directly; transcript-policy.ts inlines a local isGoogleModelApi no-op)
    • pi-embedded-block-chunker.ts (replaced by a local no-op stand-in inside discord/monitor/message-handler.process.ts)
  • Memory secret targets — drop getMemoryCommandSecretTargetIds since the memory CLI was removed in gut: remove dead memory CLI (MBP audit) #2300
  • Docs — remove the stale ## Memory section from docs/cli/index.md

Threaded consumer cleanup

Each of these files had real call sites referencing the now-deleted gutted exports. The PR inlines the appropriate gutted no-op or drops the dead branch:

  • src/commands/doctor.ts, doctor-gateway-services.ts, doctor-gateway-daemon-flow.ts
  • src/commands/configure.gateway-auth.ts (shrinks promptAuthConfig to a passthrough)
  • src/commands/configure.daemon.ts, onboard.ts, onboard-non-interactive/local/daemon-install.ts
  • src/cli/program/register.onboard.ts, src/cli/daemon-cli/install.ts
  • src/wizard/onboarding.finalize.ts (and its test)
  • src/agents/tools/subagents-tool.ts

Scope notes (deferrals)

  • src/auto-reply/* stubs from the original issue body had already been removed in an earlier wave, so this sweep skips them.
  • pi-embedded.ts, pi-embedded-runner/, and skills/refresh.ts retain thin no-op stubs. ~10 real-code consumers (auto-reply runner, gateway server methods, tts-core, agent.test.ts, etc.) still reference their symbols. Fully removing them would require rewriting those consumers (~8K LOC) and is out of scope for this PR. The forensics in the issue body underestimated their importer count.
  • doctor-workspace.ts keeps detectLegacyWorkspaceDirs / formatLegacyWorkspaceWarning (real code) and only drops the gutted MEMORY_SYSTEM_PROMPT exports.

Tests touched

  • Removed configure.gateway-auth.prompt-auth-config.test.ts (covered the dead model/auth-choice branches)
  • Removed auth-choice.apply.{openai,byteplus,volcengine}*.test.ts (gutted-stub tests for now-deleted files)
  • Updated register.subclis.test.ts to assert against nodes instead of the removed clawbot placeholder
  • Updated register.onboard.test.ts, wizard/onboarding.finalize.test.ts, onboard-non-interactive.provider-auth.test.ts to drop mocks/imports of deleted modules

Test plan

  • pnpm tsgo — clean
  • pnpm lint — 0 warnings, 0 errors
  • pnpm format:check — clean
  • pnpm test — 727 test files, 6358 tests passing
  • remoteclaw --help — no ghost commands shown

Refs #2303

…rs (#2303)

Removes ~1,200 LOC of dead-code stubs across src/cli, src/commands, and
src/agents, and threads consumer cleanup through the call sites that
still referenced the no-op exports. Build, type-check, lint, and the
full test suite pass. `remoteclaw --help` no longer advertises the
seven gutted ghost commands (models, skills, sandbox, secrets, clawbot,
docs, approvals).

Highlights
- src/cli: delete 7 sub-CLI stubs and the matching entries in
  register.subclis.ts
- src/commands: delete the auth-choice* stubs (with their test files),
  the gutted doctor-* helpers (doctor-bootstrap-size, doctor-memory-search,
  doctor-sandbox, doctor-gateway-auth-token), the model-default chain
  (model-default/google-gemini/openai), model-picker, and gateway-install-token
- src/agents: delete pi-extensions/, pi-embedded-helpers* (rewriting
  importers to use agent-helpers directly), pi-embedded-block-chunker
  (replaced by a local no-op stand-in inside the discord monitor)
- Threaded cleanup: doctor.ts, doctor-gateway-services.ts,
  configure.gateway-auth.ts, onboard.ts, register.onboard.ts,
  configure.daemon.ts, daemon-install (interactive + non-interactive),
  doctor-gateway-daemon-flow.ts, wizard/onboarding.finalize.ts,
  cli/daemon-cli/install.ts, subagents-tool.ts — each now inlines the
  appropriate gutted no-op or drops the dead branch
- Memory targets: drop getMemoryCommandSecretTargetIds since the memory
  CLI is gone (#2300 follow-up)
- Docs: remove the stale `## Memory` section from docs/cli/index.md

Scope notes
- src/auto-reply/* stubs from the original issue body had already been
  removed in an earlier wave, so the wave-2 sweep skips them
- pi-embedded.ts, pi-embedded-runner/, and skills/refresh.ts retain
  thin no-op stubs because ~10 real-code consumers (auto-reply runner,
  gateway server methods, tts-core, etc.) still reference their symbols.
  Their full removal is a follow-up that requires touching those
  consumers — out of scope for this PR
- doctor-workspace.ts keeps detectLegacyWorkspaceDirs/formatLegacyWorkspaceWarning
  (real code) and only drops the gutted MEMORY_SYSTEM_PROMPT exports
- Two stale tests removed: configure.gateway-auth.prompt-auth-config.test.ts
  (covered the dead model/auth-choice branches) and the auth-choice
  apply.{openai,byteplus,volcengine}* gutted-stub tests
- register.subclis.test.ts updated to assert against `nodes` instead of
  the removed `clawbot` placeholder

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh merged commit e2cf15c into main Apr 13, 2026
10 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/2303-sweep-stubs branch April 13, 2026 00:05
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.

gut: sweep gutted stubs across agents, auto-reply, commands, cli (MBP audit)

1 participant