Skip to content

fix(local-inference): preserve featured model size on delete and backfill missing sizes - #10422

Merged
michaelneale merged 1 commit into
aaif-goose:mainfrom
harrykamboj1:fix/preserve-featured-model-size
Jul 21, 2026
Merged

fix(local-inference): preserve featured model size on delete and backfill missing sizes#10422
michaelneale merged 1 commit into
aaif-goose:mainfrom
harrykamboj1:fix/preserve-featured-model-size

Conversation

@harrykamboj1

Copy link
Copy Markdown
Contributor

What

  • delete_model no longer zeroes size_bytes for featured models — the known size persists so the UI still shows it and recommendations still work after a delete. Only the on-disk files, storage path, and shard files are reset.
  • sync_with_featured now backfills size_bytes for an existing entry when it is 0 and a resolved size is available. It never overwrites a non-zero size and never touches user settings or storage type.
  • ensure_featured_models_current resolves size metadata for featured models that have size_bytes == 0 and are not downloaded (needs_size).
  • recommend_local_model uses file_size() (which falls back to on-disk size) instead of the raw size_bytes field.

Why

Deleting a featured model previously wiped its size, hiding it in the UI and excluding it from recommend_local_model (which filters on size_bytes > 0). Featured entries added before their size resolved were also never backfilled. See #10421.

Tests

Added env-lock as a dev-dependency and two unit tests in local_model_registry.rs:

  • delete_featured_model_preserves_size_bytes
  • sync_with_featured_backfills_size_without_touching_settings

Checklist

  • cargo fmt
  • cargo clippy --all-targets -- -D warnings
  • cargo test -p goose-local-inference

Closes #10421

@The-Best-Codes The-Best-Codes self-assigned this Jul 14, 2026
@The-Best-Codes
The-Best-Codes self-requested a review July 14, 2026 15:37
Comment on lines +55 to +57

[dev-dependencies]
env-lock.workspace = true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this new dependency necesarry?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the two new tests set GOOSE_PATH_ROOT to a tempdir so delete_model/sync_with_featured don't write to the real goose data dir, and env_lock::lock_env serializes the env-var mutation across parallel tests (plain std::env::set_var would race). It's dev-dependencies only, and env-lock is already a workspace dependency used with this same pattern in other crates (e.g. goose/src/config/declarative_providers.rs tests), so this just reuses the existing convention rather than adding anything new to the tree.

@michaelneale

Copy link
Copy Markdown
Collaborator

@The-Best-Codes I think ok with me if with you? the new dep is dev time only

@The-Best-Codes

Copy link
Copy Markdown
Collaborator

@michaelneale Yep okay with me!

@michaelneale
michaelneale added this pull request to the merge queue Jul 21, 2026
Merged via the queue into aaif-goose:main with commit 18740b0 Jul 21, 2026
22 checks passed
michaelneale added a commit that referenced this pull request Jul 22, 2026
* origin/main:
  fix(ui): clear stale pending ACP connection after terminal recovery failure (#10552)
  Make provider smoke tests faster and more reliable (#10605)
  fix(acp): confirm pending steer message on queuedSteer notification (#10532)
  chore(deps): bump body-parser from 1.20.5 to 1.20.6 in /documentation (#10601)
  chore(deps): bump webpack-dev-server from 5.2.5 to 5.2.6 in /documentation (#10593)
  feat(compaction): structured summary output with template rendering (#10471)
  feat(skills): allow disabling built-in skills (#10600)
  fix: apply hermit env directly in node shims so a fish login shell doesn't break MCP startup (#10028)
  chore(release): bump version to 1.44.0 (minor) (#10597)
  fix(extensions): preserve command arguments through forms (#10527)
  fix(permissions): enforce manual approval for code mode (#10528)
  fix(apps): confine app file operations (#10481)
  fix(local-inference): preserve featured model size on delete and backfill missing sizes (#10422)
  refactor(acp): extract tool call handling from server (#10574)
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.

Featured local model size disappears after deletion and isn't backfilled

3 participants