nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Feature] Lazy ACP extension activation and process lifecycle management

Open akramcodez opened this issue 1 month ago • 3 comments

Description

Change the VS Code extension activation from eager startup (onStartupFinished) to lazy activation, spawning the ACP CLI process only when a user interacts with the Nanocoder view or invokes a Nanocoder command.

Use Case

Currently, plugins/vscode/package.json activates on onStartupFinished, and extension.ts:51 immediately spawns nanocoder --acp on every VS Code launch. For users who open VS Code for tasks unrelated to Nanocoder, this consumes memory and CPU unnecessarily.

Proposed Solution

  1. Remove onStartupFinished from activationEvents in plugins/vscode/package.json.
  2. VS Code automatically handles activation for contributed views and commands; ensure ACP process spawning in AcpProcessManager is deferred until resolveWebviewView is called or a Nanocoder command is executed.
  3. Preserve explicitly enabled legacy autoConnect / companion behavior, while avoiding ACP spawning for commands that only open configuration or logs.

Alternatives Considered

  • Leaving it eager: causes unnecessary background process spawning and resource consumption on every VS Code launch.

Additional Context

  • [x] No matching open issue found in issue search performed on 2026-10-12
  • [x] This feature aligns with the project's goals (local-first AI assistance)

akramcodez avatar Oct 12 '26 11:10 akramcodez

hey @akramcodez @addyCooks , would like to work on this could you please assign this to me.

plan - remove onStartupFinished from the extension's activation events and only spawn nanocoder --acp when the Nanocoder view opens or a command that needs it runs (keeping the existing autoConnect behavior)

karthikponna avatar Oct 12 '26 12:10 karthikponna

Hey @karthikponna, thanks for your interest! I've already assigned you a few issues. Once those PRs are done and reviewed, I'll assign this one to you too.

addyCooks avatar Oct 13 '26 06:10 addyCooks

hey @addyCooks , i've raised PRs for the last two issues that i got assigned. if no one is currently working on this would like to take this one.

karthikponna avatar Oct 14 '26 08:10 karthikponna