Skip to content

feat(core): fold compactions into model requests - #85

Open
LukasParke wants to merge 2 commits into
mattapperson:mainfrom
LukasParke:lukeparke/openrouter-compaction-runtime
Open

feat(core): fold compactions into model requests#85
LukasParke wants to merge 2 commits into
mattapperson:mainfrom
LukasParke:lukeparke/openrouter-compaction-runtime

Conversation

@LukasParke

Copy link
Copy Markdown
Collaborator

What

  • fold compaction records before model request assembly in raw-log index space
  • apply the same folding to preview requests
  • emit {name}:context_pressure when folded history crosses compactAt
  • emit at most once per step execution, without latching filtered/under-threshold checks

Why

Item 15 provides explicit compaction records and pure projection. The runtime must fold those records before system/history partitioning or replacesUntil indexes drift and live turns can be deleted. Pressure events let callers compact before hard budget trimming silently drops history.

This ports item 16 from fork/port/openrouter-fixes commits 1761e6b7 and b83bdd91.

Test plan

  • 35 focused compaction/runtime tests pass
  • core typecheck
  • root lint
  • sentrux check .
  • sentrux gate .
  • clean-context Pi review; added no-layer pressure emission and verified fold-before-partition semantics

Dependency

Depends on #80. The diff currently includes its prerequisite and must be rebased through main after #80 merges. Allocator changes are not included.

Port item 15 from fork/port/openrouter-fixes commits 3d65b3e and 135ac3f: compaction records, pure projection, and pressure helpers. Model-call folding/events remain item 16.

Signed-off-by: Luke Parke <5702154+LukasParke@users.noreply.github.com>
Port item 16 from fork/port/openrouter-fixes commits 1761e6b and b83bdd9: fold in raw index space across execution/preview paths and emit context_pressure only on real threshold crossings.

Signed-off-by: Luke Parke <5702154+LukasParke@users.noreply.github.com>
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown

@LukasParke is attempting to deploy a commit to the Matt Apperson's projects Team on Vercel.

A member of the Team first needs to authorize it.

@LukasParke

Copy link
Copy Markdown
Collaborator Author

Agent: Code CI/structural/DCO are green where configured; remaining external red checks are compat with an empty upstream OPENROUTER_API_KEY and Vercel authorization. Where core CI is red, the only failure is the unrelated timing-sensitive executeRunCode retry-backoff test; affected local/full suites passed. I cannot rerun upstream Actions without admin rights.

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