Skip to content

fix(core): count all messages omitted by head-tail context - #8329

Open
Tivonsico wants to merge 1 commit into
microsoft:mainfrom
Tivonsico:fix/head-tail-skipped-count
Open

Tivonsico wants to merge 1 commit into
microsoft:mainfrom
Tivonsico:fix/head-tail-skipped-count

Conversation

@Tivonsico

@Tivonsico Tivonsico commented Oct 7, 2026 •

Copy link
Copy Markdown

Why are these changes needed?

Head/tail context windows discard incomplete boundary tool messages, but the omission placeholder still counts configured window sizes. Count the actual retained messages so an eight-message history retaining two messages says Skipped 6 messages. Correct the method docstring's reversed oldest/recent wording.

Related issue number

Fixes #8328

Checks

  • Added seven offline regression cases covering four boundary-window combinations, empty/short contexts, and preservation of stored history; three fail against unchanged 0.7.5 and all pass with this fix.
  • The new regressions and the existing model-context test suite pass: 16 tests.
  • Ruff formatting/lint and focused Pyright/Mypy checks passed; git diff --check passed.
  • Full repository checks have not been run.

AI assistance was used to investigate, implement, and verify this change.

@Tivonsico

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
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.

HeadAndTailChatCompletionContext undercounts omitted tool boundary messages

1 participant