Commit 7c7c2d2
committed
merge: resolve conflicts with main (drop heap-pressure, adapt to getHistoryShallow)
Main landed #4286 (replace structuredClone with shallow copy) which:
- Reverted #4186's heap-pressure auto-compaction safety net (#4286
removed HEAP_PRESSURE_COMPRESSION_RATIO because the underlying OOM
cause was fixed by the shallow-copy refactor)
- Reverted #4168's consecutiveFailures ladder back to single-shot
hasFailedCompressionAttempt
- Introduced getHistoryShallow() / peekLastHistoryEntry() to replace
structuredClone-based history access
- Added a Chinese-language design doc draft for this exact redesign
Resolution strategy:
- Take OUR redesign everywhere it conflicts: three-tier threshold
ladder, consecutiveFailures circuit breaker, hard-rescue, token
estimator, hard-rescue debug log, CompressOptions plumbing for
pendingUserMessage / precomputedEffectiveTokens / trigger.
- DROP all bypassTokenThreshold / heapPressureCompressionCooldownUntil /
HEAP_PRESSURE_* / mockGetHeapStatistics / mockHeapPressure code
(heap-pressure mechanism is gone on main; we're not reviving it).
- Use main's new getHistoryShallow(true) in chatCompressionService and
in the hard-tier rescue estimator path (was getHistory(true) before
main's refactor; the shallow path is what other compaction call
sites now use).
- For chatCompressionService.test.ts inline mockChat objects, alias
getHistoryShallow to the same vi.fn() as getHistory so existing
.mockReturnValue() calls drive both methods.
- For the design doc, keep our resolved Open Question 2 closure
rationale and prepend the round-2 blockquote clarifying the
Background section describes pre-redesign behavior; take main's
slightly more thorough SUMMARY_RESERVE paragraph where it explains
both with/without-thinking cases.
- Replace the round-2 test that asserted "hard-rescue forwards
consecutiveFailures=3" with a test compatible with the post-merge
history-access shape (now using getHistoryShallow).
346 core tests passing; CLI typecheck clean for affected files.
Pre-existing provider-config typecheck errors from main's #4287
refactor are unrelated to this PR and not touched here.215 files changed
Lines changed: 13878 additions & 6067 deletions
File tree
- .github
- docs
- design
- developers
- tools
- e2e-tests
- plans
- users
- configuration
- features
- integration-tests/cli
- packages
- cli/src
- auth
- install
- providers
- custom
- oauth
- config
- i18n/locales
- nonInteractive
- io
- services
- ui
- auth
- commands
- components
- agent-view
- contexts
- hooks
- manageModels
- utils
- core/src
- agents/runtime
- config
- core
- __snapshots__
- anthropicContentGenerator
- loggingContentGenerator
- openaiContentGenerator
- extension
- hooks
- models
- permissions
- providers
- __tests__
- presets
- presets
- services
- skills/bundled/review
- tools
- agent
- utils
- sdk-java/qwencode
- sdk-typescript
- vscode-ide-companion/src
- services
- open-files-manager
- utils
- webview
- handlers
- providers
- scripts/tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
48 | 113 | | |
49 | 114 | | |
50 | 115 | | |
| |||
56 | 121 | | |
57 | 122 | | |
58 | 123 | | |
| 124 | + | |
59 | 125 | | |
60 | 126 | | |
61 | 127 | | |
62 | 128 | | |
63 | | - | |
| 129 | + | |
64 | 130 | | |
65 | 131 | | |
66 | 132 | | |
| |||
78 | 144 | | |
79 | 145 | | |
80 | 146 | | |
81 | | - | |
| 147 | + | |
82 | 148 | | |
83 | 149 | | |
84 | 150 | | |
| |||
131 | 197 | | |
132 | 198 | | |
133 | 199 | | |
134 | | - | |
| 200 | + | |
135 | 201 | | |
136 | 202 | | |
137 | 203 | | |
| |||
148 | 214 | | |
149 | 215 | | |
150 | 216 | | |
| 217 | + | |
151 | 218 | | |
152 | 219 | | |
153 | 220 | | |
| |||
0 commit comments