3.2 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies, references, priority
| id | title | status | assignee | created_date | updated_date | labels | dependencies | references | priority | |||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TASK-88 | Fix second-instance --start handling when overlay runtime is already initialized | Done |
|
2026-03-06 07:30 | 2026-03-06 07:31 |
|
medium |
Description
Restore the CLI command guard so a second-instance --start request does not reconnect or reinitialize overlay work when the overlay runtime is already active, while preserving other second-instance commands.
Acceptance Criteria
- #1 Second-instance
--startlogs that the app is already running when the overlay runtime is initialized. - #2 Second-instance
--startdoes not reconnect the MPV client when the overlay runtime is already initialized. - #3 Second-instance commands that include non-start actions still execute those actions.
- #4 Regression coverage documents the guarded second-instance behavior.
Implementation Plan
- Reproduce the failing
handleCliCommandsecond-instance--startregression insrc/core/services/cli-command.test.ts. - Update
src/core/services/cli-command.tsso second-instance--startis ignored when the overlay runtime is already initialized, while still allowing non-start actions in the same invocation. - Run focused CLI command tests, then rerun the core test target if practical, and record acceptance criteria/results.
Implementation Notes
Reproduced the failing second-instance --start regression in src/core/services/cli-command.test.ts before editing.
Restored a guard in src/core/services/cli-command.ts that ignores second-instance --start when the overlay runtime is already initialized, but still allows other flags in the same invocation to run.
Verification: bun test src/core/services/cli-command.test.ts, bun run test:core:src, and bun run test all pass; the six immersion tracker tests remain skipped as before.
Final Summary
Restored the missing second-instance --start guard in src/core/services/cli-command.ts.
- Added an
ignoreSecondInstanceStartcheck sohandleCliCommandlogsIgnoring --start because SubMiner is already running.when a second-instance--startarrives after the overlay runtime is already initialized. - Updated start gating so pure duplicate
--startrequests no longer reconnect the MPV client, while combined commands such as--start --toggle-visible-overlaystill execute their non-start behavior and can connect through those paths. - Verified the regression with existing CLI command coverage and reran the broader test targets.
Tests run:
bun test src/core/services/cli-command.test.tsbun run test:core:srcbun run test
Notes:
- The six skipped immersion tracker tests are unchanged from the pre-fix baseline.