Skip to content

Comments

Remove plugin-side compaction#71

Merged
riatzukiza merged 3 commits intodevfrom
remove-plugin-compaction
Nov 21, 2025
Merged

Remove plugin-side compaction#71
riatzukiza merged 3 commits intodevfrom
remove-plugin-compaction

Conversation

@riatzukiza
Copy link
Collaborator

Summary

  • remove plugin-side compaction logic, commands, config knobs, and associated specs/tests so compaction is left to OpenCode/host
  • update docs and sample configs to reflect caching-only controls

Testing

  • pnpm test
  • pnpm lint (warnings only from existing worktree lint rules)

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

Summary by CodeRabbit

  • Chores
    • Removed Codex compaction feature including all associated configuration options and processing logic. This streamlines the system architecture by eliminating conversation compaction from the request handling pipeline and reducing the surface area of available settings, leading to simplified configuration and clearer operational behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

The PR removes the Codex compaction feature: deletes compaction configuration fields, strips compaction logic from request/response transformation, simplifies related function signatures/types, and removes compaction-focused tests.

Changes

Cohort / File(s) Change Summary
Configuration & Types
lib/config.ts, lib/types.ts
Removed enableCodexCompaction, autoCompactTokenLimit, and autoCompactMinMessages from defaults and PluginConfig.
Request Processing Core
lib/request/fetch-helpers.ts, lib/request/request-transformer.ts
Eliminated compaction imports, helpers and state; simplified transformRequestForCodex (keeps _pluginConfig unused); removed CompactionDecision/CompactionOptions usage and compactionDecision from return types.
Response Handling
lib/request/codex-fetcher.ts
Removed compaction finalization step and finalizeCompactionResponse import/invocation after successful responses.
Test Suites — Compaction Feature
test/codex-compaction.test.ts, test/compaction-executor.test.ts, test/compaction-helpers.test.ts
Deleted entire test files that validated compaction commands, summaries, finalization, and session persistence.
Test Updates — Remaining Files
test/codex-fetcher.test.ts, test/fetch-helpers.test.ts, test/plugin-config.test.ts
Removed compaction mocks, configuration fields and assertions; updated call sites to match new signatures and default configs.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant Fetcher as CodexFetcher
  participant Transformer as RequestTransformer
  participant API as CodexAPI
  rect rgb(235,245,255)
    Note over Client,Transformer: Old flow (with compaction)
    Client->>Fetcher: send request
    Fetcher->>Transformer: transformRequestForCodex (includes compaction state)
    Transformer-->>Fetcher: transformed body + compactionDecision
    Fetcher->>API: call Codex
    API-->>Fetcher: response
    alt compactionDecision present
      Fetcher->>Fetcher: finalizeCompactionResponse(response, compactionDecision)
    end
  end
  rect rgb(245,255,235)
    Note over Client,Transformer: New flow (compaction removed)
    Client->>Fetcher: send request
    Fetcher->>Transformer: transformRequestForCodex (no compaction)
    Transformer-->>Fetcher: transformed body
    Fetcher->>API: call Codex
    API-->>Fetcher: response
    Fetcher-->>Client: return response (no compaction finalization)
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Areas requiring attention:

  • lib/request/fetch-helpers.ts — confirm all callers tolerate the removed compaction return fields and the unused _pluginConfig parameter.
  • lib/request/request-transformer.ts — ensure removal of compaction and skip flags didn't change tool evaluation or transform ordering.
  • Tests — three deleted test files create coverage gaps; validate remaining tests sufficiently cover session/context and transform behavior.

Possibly related PRs

Poem

🧹 The compaction code took a graceful bow,
Lines trimmed away, the pipeline hums now,
No more decisions tucked in the trace,
Simpler transforms, a lighter place. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Remove plugin-side compaction' directly and clearly describes the main objective of the changeset, which is to remove compaction logic and related configuration from the codebase.
Description check ✅ Passed The description clearly relates to the changeset, outlining the removal of plugin-side compaction logic, configuration knobs, tests, and documentation updates—all reflected in the actual code changes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-plugin-compaction

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8c1039 and a7dac97.

⛔ Files ignored due to path filters (1)
  • README.md is excluded by none and included by none
📒 Files selected for processing (3)
  • lib/config.ts (0 hunks)
  • lib/types.ts (0 hunks)
  • test/plugin-config.test.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • lib/types.ts
  • lib/config.ts
🔇 Additional comments (1)
test/plugin-config.test.ts (1)

47-156: Test expectations correctly updated to remove compaction fields.

All test cases have been consistently updated to expect only the three remaining configuration fields (codexMode, enablePromptCaching, and logging). The removal of enableCodexCompaction and autoCompactMinMessages is clean and aligns with the PR objective to remove plugin-side compaction.


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

@riatzukiza riatzukiza enabled auto-merge November 21, 2025 21:48
@riatzukiza riatzukiza merged commit 89fb08b into dev Nov 21, 2025
15 of 16 checks passed
@riatzukiza riatzukiza deleted the remove-plugin-compaction branch November 21, 2025 21:56
github-actions bot added a commit that referenced this pull request Nov 21, 2025
@riatzukiza riatzukiza mentioned this pull request Nov 21, 2025
riatzukiza added a commit that referenced this pull request Nov 21, 2025
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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