@diegopetrucci/pi-extensions 0.1.67 → 0.1.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extensions/code-reviewer/index.ts +181 -2
- package/extensions/code-reviewer/package.json +1 -1
- package/extensions/context-inspector/index.ts +84 -5
- package/extensions/context-inspector/package.json +1 -1
- package/extensions/contrarian/index.ts +151 -14
- package/extensions/contrarian/package.json +1 -1
- package/extensions/dynamic-context-pruning/README.md +25 -16
- package/extensions/dynamic-context-pruning/index.ts +146 -29
- package/extensions/dynamic-context-pruning/package.json +1 -1
- package/extensions/oracle/index.ts +125 -15
- package/extensions/oracle/package.json +1 -1
- package/package.json +4 -4
|
@@ -105,11 +105,33 @@ const CONTRARIAN_STATUS_ID = "contrarian";
|
|
|
105
105
|
const CONTRARIAN_WIDGET_ID = "contrarian";
|
|
106
106
|
const CONTRARIAN_CONFIG_FILE = "contrarian.json";
|
|
107
107
|
const CONTRARIAN_MODEL_PREFERENCES = [
|
|
108
|
+
"openai/gpt-6-astra ",
|
|
109
|
+
"global.openai.gpt-6-astra ",
|
|
110
|
+
"us.openai.gpt-6-astra ",
|
|
111
|
+
"openai.gpt-6-astra ",
|
|
112
|
+
"gpt-6-astra ",
|
|
108
113
|
"gpt-6-astra",
|
|
114
|
+
"openai/gpt-6-sol ",
|
|
115
|
+
"gpt-6-sol ",
|
|
116
|
+
"gpt-6-sol",
|
|
109
117
|
"gpt-5.6-sol",
|
|
110
118
|
"gpt-5.6-terra",
|
|
119
|
+
"openai/gpt-6-luna ",
|
|
120
|
+
"gpt-6-luna ",
|
|
121
|
+
"gpt-6-luna",
|
|
111
122
|
"gpt-5.6-luna",
|
|
112
123
|
"gpt-5.5",
|
|
124
|
+
"anthropic/claude-opus-5.5 ",
|
|
125
|
+
"global.anthropic.claude-opus-5-5 ",
|
|
126
|
+
"au.anthropic.claude-opus-5-5 ",
|
|
127
|
+
"eu.anthropic.claude-opus-5-5 ",
|
|
128
|
+
"jp.anthropic.claude-opus-5-5 ",
|
|
129
|
+
"us.anthropic.claude-opus-5-5 ",
|
|
130
|
+
"anthropic.claude-opus-5-5 ",
|
|
131
|
+
"claude-opus-5.5 ",
|
|
132
|
+
"claude-opus-5-5 ",
|
|
133
|
+
"claude-opus-5-5",
|
|
134
|
+
"claude-opus-5.5",
|
|
113
135
|
"claude-opus-5",
|
|
114
136
|
"claude-opus-4-8",
|
|
115
137
|
"claude-opus-4.8",
|
|
@@ -119,12 +141,24 @@ const CONTRARIAN_MODEL_PREFERENCES = [
|
|
|
119
141
|
"claude-sonnet-4-5",
|
|
120
142
|
"claude-sonnet-4.5",
|
|
121
143
|
"claude-sonnet-4",
|
|
144
|
+
"x-ai/grok-4.7 ",
|
|
145
|
+
"spacexai/grok-4.7 ",
|
|
146
|
+
"grok-4.7 ",
|
|
147
|
+
"grok-4.7",
|
|
148
|
+
"grok-4.6",
|
|
122
149
|
"grok-4.5",
|
|
123
150
|
"gemini-3.5-flash",
|
|
124
151
|
];
|
|
125
152
|
|
|
126
153
|
const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
127
154
|
"amazon-bedrock": [
|
|
155
|
+
"global.anthropic.claude-opus-5-5 ",
|
|
156
|
+
"au.anthropic.claude-opus-5-5 ",
|
|
157
|
+
"eu.anthropic.claude-opus-5-5 ",
|
|
158
|
+
"jp.anthropic.claude-opus-5-5 ",
|
|
159
|
+
"us.anthropic.claude-opus-5-5 ",
|
|
160
|
+
"anthropic.claude-opus-5-5 ",
|
|
161
|
+
"claude-opus-5-5",
|
|
128
162
|
"claude-opus-5",
|
|
129
163
|
"claude-fable-5",
|
|
130
164
|
"claude-opus-4-8",
|
|
@@ -133,6 +167,10 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
133
167
|
"claude-opus-4-5",
|
|
134
168
|
"claude-opus-4-1",
|
|
135
169
|
"claude-opus-4",
|
|
170
|
+
"global.openai.gpt-6-astra ",
|
|
171
|
+
"us.openai.gpt-6-astra ",
|
|
172
|
+
"openai.gpt-6-astra ",
|
|
173
|
+
"gpt-6-astra",
|
|
136
174
|
"openai.gpt-5.6-sol",
|
|
137
175
|
"openai.gpt-5.6-terra",
|
|
138
176
|
"openai.gpt-5.6-luna",
|
|
@@ -141,7 +179,6 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
141
179
|
"claude-sonnet-4-5",
|
|
142
180
|
"claude-sonnet-4",
|
|
143
181
|
"deepseek.v3.2",
|
|
144
|
-
"deepseek.r1",
|
|
145
182
|
"kimi-k2.5",
|
|
146
183
|
"minimax-m2.5",
|
|
147
184
|
"minimax-m2.1",
|
|
@@ -149,6 +186,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
149
186
|
"xai.grok-4.6",
|
|
150
187
|
],
|
|
151
188
|
anthropic: [
|
|
189
|
+
"claude-opus-5-5 ",
|
|
190
|
+
"claude-opus-5-5",
|
|
152
191
|
"claude-opus-5",
|
|
153
192
|
"claude-fable-5",
|
|
154
193
|
"claude-opus-4-8",
|
|
@@ -161,8 +200,14 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
161
200
|
],
|
|
162
201
|
"ant-ling": ["Ling-2.6-1T", "Ling-2.6-flash"],
|
|
163
202
|
"azure-openai-responses": [
|
|
203
|
+
"gpt-6-astra ",
|
|
204
|
+
"gpt-6-astra",
|
|
205
|
+
"gpt-6-sol ",
|
|
206
|
+
"gpt-6-sol",
|
|
164
207
|
"gpt-5.6-sol",
|
|
165
208
|
"gpt-5.6-terra",
|
|
209
|
+
"gpt-6-luna ",
|
|
210
|
+
"gpt-6-luna",
|
|
166
211
|
"gpt-5.6-luna",
|
|
167
212
|
"gpt-5.5-pro",
|
|
168
213
|
"gpt-5.5",
|
|
@@ -199,7 +244,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
199
244
|
"zai-org/GLM-5.2-Fast",
|
|
200
245
|
"zai-org/GLM-4.7",
|
|
201
246
|
],
|
|
202
|
-
cerebras: ["gpt-oss-120b", "
|
|
247
|
+
cerebras: ["gpt-oss-120b", "qwen-3.8-27b"],
|
|
203
248
|
"cloudflare-ai-gateway": [
|
|
204
249
|
"claude-fable-5",
|
|
205
250
|
"claude-opus-5",
|
|
@@ -207,6 +252,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
207
252
|
"claude-opus-4.7",
|
|
208
253
|
"claude-opus-4.6",
|
|
209
254
|
"claude-opus-4.5",
|
|
255
|
+
"gpt-6-astra ",
|
|
256
|
+
"gpt-6-astra",
|
|
210
257
|
"gpt-5.5",
|
|
211
258
|
"gpt-5.4",
|
|
212
259
|
"workers-ai/@cf/moonshotai/kimi-k2.7-code",
|
|
@@ -230,7 +277,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
230
277
|
"@cf/qwen/qwen3-30b-a3b-fp8",
|
|
231
278
|
"@cf/zai-org/glm-4.7-flash",
|
|
232
279
|
],
|
|
233
|
-
deepseek: ["deepseek-v4-pro", "deepseek-
|
|
280
|
+
deepseek: ["deepseek-v4-pro", "deepseek-flash"],
|
|
234
281
|
fireworks: [
|
|
235
282
|
"accounts/fireworks/models/kimi-k3",
|
|
236
283
|
"accounts/fireworks/routers/kimi-k3-fast",
|
|
@@ -244,13 +291,20 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
244
291
|
"accounts/fireworks/models/gpt-oss-120b",
|
|
245
292
|
],
|
|
246
293
|
"github-copilot": [
|
|
294
|
+
"claude-opus-5.5 ",
|
|
295
|
+
"claude-opus-5.5",
|
|
247
296
|
"claude-opus-5",
|
|
248
297
|
"claude-fable-5",
|
|
249
298
|
"claude-opus-4.8",
|
|
250
299
|
"claude-opus-4.7",
|
|
300
|
+
"gpt-6-astra ",
|
|
251
301
|
"gpt-6-astra",
|
|
302
|
+
"gpt-6-sol ",
|
|
303
|
+
"gpt-6-sol",
|
|
252
304
|
"gpt-5.6-sol",
|
|
253
305
|
"gpt-5.6-terra",
|
|
306
|
+
"gpt-6-luna ",
|
|
307
|
+
"gpt-6-luna",
|
|
254
308
|
"gpt-5.6-luna",
|
|
255
309
|
"gpt-5.5",
|
|
256
310
|
"gpt-5.4",
|
|
@@ -259,6 +313,10 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
259
313
|
"claude-sonnet-5",
|
|
260
314
|
"claude-sonnet-4.6",
|
|
261
315
|
"gpt-5-mini",
|
|
316
|
+
"grok-4.7 ",
|
|
317
|
+
"grok-4.7",
|
|
318
|
+
"grok-4.6",
|
|
319
|
+
"grok-4.5",
|
|
262
320
|
"kimi-k3",
|
|
263
321
|
"kimi-k2.7-code",
|
|
264
322
|
],
|
|
@@ -303,6 +361,13 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
303
361
|
"Qwen/Qwen3-Coder-Next",
|
|
304
362
|
],
|
|
305
363
|
"kimi-coding": ["k3", "kimi-for-coding", "kimi-for-coding-highspeed"],
|
|
364
|
+
meta: [
|
|
365
|
+
"muse-spark-1.3",
|
|
366
|
+
"muse-spark-1.3-contributor",
|
|
367
|
+
"muse-spark-1.2",
|
|
368
|
+
"muse-spark-1.2-contributor",
|
|
369
|
+
"muse-spark-1.1",
|
|
370
|
+
],
|
|
306
371
|
minimax: ["MiniMax-M3", "MiniMax-M2.7-highspeed", "MiniMax-M2.7"],
|
|
307
372
|
"minimax-cn": ["MiniMax-M3", "MiniMax-M2.7-highspeed", "MiniMax-M2.7"],
|
|
308
373
|
mistral: [
|
|
@@ -319,9 +384,14 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
319
384
|
"zai-glm-5-2",
|
|
320
385
|
],
|
|
321
386
|
openai: [
|
|
387
|
+
"gpt-6-astra ",
|
|
322
388
|
"gpt-6-astra",
|
|
389
|
+
"gpt-6-sol ",
|
|
390
|
+
"gpt-6-sol",
|
|
323
391
|
"gpt-5.6-sol",
|
|
324
392
|
"gpt-5.6-terra",
|
|
393
|
+
"gpt-6-luna ",
|
|
394
|
+
"gpt-6-luna",
|
|
325
395
|
"gpt-5.6-luna",
|
|
326
396
|
"gpt-5.5-pro",
|
|
327
397
|
"gpt-5.5",
|
|
@@ -339,18 +409,32 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
339
409
|
"gpt-5-mini",
|
|
340
410
|
],
|
|
341
411
|
"openai-codex": [
|
|
412
|
+
"gpt-6-astra ",
|
|
342
413
|
"gpt-6-astra",
|
|
414
|
+
"gpt-6-sol ",
|
|
415
|
+
"gpt-6-sol",
|
|
343
416
|
"gpt-5.6-sol",
|
|
344
417
|
"gpt-5.6-terra",
|
|
418
|
+
"gpt-6-luna ",
|
|
419
|
+
"gpt-6-luna",
|
|
345
420
|
"gpt-5.6-luna",
|
|
346
421
|
"gpt-5.5",
|
|
347
|
-
"gpt-5.4",
|
|
348
|
-
"gpt-5.4-mini",
|
|
349
422
|
"gpt-5.3-codex-spark",
|
|
350
423
|
],
|
|
351
424
|
opencode: [
|
|
425
|
+
"claude-opus-5-5 ",
|
|
426
|
+
"claude-opus-5-5",
|
|
352
427
|
"claude-opus-5",
|
|
353
428
|
"claude-fable-5",
|
|
429
|
+
"gpt-6-astra ",
|
|
430
|
+
"gpt-6-astra",
|
|
431
|
+
"gpt-6-sol ",
|
|
432
|
+
"gpt-6-sol",
|
|
433
|
+
"gpt-5.6-sol",
|
|
434
|
+
"gpt-5.6-terra",
|
|
435
|
+
"gpt-6-luna ",
|
|
436
|
+
"gpt-6-luna",
|
|
437
|
+
"gpt-5.6-luna",
|
|
354
438
|
"gpt-5.5-pro",
|
|
355
439
|
"gpt-5.5",
|
|
356
440
|
"gpt-5.4-pro",
|
|
@@ -362,6 +446,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
362
446
|
"gpt-5.3-codex",
|
|
363
447
|
"gpt-5.2-codex",
|
|
364
448
|
"gpt-5.1-codex",
|
|
449
|
+
"grok-4.6",
|
|
365
450
|
"grok-4.5",
|
|
366
451
|
"gemini-3.5-flash",
|
|
367
452
|
"gemini-3.1-pro",
|
|
@@ -392,8 +477,13 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
392
477
|
"kimi-k3",
|
|
393
478
|
"kimi-k2.7-code",
|
|
394
479
|
"kimi-k2.6",
|
|
480
|
+
"grok-4.7 ",
|
|
481
|
+
"grok-4.7",
|
|
482
|
+
"grok-4.6",
|
|
395
483
|
],
|
|
396
484
|
openrouter: [
|
|
485
|
+
"anthropic/claude-opus-5.5 ",
|
|
486
|
+
"anthropic/claude-opus-5.5",
|
|
397
487
|
"anthropic/claude-opus-5",
|
|
398
488
|
"anthropic/claude-fable-5",
|
|
399
489
|
"~anthropic/claude-fable-latest",
|
|
@@ -402,15 +492,21 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
402
492
|
"anthropic/claude-opus-4.6",
|
|
403
493
|
"anthropic/claude-opus-4.5",
|
|
404
494
|
"anthropic/claude-opus-4.1",
|
|
495
|
+
"openai/gpt-6-astra ",
|
|
496
|
+
"openai/gpt-6-astra",
|
|
497
|
+
"openai/gpt-6-sol ",
|
|
498
|
+
"openai/gpt-6-sol",
|
|
405
499
|
"openai/gpt-5.6-sol-pro",
|
|
406
500
|
"openai/gpt-5.6-sol",
|
|
407
501
|
"openai/gpt-5.6-terra-pro",
|
|
408
502
|
"openai/gpt-5.6-terra",
|
|
503
|
+
"openai/gpt-6-luna ",
|
|
504
|
+
"openai/gpt-6-luna",
|
|
409
505
|
"openai/gpt-5.6-luna-pro",
|
|
410
506
|
"openai/gpt-5.6-luna",
|
|
411
507
|
"openai/gpt-5.5-pro",
|
|
412
508
|
"openai/gpt-5.5",
|
|
413
|
-
"~openai/gpt-latest",
|
|
509
|
+
"~openai/gpt-astra-latest",
|
|
414
510
|
"google/gemini-3.1-pro-preview-customtools",
|
|
415
511
|
"google/gemini-3.1-pro-preview",
|
|
416
512
|
"~google/gemini-pro-latest",
|
|
@@ -421,6 +517,9 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
421
517
|
"~moonshotai/kimi-latest",
|
|
422
518
|
"moonshotai/kimi-k2.6",
|
|
423
519
|
"moonshotai/kimi-k2-thinking",
|
|
520
|
+
"x-ai/grok-4.7 ",
|
|
521
|
+
"x-ai/grok-4.7",
|
|
522
|
+
"x-ai/grok-4.6",
|
|
424
523
|
"x-ai/grok-4.5",
|
|
425
524
|
"~x-ai/grok-latest",
|
|
426
525
|
"deepseek/deepseek-v4-pro",
|
|
@@ -462,6 +561,34 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
462
561
|
"glm-5.2",
|
|
463
562
|
"deepseek-v4-flash-0731",
|
|
464
563
|
],
|
|
564
|
+
radius: [
|
|
565
|
+
"gpt-6-astra ",
|
|
566
|
+
"gpt-6-astra",
|
|
567
|
+
"claude-opus-5-5 ",
|
|
568
|
+
"claude-opus-5-5",
|
|
569
|
+
"claude-opus-5",
|
|
570
|
+
"gpt-6-sol ",
|
|
571
|
+
"gpt-6-sol",
|
|
572
|
+
"gpt-5.6-sol",
|
|
573
|
+
"gpt-5.6-terra",
|
|
574
|
+
"gpt-6-luna ",
|
|
575
|
+
"gpt-6-luna",
|
|
576
|
+
"gpt-5.6-luna",
|
|
577
|
+
"claude-fable-5-1",
|
|
578
|
+
"claude-fable-5",
|
|
579
|
+
"claude-opus-4-8",
|
|
580
|
+
"claude-sonnet-5",
|
|
581
|
+
"gpt-5.5",
|
|
582
|
+
"gpt-5.4",
|
|
583
|
+
"gpt-5.3-codex",
|
|
584
|
+
"kimi-k3",
|
|
585
|
+
"deepseek-v4-pro",
|
|
586
|
+
"glm-5.3",
|
|
587
|
+
"kimi-k2.7-code",
|
|
588
|
+
"deepseek-v4.1-flash",
|
|
589
|
+
"gpt-5.4-mini",
|
|
590
|
+
"glm-5.3-flash",
|
|
591
|
+
],
|
|
465
592
|
together: [
|
|
466
593
|
"deepseek-ai/DeepSeek-V4-Pro",
|
|
467
594
|
"moonshotai/Kimi-K3",
|
|
@@ -479,6 +606,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
479
606
|
"google/gemma-4-31B-it",
|
|
480
607
|
],
|
|
481
608
|
"vercel-ai-gateway": [
|
|
609
|
+
"anthropic/claude-opus-5.5 ",
|
|
610
|
+
"anthropic/claude-opus-5.5",
|
|
482
611
|
"anthropic/claude-opus-5",
|
|
483
612
|
"anthropic/claude-fable-5",
|
|
484
613
|
"anthropic/claude-opus-4.8",
|
|
@@ -487,8 +616,14 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
487
616
|
"anthropic/claude-opus-4.5",
|
|
488
617
|
"anthropic/claude-sonnet-5",
|
|
489
618
|
"anthropic/claude-sonnet-4.6",
|
|
619
|
+
"openai/gpt-6-astra ",
|
|
620
|
+
"openai/gpt-6-astra",
|
|
621
|
+
"openai/gpt-6-sol ",
|
|
622
|
+
"openai/gpt-6-sol",
|
|
490
623
|
"openai/gpt-5.6-sol",
|
|
491
624
|
"openai/gpt-5.6-terra",
|
|
625
|
+
"openai/gpt-6-luna ",
|
|
626
|
+
"openai/gpt-6-luna",
|
|
492
627
|
"openai/gpt-5.6-luna",
|
|
493
628
|
"openai/gpt-5.5-pro",
|
|
494
629
|
"openai/gpt-5.5",
|
|
@@ -513,6 +648,9 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
513
648
|
"google/gemini-3.1-pro-preview",
|
|
514
649
|
"google/gemini-3.5-flash",
|
|
515
650
|
"google/gemini-3-flash",
|
|
651
|
+
"spacexai/grok-4.7 ",
|
|
652
|
+
"spacexai/grok-4.7",
|
|
653
|
+
"spacexai/grok-4.6",
|
|
516
654
|
"xai/grok-4.5",
|
|
517
655
|
"xai/grok-4.20-reasoning",
|
|
518
656
|
"minimax/minimax-m3",
|
|
@@ -521,6 +659,8 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
521
659
|
"zai/glm-5.1",
|
|
522
660
|
],
|
|
523
661
|
xai: [
|
|
662
|
+
"grok-4.7 ",
|
|
663
|
+
"grok-4.7",
|
|
524
664
|
"grok-4.6",
|
|
525
665
|
"grok-4.5",
|
|
526
666
|
"grok-4.3",
|
|
@@ -533,9 +673,7 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
533
673
|
"nvidia/nemotron-3-ultra-550b-a55b",
|
|
534
674
|
"nvidia/nemotron-3-super-120b-a12b",
|
|
535
675
|
"moonshotai/kimi-k3",
|
|
536
|
-
"deepseek-ai/deepseek-v4-pro-0813",
|
|
537
676
|
"moonshotai/kimi-k2.6",
|
|
538
|
-
"minimaxai/minimax-m3",
|
|
539
677
|
"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning",
|
|
540
678
|
],
|
|
541
679
|
zai: [
|
|
@@ -546,13 +684,12 @@ const PROVIDER_MODEL_PREFERENCES: Record<string, string[]> = {
|
|
|
546
684
|
],
|
|
547
685
|
"zai-coding-cn": [
|
|
548
686
|
"glm-5.3",
|
|
549
|
-
"glm-5.
|
|
550
|
-
"glm-5-
|
|
551
|
-
"glm-
|
|
552
|
-
"glm-4.7",
|
|
687
|
+
"glm-5.3-highspeed",
|
|
688
|
+
"glm-5.3-flash",
|
|
689
|
+
"glm-4.6v",
|
|
553
690
|
],
|
|
554
|
-
moonshotai: ["kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6"
|
|
555
|
-
"moonshotai-cn": ["kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6"
|
|
691
|
+
moonshotai: ["kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6"],
|
|
692
|
+
"moonshotai-cn": ["kimi-k3", "kimi-k2.7-code", "kimi-k2.7-code-highspeed", "kimi-k2.6"],
|
|
556
693
|
};
|
|
557
694
|
|
|
558
695
|
const CONTRARIAN_SYSTEM_PROMPT = [
|
|
@@ -130,10 +130,10 @@ Where `r` is `gate.cachedPriceRatio` — the fraction of full price still paid
|
|
|
130
130
|
for cached tokens (default `0.1`, i.e. cached tokens cost ~10% of fresh
|
|
131
131
|
tokens). `breakEvenCalls` is how many subsequent LLM calls are needed to
|
|
132
132
|
recoup the one-time cache-bust cost via the recurring saving. The gate accepts
|
|
133
|
-
a batch of candidates only if `breakEvenCalls
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
[Roadmap](#roadmap) evidence).
|
|
133
|
+
a batch of candidates only if `breakEvenCalls` is at most the effective
|
|
134
|
+
threshold for the current state (`idle=22`, `mid_loop=1` by default,
|
|
135
|
+
calibrated from the representative-corpus benchmark — see the calibration
|
|
136
|
+
note under [Configuration](#configuration) and the [Roadmap](#roadmap) evidence).
|
|
137
137
|
|
|
138
138
|
All candidates proposed in the same `context` call share one cache bust (since
|
|
139
139
|
a prompt cache is a single linear prefix), so they're evaluated and
|
|
@@ -154,7 +154,7 @@ Gate modes (`/context-pruning gate <mode>`):
|
|
|
154
154
|
### `/prune`
|
|
155
155
|
|
|
156
156
|
Interactive picker (TUI/RPC) over every prunable tool result in the current
|
|
157
|
-
|
|
157
|
+
model context:
|
|
158
158
|
|
|
159
159
|
```text
|
|
160
160
|
/prune
|
|
@@ -179,7 +179,7 @@ branch:
|
|
|
179
179
|
/context-pruning gate <on|off|always-apply>
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
- `status`: enabled state, gate mode/
|
|
182
|
+
- `status`: enabled state, gate mode/effective per-state thresholds/ratio, per-strategy on/off
|
|
183
183
|
state, protection counts, last call's raw/effective/saved token snapshot,
|
|
184
184
|
and current context usage.
|
|
185
185
|
- `stats`: cumulative tokens saved, overall and per strategy.
|
|
@@ -223,7 +223,7 @@ never required to exist. Full shape, with defaults:
|
|
|
223
223
|
"mode": "on",
|
|
224
224
|
"cachedPriceRatio": 0.1,
|
|
225
225
|
"breakEvenThreshold": 22,
|
|
226
|
-
"breakEvenThresholdByState": { "idle": 22, "mid_loop":
|
|
226
|
+
"breakEvenThresholdByState": { "idle": 22, "mid_loop": 1 }
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
```
|
|
@@ -243,7 +243,8 @@ Notes:
|
|
|
243
243
|
break-even math (`gate.*`), which is a separate, later check on whatever
|
|
244
244
|
survives this floor.
|
|
245
245
|
- `gate.breakEvenThresholdByState` lets `idle` vs `mid_loop` agent states use
|
|
246
|
-
different thresholds;
|
|
246
|
+
different thresholds; `idle` defaults to `22` and
|
|
247
|
+
`mid_loop` defaults to `1`. Real
|
|
247
248
|
mid-loop/idle detection is wired through the `context` event handler
|
|
248
249
|
(pe-zy4s): the state is classified straight from the message payload —
|
|
249
250
|
`idle` if the most recent relevant message is a user message (this is the
|
|
@@ -253,9 +254,15 @@ Notes:
|
|
|
253
254
|
runtime-observable definition and found the state-split REVERSED from an
|
|
254
255
|
earlier turn-end-based analysis: at r=0.1, `idle` candidates now carry
|
|
255
256
|
essentially all the realized net benefit and `mid_loop` candidates carry
|
|
256
|
-
essentially none.
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
essentially none. At r=0.1, the measured corpus therefore supports a
|
|
258
|
+
conservative `mid_loop=1` default, while `idle` remains `22`. Mid-loop
|
|
259
|
+
pruning can amortize over enough subsequent calls, but the observed
|
|
260
|
+
candidates did not justify a more permissive threshold. Turn-start
|
|
261
|
+
classification does not imply the provider cache is cold. The reported
|
|
262
|
+
field capture (2026-09-08: a mid_loop prune at `T=22` invalidated 81% of a
|
|
263
|
+
warm request prefix between consecutive LLM calls separated only by a
|
|
264
|
+
toolResult) illustrates cache invalidation, not proof that amortization is
|
|
265
|
+
impossible. Set `mid_loop` back to `22` to restore the old parity behavior.
|
|
259
266
|
- `gate.breakEvenThreshold`'s default of `22` is calibrated from the
|
|
260
267
|
representative-corpus benchmark at `cachedPriceRatio` r=0.1 (aggressive
|
|
261
268
|
prompt caching, the common case) — see [Roadmap](#roadmap) for the full
|
|
@@ -448,11 +455,13 @@ re-derived on the representative corpus (460 gate-eligible candidates on the
|
|
|
448
455
|
current `~/.the-last-harness/agent/sessions` corpus). The split **reverses**:
|
|
449
456
|
at r=0.1, `idle` (T=22, ~20.6k realized net benefit) now carries essentially
|
|
450
457
|
all the value, and `mid_loop` (T=1, ~0 realized net benefit) carries
|
|
451
|
-
essentially none.
|
|
452
|
-
is shown ~worthless),
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
458
|
+
essentially none. Under that ticket's decision rule (stricter idle default
|
|
459
|
+
only if idle is shown ~worthless), parity (`22`/`22`) was retained at the time.
|
|
460
|
+
The 2026-09-08 follow-up supersedes that default with `idle=22` / `mid_loop=1`,
|
|
461
|
+
using the measured mid-loop result to choose a conservative threshold (see
|
|
462
|
+
[Configuration](#configuration) for the evidence and limitations). The table
|
|
463
|
+
above is retained as the historical turn-END-definition record; it no longer
|
|
464
|
+
reflects how the runtime classifies agent state.
|
|
456
465
|
|
|
457
466
|
**This reframes, rather than weakens, the case for v2.** Small deterministic
|
|
458
467
|
removals (dedupe/error-purge/superseded-file-ops) structurally cannot beat
|