gut(stubs): sweep gutted CLI/command/agent stubs (#2303)#2333
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 13, 2026
Merged
gut(stubs): sweep gutted CLI/command/agent stubs (#2303)#2333alexey-pelykh merged 1 commit intomainfrom
alexey-pelykh merged 1 commit intomainfrom
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #2303 — wave 2 of the MBP audit gut sweep. Removes ~1,200 LOC of dead-code stubs across
src/cli,src/commands, andsrc/agents, and threads consumer cleanup through the call sites that still referenced the no-op exports.remoteclaw --helpno 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 inregister.subclis.tssrc/commandsauth-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-pickergateway-install-token(and the duplicate atsrc/gateway/gateway-install-token.ts)src/agentspi-extensions/(zero importers)pi-embedded-helpers.ts+pi-embedded-helpers/(importers rewritten to useagent-helpers/directly;transcript-policy.tsinlines a localisGoogleModelApino-op)pi-embedded-block-chunker.ts(replaced by a local no-op stand-in insidediscord/monitor/message-handler.process.ts)getMemoryCommandSecretTargetIdssince the memory CLI was removed in gut: remove dead memory CLI (MBP audit) #2300## Memorysection fromdocs/cli/index.mdThreaded 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.tssrc/commands/configure.gateway-auth.ts(shrinkspromptAuthConfigto a passthrough)src/commands/configure.daemon.ts,onboard.ts,onboard-non-interactive/local/daemon-install.tssrc/cli/program/register.onboard.ts,src/cli/daemon-cli/install.tssrc/wizard/onboarding.finalize.ts(and its test)src/agents/tools/subagents-tool.tsScope 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/, andskills/refresh.tsretain 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.tskeepsdetectLegacyWorkspaceDirs/formatLegacyWorkspaceWarning(real code) and only drops the guttedMEMORY_SYSTEM_PROMPTexports.Tests touched
configure.gateway-auth.prompt-auth-config.test.ts(covered the dead model/auth-choice branches)auth-choice.apply.{openai,byteplus,volcengine}*.test.ts(gutted-stub tests for now-deleted files)register.subclis.test.tsto assert againstnodesinstead of the removedclawbotplaceholderregister.onboard.test.ts,wizard/onboarding.finalize.test.ts,onboard-non-interactive.provider-auth.test.tsto drop mocks/imports of deleted modulesTest plan
pnpm tsgo— cleanpnpm lint— 0 warnings, 0 errorspnpm format:check— cleanpnpm test— 727 test files, 6358 tests passingremoteclaw --help— no ghost commands shownRefs #2303