Skip to content

Extract shared base-URL / health-check helpers in @bb/cli #119

Description

@bharatsachya

Type: simplification (DRY) · Difficulty: medium

The loopback server URL is rebuilt inline in ~8 places even though httpClient.baseUrl() (packages/cli/src/httpClient.ts:7) already owns it: serverSpawn.ts:115, mcpInstall.ts:28, SetupCommand.ts:58, bootConfig.ts:83. Separately, four commands hand-roll a /health fetch with no timeoutIndexCommand.ts:41, IngestCommand.ts:44, LsCommand.ts:29, PullCommand.ts:46 — unlike every call in httpClient.ts which uses AbortSignal.timeout.

Do: export baseUrl() (+ mcpUrl(), healthUrl()) and an isServerHealthy() helper (with a short AbortSignal.timeout) from httpClient.ts; replace the inline copies.

Done when: no command builds the loopback URL or probes /health inline; the health probe has a timeout.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions