← Back to Pull requests

Tell the side panel when the vector store is full and stop a storage write on every model listing #494

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 26, 2026 23:56 UTC
Author

Chat indexing skipped silently at the storage limit, the default limit could still trigger that, and every successful model listing wrote to chrome.storage.local.

Storage-full notice

  • The vector store records a device-local marker when it refuses a write (once per limit, not per chunk) and clears it the next time a write fits.

  • The side panel shows a notice above the composer while the marker is set and the limit has not been raised past it. Its button opens Settings → Knowledge at the storage-limit field.

  • maxStorageSize now defaults to 0 (no limit). Users who already saved a value keep it.
  • Storage writes per RPC
    Traced with a storage.onChanged observer in an unrelated page. Fifty providers.listModels calls produced 50 writes to provider-model-catalog-support, rewriting only checkedAt, and each write woke every open extension page. A catalog already known to be present is no longer rewritten, since only an absent answer expires.

    | 10 calls each, observer page | storage events |
    |---|---|
    | providers.listModels ×50 (before) | 50 |
    | providers.listModels ×50 (after) | 0 |
    | list, browserModelStatus, listActivePulls, nativeStatus, checkModel, listLoaded, getDetails, getReadiness, icons | 0 |

    A failing RPC still writes one diagnostic-pending-events-v1 session entry per failure. That is the durable error record and is left as is. app-rpc-request still reaches every extension page; each listener returns immediately.

    Measured, no change needed

  • Paused agent run: service-worker heap after GC was 10,084 KB with a 4 KB page and 10,191 KB with a 3 MB page, flat over 8 s. A paused run does not hold the page.

  • Token burst (earlier 8,000 failure was the test hook recursing once per token): 2 row writes at 4,000, 8,000 and 16,000 tokens; finish after stream end 63–81 ms, 126–130 ms and 222–227 ms.
  • <!-- greptile_comment -->

    <!-- greptile_summary -->

    <h2><a href="https://app.greptile.com/api/retrigger?id=88549113"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/shishir435/github/Shishir435/ollama-client/-/pull/494"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a>Confidence Score: 4/5</h2>

    <!-- greptile-risk -->

    The PR appears safe to merge, with three non-blocking fixes recommended for the storage warning.

    <h2><a href="https://app.greptile.com/ide/claude-code?prompt=%23%23%23%20Issue%201%0Asrc%2Flib%2Fembeddings%2Fstorage.ts%3A260-261%0A%60storeVector%60%20clears%20the%20warning%20for%20any%20nonzero%20ID%2C%20but%20%60insertVector%60%20also%20returns%20existing%20IDs%20for%20duplicate%20chunks%20before%20checking%20the%20storage%20limit.%20Retrying%20an%20already%20indexed%20chunk%20can%20hide%20the%20warning%20while%20the%20store%20still%20refuses%20new%20chunks.%20Return%20whether%20a%20vector%20was%20actually%20added%2C%20and%20clear%20the%20marker%20only%20after%20a%20new%20write%20fits.%0A%0A%23%23%23%20Issue%202%0Asrc%2Flib%2Fembeddings%2Fvector-storage-full-notice.ts%3A13-14%0A%60record%60%20checks%20%60recorded%60%20before%20awaiting%20the%20storage%20write%2C%20so%20overlapping%20calls%20can%20drop%20a%20state%20change.%20With%20%60recorded%60%20set%20to%20100%2C%20a%20smaller%20vector%20can%20fit%20and%20start%20clearing%20the%20marker.%20A%20concurrent%20larger%20vector%20is%20then%20refused%20at%20100%2C%20but%20its%20call%20returns%20early%20because%20%60recorded%60%20is%20still%20100.%20The%20pending%20clear%20finishes%20and%20hides%20the%20warning.%0A%0AFile%20ingestion%20and%20chat%20indexing%20can%20overlap%20in%20the%20background.%20Serialize%20these%20updates%20and%20check%20the%20cached%20value%20inside%20that%20sequence.%0A%0A%23%23%23%20Issue%203%0Asrc%2Ffeatures%2Fchat%2Fcomponents%2Fstorage-full-notice.tsx%3A40%0AThe%20notice%20displays%20%60full.limitMB%60%20rather%20than%20the%20current%20configured%20limit.%20If%20the%20store%20refuses%20at%20100%20MB%20and%20the%20user%20lowers%20the%20limit%20to%2050%20MB%2C%20the%20notice%20remains%20visible%20but%20still%20says%20the%20limit%20is%20100%20MB%20until%20another%20write%20occurs.%20Keep%20the%20historical%20value%20for%20deciding%20whether%20to%20hide%20the%20notice%2C%20but%20use%20%60limit%60%20in%20the%20description.%0A%0A%60%60%60suggestion%0A%20%20%20%20%20%20%20%20%20%20%20%20%7Bt%28%22chat.storage_full.description%22%2C%20%7B%20max%3A%20limit%20%7D%29%7D%0A%60%60%60%0A%0ANote%3A%20If%20this%20suggestion%20doesn't%20match%20your%20team's%20coding%20style%2C%20reply%20to%20this%20and%20let%20me%20know.%20I'll%20remember%20it%20for%20next%20time!%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=shishir435%2Follama-client&pr=494&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInClaudeDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInClaude.svg?v=7"><img alt="Fix All in Claude Code" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInClaude.svg?v=7" align="right"></picture></a>Findings</h2>

    1. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top">&nbsp;Duplicates hide the warning <a href="https://github.com/Shishir435/ollama-client/pull/494#discussion_r4383790746">▶</a>
    2. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top">&nbsp;Overlapping updates lose the warning <a href="https://github.com/Shishir435/ollama-client/pull/494#discussion_r4383790753">▶</a>
    3. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top">&nbsp;Warning shows the old limit <a href="https://github.com/Shishir435/ollama-client/pull/494#discussion_r4383790761">▶</a>

    <h3>Summary</h3>

    Adds a device-local storage warning above the chat composer, with a link to the storage-limit setting.

  • A full vector store now shows why chat search has paused and where to change the limit.

  • Known-present provider catalogs stop causing a storage write on every successful listing.
  • <details><summary><h3>Diagram</h3></summary>

    %%{init: {'theme': 'neutral'}}%%
    flowchart TD
      A[Store vector] --> B{Write outcome}
      B -->|Refused at limit| C[Save full marker]
      B -->|Nonzero ID| D[Clear marker]
      C --> E[Chat notice]
      E --> F[Knowledge settings: storage limit]
    

    </details>

    <!-- greptile_confidence_score:4 -->

    <sub>Reviews (1) · Last reviewed commit: "Raise the Firefox total budget for the s..." · Reviewed by Greptile</sub>

    <!-- /greptile_comment -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: greptile-apps[bot] Review duration: 6m
    All Vouch review confidence checks passed
    Residual risk 0.40 = Change Risk (0.52) × (1 − Review Confidence (0.23)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 38% · Reviewer familiarity: 35%
    23%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #494"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 23.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 23.1% · Lower = rushed or shallow review
    23.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 40% · Moderate risk
    40%