Skip to content

Add configurable morph cache - #8

Merged
KickNext merged 3 commits into
mainfrom
agent/configurable-morph-cache
Aug 20, 2026
Merged

Add configurable morph cache#8
KickNext merged 3 commits into
mainfrom
agent/configurable-morph-cache

Conversation

@KickNext

Copy link
Copy Markdown
Owner

What changed

  • add a public MorphCache API with required maxMorphs and maxBytes limits
  • expose defaults and read-only cache statistics
  • add configure, clear, disable, and reset lifecycle controls
  • share completed morph plans through an application-wide LRU cache
  • keep pending and oversized morphs out of the retained cache
  • document cache identity, byte accounting, and interruption behavior
  • add focused coverage for limits, eviction, statistics, validation, reset, and async invalidation

Why

Morph cache limits were previously hard-coded. Applications with different transition sets and memory budgets had no supported way to tune or disable retained morph plans, inspect usage, or clear the cache safely.

Developer impact

Existing behavior remains the default. Developers can opt into explicit limits before runApp:

MorphCache.configure(
  maxMorphs: 100,
  maxBytes: 16 << 20,
);

Validation

  • flutter analyze
  • flutter test — 127 tests passed
  • flutter test in example — 24 tests passed
  • flutter build web --release
  • dart pub publish --dry-run — only the expected dirty-worktree warning
  • git diff --check

Local Chrome/Edge headless test launching was unavailable in this desktop environment; the release web build completed successfully.

@KickNext
KickNext marked this pull request as ready for review August 19, 2026 21:42
@KickNext
KickNext merged commit 291dd3c into main Aug 20, 2026
3 checks passed
@KickNext
KickNext deleted the agent/configurable-morph-cache branch August 20, 2026 02:26
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