Skip to content

fix(reflect): retry a forced retrieval step instead of silently skipping it - #5236

Merged
nicoloboschi merged 1 commit into
mainfrom
fix/reflect-forced-step-retry
Oct 5, 2026
Merged

nicoloboschi merged 1 commit into
mainfrom
fix/reflect-forced-step-retry

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

Fixes #4564.

Before: reflect runs planned searches in order (mental models → observations → raw memories). If the model returned no tool call on one of them after an earlier tool call, reflect treated it as "done" and answered — the remaining searches never ran, with no log. Separately, an LLM-error retry advanced to the next planned search, dropping the failed one.

After:

  • The next planned search is tracked by how many planned searches actually ran, not by turn number — so an error retry asks for the same search again.
  • An empty reply on a pending planned search is retried once with a warning. If it's empty again, reflect logs it and answers as before.

Compliant models see no change.

Tests: new test_empty_reply_on_forced_step_retries_that_step; test_transient_llm_error_is_still_retried now asserts the retry asks for the same step; two tests whose mocks stopped before all planned searches ran were adjusted.

…ing it

When a forced step (search_mental_models / search_observations / recall)
came back with no tool call after an earlier tool call, reflect went
straight to answering and the pending searches never ran. The forced
step was also indexed by iteration, so an LLM-error retry moved on to
the next step and dropped the failed one.

The next forced step is now indexed by how many forced steps actually
produced a tool call. An empty reply on a pending forced step is retried
once (with a warning); if it is empty again, reflect logs and answers.

Fixes #4564
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pinned forced-tool step can be silently skipped with no retry when the model returns zero tool calls

1 participant