Skip to content

[BUG] Anchor task-workspace routing in codebase-search happy-path tests #1721

Description

@WebMad

Problem (one or two sentences)

The successful-search tests use an unconditional registry mock and do not assert which workspace was requested. These individual tests can remain green if workspace routing regresses, even though other tests in the suite already check that argument.

Context (who is affected and when)

Maintainers reviewing changes to task-workspace search need the normal successful execution path to protect the behavior being fixed in PR #1629. This is a test-coverage gap, not evidence that the entire suite fails to detect the regression.

Reproduction steps

  1. Inspect PR fix(code-index): search the task workspace instead of the active editor workspace #1629 at commit 3e09b14.
  2. Inspect the unconditional mock in CodebaseSearchTool.spec.ts.
  3. Inspect the happy-path assertions around line 217: they verify the search call but not the registry lookup arguments.
  4. To validate the gap, temporarily remove the workspace argument from the production lookup and run only the affected happy-path tests. This mutation experiment is proposed, not claimed to have been run for this issue.

Expected result

The happy-path tests assert exactly one registry lookup with the extension context and the task workspace, in addition to the existing search query/directory assertions. Removing or replacing the workspace argument must fail those tests.

Actual result

The happy-path mock returns the same manager regardless of lookup arguments. Argument assertions exist in the missing-manager and delayed-approval scenarios, but are absent from the happy-path assertions identified by the review.

App Version

Source review of PR #1629, commit 3e09b14; no released extension version was reproduced. The new test file is not yet on upstream main at filing time.

API Provider (optional)

Not Applicable / Other

Relevant logs or errors (optional)

Original review: #1629 (comment)

Acceptance criteria:

  • Add the exact context/task-workspace assertion to the affected successful-search scenarios.
  • Retain existing query/directory assertions.
  • Confirm a workspace-argument mutation fails the focused happy-path tests.

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