Skip to content

[BUG] External task workspace search reports indexing disabled for an uninitialized manager #1722

Description

@WebMad

Problem (one or two sentences)

Searching from a task whose working directory is outside the open workspace folders can obtain a fresh, uninitialized code-index manager and report that indexing is disabled, even when the user has enabled it. Uninitialized configuration is incorrectly treated as an explicit disabled setting.

Context (who is affected and when)

Users searching an external task directory after task-workspace routing is enabled in PR #1629. The issue concerns the first search for a directory whose manager has not been initialized; manager initialization and completion of background indexing are separate states.

Reproduction steps

  1. Use the source version of PR fix(code-index): search the task workspace instead of the active editor workspace #1629 at commit 3e09b14, with code indexing enabled and configured.
  2. Open a workspace folder and run a task whose working directory is a different directory, outside all open workspace folders. Ensure that directory has no initialized cached manager.
  3. Invoke codebase search with a nonempty query and approve the tool call.
  4. The task-workspace registry lookup creates a new manager. Its configuration has not been loaded, so the feature-enabled getter falls back to false and the tool reports that indexing is disabled.

This is a source/review-derived reproduction; a real extension-host reproduction was not performed for this issue.

Expected result

Do not report an explicitly disabled setting solely because the manager is uninitialized. Either initialize and await the manager before checking settings, or report a specific not-initialized/not-ready message according to the intended ownership contract. Preserve the actual disabled-setting message when configuration explicitly disables indexing.

Actual result

The tool reports: "Code Indexing is disabled in the settings." It does not distinguish an uninitialized manager from a configured manager with indexing disabled.

App Version

Source review of PR #1629, commit 3e09b14; no released extension version was reproduced. PR #1629 was still open at filing time.

API Provider (optional)

Not Applicable / Other

Relevant logs or errors (optional)

Original review: #1629 (comment)

Affected lookup and checks: CodebaseSearchTool.ts.

The PR description mentions initialization handling, but the inspected head still proceeds from manager lookup to feature checks without an initialization check. Validate against the final implementation rather than relying on the PR description.

Acceptance criteria:

  • Cover an external task directory with a freshly created, uninitialized manager.
  • Distinguish uninitialized/not-ready state from explicitly disabled settings.
  • If initialization is chosen, await it and cover its failure without searching prematurely.
  • Retain coverage for genuinely disabled and unconfigured managers.
  • Do not equate manager initialization with background indexing completion.

Tracked separately at the author's request; coordinate closure with the final version of PR #1629.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions