You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pruner): use dropAllThinkingBlocks for estimate when policy strips all thinking
Reviewer feedback on PR #81534:
P2-1: pruner was conflating dropThinkingBlocks (keeps latest assistant
thinking block) and dropAllThinkingBlocks (strips every assistant
thinking block) into a single boolean on the context-pruning runtime.
For Copilot Claude proxy paths transcriptPolicy.dropAllThinkingBlocks
is true, but the pruner only called dropThinkingBlocks() when
estimating context size, so big non-latest thinking signatures still
counted toward the token estimate and the pruner could trim tool
results that would not actually have been sent.
Thread a separate dropAllThinkingBlocksForEstimate signal through
ContextPruningRuntimeValue -> extension.ts -> pruneContextMessages so
the estimate path matches what the wire format will look like.
P2-2: attempt.spawn-workspace.test-support.ts mocked ../thinking.js
with only dropReasoningFromHistory + dropThinkingBlocks. attempt.ts
also imports dropAllThinkingBlocks now, so module evaluation would
fail. Add the missing field to the mock.
Tests added:
- pruner.test.ts: dropAllThinkingBlocksForEstimate strips even the
latest assistant thinking block from the estimate, allowing the
oversized tool result through unchanged.
- context-pruning.test.ts: updated setContextPruningRuntime callers
for new mandatory dropAllThinkingBlocks field.
0 commit comments