Repository navigation
Add per-model compaction budgets across Aiden runtimes - #301
Conversation
very-hermes-bot
left a comment
There was a problem hiding this comment.
Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.
Hermes Review BotConfidence: 5 Engine: SummaryPer-model compaction budgets allow users to set exact token reservation and retention targets for individual provider/model combinations in Settings → Memory, replacing the previous global default across all models. The configuration is validated and stored in Confidence Score: 5/5Fully traced and verified end-to-end across IPC boundaries, DataStore persistence, runtime context projection, subagent supervisor inheritance, and test coverage. 📁 Important Files Changed
FindingsNo findings. 📊 Sequence DiagramsequenceDiagram
autonumber
actor User
participant UI as MemorySettings / CompactionBudgetSettings
participant IPC as IPC Main (providers.ts)
participant Store as ConfigStore (config-store-core.ts)
participant Runtime as LLM Client / Subagents / ContextLifecycle
participant Coord as PiCompactionCoordinator
User->>UI: Configure model budget (reserveTokens / keepRecentTokens)
UI->>IPC: settings:setCompactionModelBudget(modelKey, budget)
IPC->>Store: setCompactionModelBudget(modelKey, budget)
Store->>Store: Atomic mutation & parseCompactionModelOverrides
Store-->>UI: Return updated AppSettings
Runtime->>Store: getCompactionSettings() / getSettings()
Store-->>Runtime: CompactionSettingsSnapshot (memoized)
Runtime->>Coord: Initialize with resolveCompactionModelBudget()
Machine-Readable Findings[]
|
There was a problem hiding this comment.
Important
The post-instruction capacity recheck can bypass a configured model reserve; please address this before merging.
Reviewed changes This review covers per-model compaction budget validation, persistence, propagation across foreground/manual/subagent runtimes, and the Memory settings UI.
- Validated model overrides. Exact provider/model keys and bounded reserve/recent-token values are persisted, with malformed external values ignored at runtime.
- Applied budgets across runtimes. Captured overrides feed generation projection, context pressure, manual compaction, and child compaction, with small-window bounds and immutable subagent snapshots.
- Added Settings and behavior coverage. Memory settings expose editing/reset, while tests cover persistence, limits, and captured budgets.
gpt-6-luna | 𝕏
# Conflicts: # main/services/portable-config-core.test.ts
There was a problem hiding this comment.
ℹ️ No new compaction findings in the merge-only delta; the prior capacity-check finding remains open.
Reviewed changes This incremental review covers the commits added since the prior review: the branch merged the latest codex/pi-1-runtime baseline, and the compaction feature diff is unchanged relative to that base.
- Merged the updated runtime baseline. Commit
0edec179brings inc42320a2, which updates CLI MCP revocation handling; it adds no compaction-budget behavior.
gpt-6-luna | 𝕏
…dex/pi-1-compaction
There was a problem hiding this comment.
ℹ️ No new compaction findings in the merged integrations baseline; the prior capacity-check finding remains open.
Reviewed changes This incremental review covers the merge added since the prior review. The codex/pi-1-integrations baseline adds codemode/deferred-tool and MCP OAuth work; the compaction feature diff remains unchanged against the updated base.
- Merged the integrations baseline. The new Pi runtime tool partitioning retains the existing captured compaction reserve, and the merge introduces no additional compaction-budget behavior.
gpt-6-luna | 𝕏
There was a problem hiding this comment.
ℹ️ No new compaction findings in the latest baseline merge; the prior capacity-check finding remains open.
Reviewed changes This incremental review covers the merge added since the prior review. It brings in the latest codex/pi-1-integrations commit, with no change to the compaction-budget feature diff.
- Merged latest integration fixes. The update preserves stdio MCP initialization and registers Pi codemode/tool-discovery suites in CI; it adds no compaction-budget behavior.
gpt-6-luna | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues were found in this CI-only incremental delta. The existing capacity-check thread is unchanged and remains open.
Reviewed changes This incremental review covers the VCC worker prerequisite correction added after the previous Pullfrog review.
- Registered the VCC worker build. Added
vcc-buildto theruntime-subagentslane and allowed that lane in the prerequisite mapping, so standalone CI plans the worker build before child-compaction tests. - Strengthened the registry check. Extended the behavioral test to verify the lane assignment and prerequisite eligibility.
- Recorded the CI root cause. Added the failure reproduction and validation context to
.memory/pi-100-ci-prerequisites.md.
gpt-6-luna | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes This incremental review covers changes since the prior Pullfrog review: the instruction-capacity correction, new-model editing behavior, and updated integrations merge.
- Revalidated instruction updates. Initial and refreshed AGENTS changes now check the updated system prompt and tools against the generation's captured reserve before publishing; coverage verifies oversized instructions reject without replacing the previously admitted prompt.
- Preserved in-progress budget values. Typing a new exact model key no longer clears reserve/recent values, with Electron coverage through save, relaunch, and reset.
- Merged the updated integrations baseline. The merge introduces no new compaction-budget concerns in the reviewed delta.
gpt-6-luna | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes This incremental review covers the merge added since the previous Pullfrog review.
- Established the held-response phase. Added a provider-request check before navigating away in the detached-response Stop E2E scenario, and documented the related hosted flake investigation and validation.
gpt-6-luna | 𝕏
|
Run failed. View the logs →
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes This incremental review covers the merge since the prior Pullfrog review. The PR's compaction-budget implementation remains unchanged in this delta.
- Imported the updated main baseline. Merged the plan archive/status refresh and generated offline model-capability snapshot.
- Updated ActivityKit test synchronization. Replaced polling assertions with delivered-content events and a failure-only ceiling.
gpt-6-luna | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes This incremental review covers the documentation-only Pi plan-status correction merged since the previous Pullfrog review.
- Corrected the active Pi plan status. Marked PR #302's provider/MCP OAuth metadata work implemented across the plan index and parity checklist; no runtime behavior changed.
gpt-6-luna | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes This incremental review covers the normal integration merges since the prior Pullfrog review: the refreshed integrations baseline and its documentation and status updates.
- Integrated the main baseline. Merged the latest
codex/pi-1-integrationsupdates, including #308's ActivityKit delivery-test correction, the offline model-capability refresh, and plan archives. - Reconciled Pi plan status. Updated the Pi parity plan and index to record PR #302's custom MCP OAuth metadata override as implemented.
gpt-6-luna | 𝕏
…om shrinking budgets (PR-301-1, PR-301-2) Name the renderer's 16,384 / 20,000 fallbacks as shared constants, use them for the settings descriptions and placeholders, and check them against pi's DEFAULT_COMPACTION_SETTINGS so a pi upgrade cannot silently drift. A model override that set only keepRecentTokens used to resolve a full budget whose reserve fell back to pi's 16,384 default, which then replaced the model-derived request reserve and shrank the input budget of small-window models. The input-budget reserve now applies only when the user configured reserveTokens; pi's compaction settings still receive the complete budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f all settings (PR-301-4) The composer's context meter runs while the user types and was cloning and re-normalizing the entire settings document on every call just to read two compaction fields. The config store now exposes getCompactionSettings, which reparses only when the settings store replaces its cached document (on every write or external reload), and context pressure uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saving a budget fetched all settings and wrote the whole override map back, costing two round trips and losing a concurrent edit to another model. A new settings:setCompactionModelBudget IPC merges or clears one validated entry inside the settings mutation, and refuses to overwrite a hand-edited invalid map. The Memory page also stops firing a Codex auth-status request on open and window focus (it reuses cached Codex models), and memoizes the model suggestion list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes This incremental review covers the compaction optimizations and atomic settings updates added since the prior Pullfrog review at ed8c88a3.
- Preserved recent-only input budgets. Applied an explicit-only request reserve consistently across foreground generation, child runtimes, and context-pressure reads while retaining the complete Pi compaction settings.
- Centralized renderer defaults. Replaced duplicated default values with shared constants and checked them against Pi's runtime defaults.
- Memoized compaction preferences. Reused validated settings snapshots until the stored document changes, with coverage for writes and external reloads.
- Saved model budgets atomically. Added per-model IPC mutations that preserve concurrent edits, clear individual overrides, and refuse to overwrite malformed stored maps.
- Reduced passive settings work. Reused cached Codex model suggestions without initiating auth-status reads and memoized suggestion lists.
Validation: 348 focused tests and root TypeScript passed after aligning installed dependencies with this branch using npm ci. Exact-head hosted CI remains pending; this approval does not establish merge acceptance.
gpt-6.1-sol | 𝕏

Aiden previously used one compaction budget for every model. Settings → Memory now supports exact provider/model overrides for reserved and recent tokens, with validation and reset to defaults. Automatic foreground and subagent runs capture immutable settings; manual compaction uses the saved model's budget. The context meter follows the same reserve while preserving existing safety floors and unconfigured defaults.
The change preserves the existing Pi journal format, bounds impossible budgets for small windows and pi-vcc, ignores malformed externally edited budgets at runtime, and leaves mobile/Remote DTOs unchanged.
Stacked on #302 (
codex/pi-1-integrations) through normal merges, including the atomic desktop/CLI Pi 1.0 upgrade and mainafe51116d.Validation:
--fail-on-flaky-tests.After merging the latest integrations baseline: 126 focused compaction/config/child/codemode/tool-discovery tests and root TypeScript passed.
CI follow-up: an earlier hosted inventory job failed because newly added test files were missing from the explicit CI lane registry. Registration is now fixed in both the package scripts and CI registry; local registry validation passes. This was a configuration defect, not a flaky test.
CI follow-up (VCC build): runtime-subagents job110926895585 exposed a missing worker-build prerequisite for the zero-retention child compaction test. The lane now builds VCC first, and the CI registry regression verifies that mapping. A controlled missing-worker reproduction matched the failure; the real lane-selected build followed by the focused test passes on Node22.22.3. This was a deterministic CI configuration defect.
Review follow-up:
Editing a new model key preserves unsaved budgets. Initial and refreshed AGENTS instructions are checked against the captured model reserve before changing the admitted context. Restack validation at
0c5cefe65: 229 focused tests, CI policy47, and root types pass after building the required native reader and VCC worker. The earlier real Electron save/relaunch/reset regression also passes. A direct local test invocation initially omitted those build prerequisites; the correctly prepared run passed without production changes.Validation counts above identify local or historical evidence, not hosted acceptance of a newer commit. Exact-head CI acceptance is recorded below; no PR in this stack has been merged. Historical failures and rerun evidence are retained above.
Historical exact-head CI acceptance
Verified 2026-10-02 at 20:35 UTC: all 23 reported checks passed on
a1e480adac29b075904db379072506e00aae6f38, and all review threads are resolved. Historical failures and local validation scopes remain documented above. No PR has been merged; signed-package, physical-device, and live paid-provider acceptance remain separate.Main integration and current CI
Main
2681471deis merged through the stack using normal merges. Head at that checkpoint:dc2831f880fde5d6227cdcabd6b7621ded87750c. This brings in #308’s correction for ActivityKit content delivery, the committed offline model catalog refresh, and the plan archive updates while preserving the active Pi plan. Earlier green checks above apply only to their recorded historical heads. Current-head CI is pending.Local validation of the foundation merge passed 26 native integration tests, 204 offline catalog tests, 47 CI policy tests, and root/CLI TypeScript. Native tests used an explicitly selected iPhone 17 Pro / iOS 26.2 simulator with Xcode 27 beta; this is regression evidence, not physical-device or signed-release acceptance. All 96 plan-index links resolve. The remaining stack merges introduced no application, protocol, package, CI-registry, or vendored-advisor changes beyond the imported main delta. No old-head hosted job rerun was used; historical failures remain recorded.
Current-head reviewer status: Pullfrog run 37062326184 failed before review execution because the configured ChatGPT reviewer account reached its usage limit. No hosted retry has been requested while that quota condition persists. Product CI and review acceptance remain pending.
Reviewer retry: the reviewer service successfully completed #304 run37070135572 on its current head, providing evidence that capacity returned. On 2026-10-02, the single permitted retry of reviewer run 37062326184 was accepted for this PR’s unchanged
dc2831f880fde5d6227cdcabd6b7621ded87750chead. The original quota failure remains recorded; the retry result is pending. No second retry will be used.Plan-status review correction
Current head:
ed8c88a3a14ed02ccfae67b15676ff578c6c059c. The #302 plan index and detail page now identify the custom MCP OAuth authorization-server metadata override as implemented, while retaining unfinished work as active. Normal downstream merges preserve their fuller completion summaries and acceptance matrix. This correction changes documentation only; all 96 local plan-index links resolve, and the cache-warming cancellation/accounting fix remains included. Review thread PRRT_kwDOTctvDc6ogeYl was answered and resolved with commit56cb16abacd1ec96ddbfc897f72fd9e0a549a2c2. Prior behavioral validation retains its recorded scope; fresh exact-head CI is pending.The previous-head reviewer retry completed successfully with no new issues. The current documentation-only head was also reviewed with no new issues. The original quota failure remains recorded; the single permitted retry has been used and will not be repeated.
Current exact-head CI acceptance
Verified 2026-10-02 at 23:26 UTC: all 23 reported checks passed on
ed8c88a3a14ed02ccfae67b15676ff578c6c059c, and all review threads are resolved. Reviewer checks found no new issues after the main synchronization and documentation-only status correction. Historical failures and the single reviewer retry remain documented above. No PR has been merged; signed-package, physical-device and live paid-provider acceptance remain separate.