Skip to content

fix(config): thread-local override() via contextvars (#850) - #858

Merged
jepegit merged 1 commit into
masterfrom
850-config-override-thread-safe
Aug 9, 2026
Merged

fix(config): thread-local override() via contextvars (#850)#858
jepegit merged 1 commit into
masterfrom
850-config-override-thread-safe

Conversation

@jepegit

@jepegit jepegit commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Back config.override() with contextvars so each thread/async task gets its own override stack and config view.
  • Process-global reload() / set_load_options() stay global; documented on override().

Closes #850

Test plan

  • uv run pytest tests/test_config.py -q (includes ThreadPoolExecutor isolation)
  • CI essential / full

Made with Cursor

Scoped overrides no longer mutate the process-global session, so concurrent
workers cannot observe each other's cycle_mode/units (#850).
@cursor

cursor Bot commented Aug 9, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@jepegit
jepegit merged commit da9ccc8 into master Aug 9, 2026
8 checks passed
@jepegit
jepegit deleted the 850-config-override-thread-safe branch August 9, 2026 10:41
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.

config: override() is process-global and not thread-safe (cross-talk in threaded apps)

1 participant