Skip to content

feat: allow multiple recall tool calls per request (multi-turn recall) #399

@BYK

Description

@BYK

Problem

The gateway strips the recall tool from the tools list after the first recall follow-up (recall.ts:438-442). This prevents the LLM from:

  1. Following up on t:<id> source citations in distillation results
  2. Making multiple targeted recall queries in a single conversation turn
  3. Drilling down from a general recall result to specific details

Current behavior

  1. LLM calls recall('error handling pattern')
  2. Gateway intercepts, runs recall, builds follow-up with results
  3. Gateway strips recall from tools list
  4. LLM sees results with (sources: t:abc123) but can't call recall again
  5. Specific details in the source messages are unreachable

Desired behavior

Allow at least 2-3 recall calls per request, with the gateway intercepting each one. The existing recall follow-up mechanism would chain: first recall returns high-level results, second recall expands specific source IDs.

Impact

Eval CM-1 (context management): recall is invoked on every question but scores 1.9 because the LLM can't follow source citations. The specific details (branch names, version numbers, exact error messages) exist in the source messages but are unreachable.

Context

Discovered during eval suite testing at 400K tokens.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions