Repository navigation
Recover capped and empty compaction summaries - #20
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe extension now identifies compaction requests through their abort signals and routes them through a provider stream wrapper. The wrapper retries qualifying incomplete summaries and reports completion or failure. Tests and documentation cover the recovery behavior and its constraints. ChangesCompaction recovery
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Pi
participant Extension as extensions/index.ts
participant Provider as createCliproxyProvider
participant Recovery as withCompactionRecovery
participant Stream as provider streamSimple
Pi->>Extension: session_before_compact(abortSignal)
Extension->>Extension: record abortSignal in WeakSet
Extension->>Provider: pass compactionSignals
Provider->>Recovery: wrap streamSimple
Pi->>Recovery: request compaction summary
Recovery->>Stream: send request with bounded summary settings
Stream-->>Recovery: return response
alt response is capped or empty and retry is allowed
Recovery->>Stream: retry with increased output allowance
Stream-->>Recovery: return retry response
end
Recovery-->>Pi: emit completion or error
Merge Risk: ⚪ Minimal · up to This change limits compaction thinking to low and retries capped or empty summaries once. Incomplete checkpoints are rejected rather than saved. No merge-blocking risk was identified in the supplied context. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 5 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Limit compaction thinking to low without changing chat settings. Retry capped or empty summaries once, count both attempts' usage, and reject incomplete checkpoints.
Keep Pi's native history selection, file tracking, cancellation, and transient retries. Update the Pi development dependencies to 1.1.0 and document the behavior against CLIProxyAPI 8.0.22.
Summary by CodeRabbit
Note
Add
withCompactionRecoveryto retry capped and empty compaction summarieswithCompactionRecoveryin compaction.ts for consumers relying on old empty-summary behavior.Macroscope summarized 9dd18f1.

Confidence Score: 5/5
The PR appears safe to merge; no actionable defects were established.Summary
Adds recovery for capped or empty compaction summaries without changing chat settings.
session_before_compact.No actionable issues were established. Tests were not run; dependencies were not installed.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Provider request] --> B{Marked compaction signal?} B -->|No| C[Original stream unchanged] B -->|Yes| D[Limit thinking and output budget] D --> E[Request summary] E --> F{Empty or capped with room to grow?} F -->|Yes, not cancelled, no tool calls| G[Retry once] G --> H[Add usage from both attempts] F -->|No| I[Check final response] H --> I I --> J[Return final result to Pi compactor]Reviews (1) · Last reviewed commit: "Recover capped and empty compaction summ..." · Reviewed by Greptile