Skip to content

Conversation

@EthanReid
Copy link
Contributor

In reasoning mode spatial_refs did not work. We were passing the spatial_refs to generate_answer even when the prompt was suffix only as we has already consumed the prompt with the spatial tokens during generate_reasoning. Solution is to set the spatial_refs to none after consuming them.

Copilot AI review requested due to automatic review settings January 1, 2026 02:59
@EthanReid EthanReid changed the title set spatial refs to none after reasoning Set spatial_refs to none after generate_reasoning Jan 1, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where spatial_refs were incorrectly passed to generate_answer in reasoning mode. The spatial references are consumed during the reasoning phase when processing spatial tokens, but were not being cleared before the answer generation phase, causing a mismatch between the prompt tokens (which no longer contain spatial token placeholders) and the spatial_refs parameter.

Key Change

  • Sets spatial_refs = None after the reasoning phase completes to prevent them from being incorrectly passed to the answer generation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant