Skip to the content.

Gateway cold-tool deferral — the 10× floor lever (#3232)

Part of epic #3229. This is the reduction lever for the epic’s biggest, systemic slice: on a fresh guarded session the tool schemas alone are ~35.8k of the ~41k floor (built-in system tools ~25.9k + MCP tools ~9.9k). To fak’s gateway those are all just req.Tools on the outbound Anthropic request — the one seam where the systemic built-in slice is reachable.

What it does

When enabled, maybeDeferColdTools (internal/gateway/messages_tooldefer.go) rewrites the outbound /v1/messages body:

The provider then loads only the non-deferred defs into context and faults a cold schema in when the model searches for it. Load-bearing nuance: defer_loading does not shrink the request bytes — the reduction is provider-side and shows up in the OBSERVED usage relay (input_tokens / cache_read), never in the ESTIMATED byte footprint (fak footprint, #3230). The measurement that proves the after is fak_context_value’s live footprint (#3233) + the provider counters.

Safety properties (witnessed)

internal/gateway/messages_tooldefer_test.go proves:

Metrics: observeToolDefer accumulates deferFiredTurns / deferColdCount (WITNESSED), the twin of observeInboundToolPrune. These fold into the AdjudicationSummary (DeferColdTurns / DeferColdCount) and surface on two operator faces (#3531):

Default OFF — the validation gates before flipping it on

--defer-cold-tools / Config.DeferColdTools (also FAK_DEFER_COLD_TOOLS=1); ablate an A/B arm with FAK_ABLATE_DEFER_TOOLS=1. It is off by default because this is the epic’s highest-risk lever. Before the default flips on:

  1. Wire constantstoolSearchToolType (tool_search_tool_20250917) and toolSearchBeta (tool-search-2025-09-17) must match the account’s enabled Tool Search revision. A mismatch is a 400 upstream, which the fail-open path turns into a silent identity (never a broken session) — but also never a reduction. Confirm against a live account and update the two named constants.
  2. A/B — arm-on vs FAK_ABLATE_DEFER_TOOLS: the OBSERVED provider input tokens for the tool slice must drop materially (target: approach Anthropic’s ~85% tool-def cut) with held task-completion accuracy and no rise in poison/quarantine rate.
  3. Pin/quarantine (#3200) — the deferred cold tools are exactly what gets faulted in later; that fault-in must clear the first-seen quarantine + pin-by- hash guard.

Follow-ups