Skip to content

fix: remove stale user settings cache - #592

Open
onedotmint wants to merge 1 commit into
DEEIX-AI:devfrom
onedotmint:fix/user-settings-cache-invalidation
Open

fix: remove stale user settings cache#592
onedotmint wants to merge 1 commit into
DEEIX-AI:devfrom
onedotmint:fix/user-settings-cache-invalidation

Conversation

@onedotmint

Copy link
Copy Markdown

Summary

Fixes stale conversation user settings after an update by removing the process-local user settings cache and reading the affected settings directly from the repository.

This ensures changes to:

  • chat.reasoning_content_passback
  • chat.context_compact_auto
  • chat.file_mode

are observed immediately instead of potentially remaining stale for up to 10 minutes.

Adds regression coverage for updating these settings through usersettings.Service.PatchSettings and reading the updated values through the conversation service.

Fixes #589

Change type

  • Bug fix
  • Feature
  • Documentation
  • Refactor
  • Configuration / deployment
  • Security hardening
  • Other

Affected areas

  • Frontend / UI
  • Backend / API
  • Authentication / authorization
  • Conversations / streaming
  • Files / RAG / extraction
  • Model routing / providers
  • MCP / tools
  • Billing / payments
  • Admin console
  • Deployment / Docker / configuration
  • Documentation

Verification

  • go -C backend test ./...

  • pnpm check

  • pnpm test

  • pnpm build

  • git diff --check

  • Not run; reason:

Screenshots, API examples, or logs

Not applicable; this change has no UI changes or API contract changes.

Configuration, migration, and compatibility notes

No configuration changes, database migrations, or API contract changes are required.

The process-local user settings cache has been removed. This trades cache hits for direct indexed user-setting repository reads during message handling so updated settings are observed immediately, including in multi-node deployments using shared persistence.

Documentation

  • Documentation is not needed for this change.
  • Documentation was updated.
  • Documentation still needs to be updated.

Security and privacy

  • No secrets, tokens, credentials, local config, or personal data are included.
  • User data access remains scoped by authenticated user context unless an admin-only path explicitly requires broader access.
  • Security-sensitive behavior was reviewed, including authentication, authorization, provider routing, file processing, billing, and admin APIs where relevant.

Checklist

  • I searched existing issues and pull requests.
  • Changes are focused and do not include unrelated refactors.
  • Tests or static verification were run where practical.
  • User-facing behavior, deployment steps, API contracts, or configuration changes are documented.
  • Generated artifacts are included only when this project explicitly requires them.
  • Caches, build output, .pyc files, .env files, and local storage data are not committed.

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.

[Bug]: 部分用户设置修改后不会立即失效需要 10 分钟才生效

1 participant