Skip to content

chore(provider): increase model cache TTL to one week#2588

Merged
tusharmath merged 7 commits intomainfrom
increase-cache-ttl
Mar 18, 2026
Merged

chore(provider): increase model cache TTL to one week#2588
tusharmath merged 7 commits intomainfrom
increase-cache-ttl

Conversation

@tusharmath
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath commented Mar 17, 2026

Summary

Increase the model list cache TTL from 2 hours to 1 week to reduce unnecessary API calls to provider endpoints for fetching available models.

Context

The model list for any given provider rarely changes — new models are added infrequently and removals are even rarer. Fetching the model list every 2 hours adds unnecessary overhead and API requests. Extending the TTL to 1 week significantly reduces this chatter while still ensuring the cache eventually refreshes to pick up any provider changes.

Changes

  • Updated MODEL_CACHE_TTL_SECS in crates/forge_repo/src/provider/chat.rs from 7200 (2 hours) to 604_800 (1 week)
  • Updated the accompanying doc comment to reflect the new TTL value

Testing

cargo insta test --accept -p forge_repo

Links

  • No related issues

@github-actions github-actions Bot added the type: chore Routine tasks like conversions, reorganization, and maintenance work. label Mar 17, 2026
@tusharmath tusharmath changed the title chore(provider): increase model cache ttl to one week chore(provider): increase model cache TTL to one week Mar 17, 2026
@tusharmath tusharmath enabled auto-merge (squash) March 17, 2026 11:57
@tusharmath tusharmath merged commit e75c783 into main Mar 18, 2026
9 checks passed
@tusharmath tusharmath deleted the increase-cache-ttl branch March 18, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: chore Routine tasks like conversions, reorganization, and maintenance work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant