Skip to content

refactor: updated from using() to ContextVar - #5318

Draft
mayankansys wants to merge 2 commits into
mainfrom
refactor/context_manager_4928
Draft

refactor: updated from using() to ContextVar#5318
mayankansys wants to merge 2 commits into
mainfrom
refactor/context_manager_4928

Conversation

@mayankansys

Copy link
Copy Markdown
Collaborator

Context

What was the situation or problem before this change?

Change Summary

What changes were made?

Rationale

Why was this approach taken?

Impact

What parts of the system or workflows are affected?

@github-actions github-actions Bot added documentation Documentation related (improving, adding, etc) enhancement Improve any current implemented feature labels Aug 12, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

if not hasattr(_thread_local, "stack"):
_thread_local.stack = []
return _thread_local.stack
_active_session: ContextVar = ContextVar("active_session", default=None)

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.

Suggested change
_active_session: ContextVar = ContextVar("active_session", default=None)
_active_session: ContextVar[BaseSession] = ContextVar("active_session", default=None)

I think it should be like this

@mayankansys mayankansys linked an issue Aug 18, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation related (improving, adding, etc) enhancement Improve any current implemented feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider updating the using() context manager implementation

3 participants