Skip to content

Respect model output limits during compaction - #26

Merged
hawkff merged 1 commit into
mainfrom
fix/pi-1.4-compaction
Oct 21, 2026
Merged

hawkff merged 1 commit into
mainfrom
fix/pi-1.4-compaction

Conversation

@hawkff

@hawkff hawkff commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Use the model's output limit for compaction when no explicit token cap is supplied, matching Pi 1.4.0.
  • Preserve low-effort summaries, bounded retries, and rejection of incomplete or empty summaries.
  • Update the Pi SDK baseline to 1.4.0 and prepare version 0.2.2.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Compaction now uses the model’s output limit when the caller supplies no explicit cap.

  • Compaction requests without a cap start with the model’s output limit.
  • The package moves to version 0.2.2 and the Pi SDK baseline moves to 1.4.0.

No actionable issues found. Tests were not run; dependencies are not installed in this checkout.

Reviews (1) · Last reviewed commit: "Respect model output limits during compa..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 964a23f2-0aa6-4698-ac6d-a389fcf4e7ba
📥 Commits

Reviewing files that changed from the base of the PR and between 89ab4c8 and 1a1db42.

⛔ Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing: 4
  • .gitignore
  • package.json
  • src/compaction.ts
  • test/compaction.test.ts
💤 Files with no reviewable changes: 1
  • .gitignore

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Improved automatic compaction retries by allowing larger retry requests when model limits permit.
    • Compaction now consistently respects the model’s maximum output capacity.
    • Prevented unnecessary retries when the available context is exhausted.
  • Chores

    • Updated the application release version.
    • Refined project configuration and development tooling.

Compaction retries now use a 32,768-token fallback, subject to the model’s positive token limit. Tests cover token selection and updated retry outcomes. The package version and development dependency ranges change, and several tool-directory ignore rules are removed.

Changes: Compaction retry token selection

Layer / File(s) Summary
Retry token selection and validation
src/compaction.ts, test/compaction.test.ts
The fallback token value changes from 16,384 to 32,768, while remaining capped by the model’s positive maxTokens limit. Tests cover token selection, request limits, retry counts, usage totals, and prompt propagation.

Package metadata

Layer / File(s) Summary
Version and development dependencies
package.json
The package version changes from 0.2.1 to 0.2.2. The development dependency ranges for @earendil-works/pi-ai, pi-coding-agent, and pi-tui change from ^1.3.0 to ^1.4.0.

Ignore rules

Layer / File(s) Summary
Tool directory exclusions
.gitignore
Ignore rules for .pi/, .pi-subagents/, .agents/, .claude/, and .codex/ are removed. The exclusions for /auth.json, /config.json, and /models.json remain.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 1a1db

No actionable merge-blocking risk is established by the reviewed changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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 1 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly describes the main change: compaction now respects model output limits.
Description check Passed The description directly explains the compaction behavior, SDK update, and version update in the changeset.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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 1 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hawkff
hawkff merged commit da8771a into main Oct 21, 2026
6 checks passed
@hawkff
hawkff deleted the fix/pi-1.4-compaction branch October 21, 2026 23:28
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.

1 participant