Skip to content

feat(core): persist compaction model and provider state - #46962

Open
rekram1-node wants to merge 1 commit into
v2from
compaction-state
Open

feat(core): persist compaction model and provider state#46962
rekram1-node wants to merge 1 commit into
v2from
compaction-state

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Issue for this PR

None.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Completed compaction messages and completion events now require model: Model.Ref and may carry providerState, using the same opaque state schema as assistants. State comes from the accepted summarization attempt and the route's provider-metadata namespace; rejected-attempt state is discarded.

Existing checkpoints and stored completion events get a best-effort model backfill from earlier model-bearing history, then later history, then the session model. unknown/unknown is the final fallback. Older exports remain importable and are normalized before storage; inferred models never acquire provider state. Existing database import paths are covered too.

Projection, clients, export/import, and sanitized exports preserve or redact the fields appropriately. Generated clients and existing fixtures are updated for the required field.

No changes to prompts, summary/recent content, retained history, or native-compaction execution/replay.

How did you verify your code works?

  • 342 focused Core tests passed, including migration, retry-state isolation, projection replay, and transfer coverage.
  • 146 Client tests and 139 focused TUI tests passed.
  • All 3 new Schema tests passed. Full Schema suite: 58 passed, 1 pre-existing failure at test/contract-hygiene.test.ts:244 because unchanged src/integration.ts:62,68 uses Schema.Any.
  • Core, Client, Schema, Protocol, Server, TUI, App, and website typechecks passed.
  • Migration registry, generated documentation, and diff checks passed.
  • Exercised the actual migration against a copied evaluation database in a rolled-back transaction: all 573 completed checkpoints received models, none needed the fallback. The copy and production database were left unchanged.

Screenshots / recordings

Not applicable; no UI behavior changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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