Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(chat): stop tool schemas from filling the Claude harness context window

merged#2920CedarCopilot

CedarCopilot wants to merge 2 commits into staging from worktree-send-it-chat-harness-tool-deferral

What Libra verified

  • A pending MCP server remains discoverable during its initial chat turn

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • the initial chat prompt identifies a configured pending MCP server so the model can look for its tools during the same turn
    • the initial chat tool allowlist enables ToolSearch and the pending server's wildcard tools during the same turn

    Changed code: delegate-tool-scoping.ts.

  • A rep's research request returns results

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • a rep’s research request has WebSearch and WebFetch available so the agent can return a result instead of failing
    • a rep’s research request keeps each connected research server reachable instead of failing because its tools are omitted
  • Bound agent threads retain only their granted MCP servers

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • the bound turn's allowed-tool wildcards include the granted server but not an ungranted user server
    • the bound turn's connected-server prompt line names only the granted MCP server
    • the bound turn's server-derived surfaces stay aligned with the same narrowed grant

    Changed code: delegate-tool-scoping.ts.

  • Deferred MCP tools do not preload every server schema into chat context

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • ToolSearch is available for connected MCP servers while Cedar, native, and subagent tools remain available
    • Cedar, native, and subagent tools remain available when no user MCP servers are connected

    Changed code: delegate-tool-scoping.ts.

run c04ea74e-e7e1-4fb4-b319-ec27ef564efa, completed Sep 23, 2026, 1:13 PM