Skip to content

PERF: reduce CLI cold-start latency for repeated tool invocations #584

Description

@phernandez

Problem

bm CLI tool calls have significant cold-start overhead in interactive/plugin integrations because each invocation re-pays Python import/bootstrap cost.

Related downstream issue: basicmachines-co/openclaw-basic-memory#18

Impact

Per-call startup latency compounds heavily in composited workflows (multiple tool invocations per user request), causing multi-second perceived lag.

Requested improvements (any combination)

  1. Lightweight/fast path entrypoint for common tool commands with minimal imports.
  2. Optional long-running local daemon mode for CLI tools to reuse initialized state.
  3. More aggressive lazy-loading for heavy semantic/cloud dependencies unless command path needs them.

Acceptance criteria

  • Documented benchmark for representative commands (search-notes, read-note, build-context, project list).
  • Noticeable median latency reduction for local-only commands in warm and cold scenarios.
  • No behavior regressions for existing CLI contract.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions