-
Notifications
You must be signed in to change notification settings - Fork 3k
Attach context to apply patch operations #2162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for attaching agent context to apply patch operations, enabling editors to access the runtime context when handling file operations. The change allows editors to make context-aware decisions during file creation, updates, and deletions.
- Adds a
ctx_wrapperfield toApplyPatchOperationto hold theRunContextWrapperreference - Populates the context wrapper when coercing apply_patch tool calls in the execution flow
- Adds test assertions to verify the context wrapper is properly propagated to operations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/agents/editor.py | Adds ctx_wrapper field to ApplyPatchOperation dataclass and imports RunContextWrapper |
| src/agents/_run_impl.py | Updates _coerce_apply_patch_operation to accept and populate the context wrapper parameter |
| tests/test_apply_patch_tool.py | Adds assertions to verify ctx_wrapper is correctly set on editor operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex can you review the changes again? |
seratch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me; will merge after codex reviews
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Test plan
Issue number
Checks
make lintandmake formatCodex Task