Skip to content

[Bug]: Code Mode search silently returns an empty list for a namespace prefix or a multi-word query #33542

Open

Description

@securityvisions

What happened

search in Code Mode returns { items: [], remaining: 0 } — silently and with no error — for two ordinary inputs. Because an agent cannot tell that apart from "the tool does not exist", it concludes the capability is missing and falls back to shell/CLI workarounds.

Reproduction

Server 0.1.8-nightly.20261107.4314, harness opencode, thread t3-code-<threadId> MCP server.

  1. search({ query: "delegate_task" }) → returns delegate_task, task_cancel, task_status, … (works).
  2. search({ query: "delegate_task", namespace: "t3-code" }) → { items: [], remaining: 0 }. The real namespace is t3-code-<threadId>, so a prefix silently matches nothing.
  3. search({ query: "delegate orchestrator task" }) → { items: [], remaining: 0 }. A multi-word query is matched as one literal string, not tokenized.
  4. search({ query: "delegate", namespace: "t3-code-<full-thread-id>" }) → works.

Expected

  • Prefix (or substring) namespace matching, or an explicit error for an unknown namespace.
  • Tokenized query matching, or a distinct "no match" signal so an empty result is not confused with an invalid filter.

Either fix removes the silent failure. An error would be enough — silence is the part that misleads.

Impact

In one session this cost about 15 tool calls and a user correction before orchestrator_capabilities was found by dropping the namespace and the extra words. The agent had a working delegation path available the whole time and could not see it.

Workaround

Use one keyword and the exact namespace. Never pass a phrase.

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