Skip to content

[Bug] Make github.search_threads recoverable when callers use a repository reference #279

Description

@morluto

Description

github.search_threads requires flat owner and repo inputs, while many neighboring GitContribute MCP tools accept a nested repository reference. A caller that follows the latter convention is rejected by SDK schema decoding before GitContribute can return its normal actionable InvalidArgument response.

This is a contract-discoverability problem rather than a request to make live search implicit or unbounded.

Steps to Reproduce

  1. Call github.search_threads with a repository reference shaped like other GitContribute MCP inputs:

    {
      "repository": {"owner": "morluto", "repo": "jacobian"},
      "query": "is:pr is:merged \"close\" \"KeyboardInterrupt\"",
      "limit": 20
    }
  2. Observe the decoder response:

    validating "arguments": validating root: unexpected additional properties ["repository"]
    

Expected Behavior

A caller should be able to recover mechanically at the public boundary. In particular, the live-search contract should either accept the repository-reference form used by neighboring tools or return a structured/copyable correction that names the accepted owner and repo fields.

Actual Behavior

The generic decoder error only identifies the rejected property. It does not identify the expected replacement shape.

Root Cause

SearchGitHubThreadsInput in internal/mcpcontract/github_acquisition_contracts.go declares flat owner/repo fields, while many other MCP contracts use RepositoryRef under repository. The generic schema decoder rejects the alternate shape before searchGitHubThreads in internal/mcpserver/github_acquisition.go can call validateLiveRepository or emit mcpcontract.InvalidArgument.

Expected Outcome

  • Repository selection is consistent enough that an agent can use the same representation across adjacent MCP tools, or schema-stage rejection supplies the exact replacement arguments.
  • The successful request remains one bounded explicit GitHub search; no side-effect or coverage semantics change.
  • A regression test exercises the nested-reference mistake and verifies a mechanically actionable recovery path.

Environment

Observed in a Codex MCP session on 2026-08-09. The server version was not captured.

Additional Context

The public schema and internal/mcpserver/github_acquisition.go currently document and enforce the flat form. This report is about recoverability and representation consistency, not about accepting arbitrary unknown properties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions