Skip to content

feat: pass run context to custom sessions - #4209

Merged
seratch merged 3 commits into
mainfrom
feat/session-run-context-wrapper
Aug 5, 2026
Merged

feat: pass run context to custom sessions#4209
seratch merged 3 commits into
mainfrom
feat/session-run-context-wrapper

Conversation

@seratch

@seratch seratch commented Aug 5, 2026

Copy link
Copy Markdown
Member

This pull request adds an optional runtime opt-in for custom sessions to receive the active RunContextWrapper during history reads, persistence, resume, and retry rollback.

It preserves the released Session protocol and all legacy call shapes by enabling the behavior only when all four session methods accept wrapper. It also forwards the capability through EncryptedSession and documents that OpenAIResponsesCompactionSession remains legacy-scoped until its mutable compaction state can be isolated per context.

This pull request resolves #2072.

@seratch seratch added this to the 0.20.x milestone Aug 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab0b7bf783

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agents/memory/session.py Outdated
Comment thread src/agents/memory/session.py
@seratch
seratch merged commit c48dd4c into main Aug 5, 2026
10 checks passed
@seratch
seratch deleted the feat/session-run-context-wrapper branch August 5, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass RunContextWrapper[T] to Session methods

1 participant