Skip to content

Conversation

@gustavz
Copy link
Contributor

@gustavz gustavz commented Dec 9, 2025

Summary

  • add a RunContextWrapper reference to ApplyPatchOperation so editors can access the agent context
  • populate the context when coercing apply_patch calls in ApplyPatchAction
  • assert the context wrapper is propagated in apply_patch tool tests

Test plan

  • uv run pytest tests/test_apply_patch_tool.py

Issue number

  • N/A

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

Codex Task

@gustavz gustavz requested review from Copilot and dkundel-openai and removed request for dkundel-openai December 9, 2025 10:35
Copy link

Copilot AI left a 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_wrapper field to ApplyPatchOperation to hold the RunContextWrapper reference
  • 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.

@gustavz
Copy link
Contributor Author

gustavz commented Dec 9, 2025

@dkundel-openai @seratch fyi

@seratch seratch added this to the 0.6.x milestone Dec 9, 2025
@seratch seratch added enhancement New feature or request feature:core labels Dec 9, 2025
@seratch
Copy link
Member

seratch commented Dec 9, 2025

@codex can you review the changes again?

Copy link
Member

@seratch seratch left a 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

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Breezy!

ℹ️ 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".

@seratch seratch merged commit 9f96338 into main Dec 9, 2025
9 checks passed
@seratch seratch deleted the codex/determine-state-persistence-in-runner.run branch December 9, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants