Pass the call_id to ApplyPatchTool's editor
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 70/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start with ApplyPatchOperation in src/agents/editor.py and follow ApplyPatchAction.execute in src/agents/run_internal/tool_actions.py, including its approval and resume path. Pass the call ID through to every operation created for that tool call, preserving the existing default for editors that do not provide one. Done when an editor can read the same call ID for each operation, including after approval and resume.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Please read this first
- Have you read the docs? Yes.
- Have you searched for related issues? Yes. #1849 added
tool_call_idto function tool hooks and left built-in
tools for later, asking for a minimal reproduction for a specific built-in local tool with a practical consequence.
This is one forApplyPatchTool, and the change it needs doesn't touch the hook context.
Describe the feature
An ApplyPatchEditor can't tell which apply_patch call it is applying. Its methods get an ApplyPatchOperation
with type, path, diff, ctx_wrapper and move_to (src/agents/editor.py:15-23). ApplyPatchAction.execute
has the id (call_id = extract_apply_patch_call_id(...), src/agents/run_internal/tool_actions.py:928) and calls the
editor without it (:1017-1023).
needs_approval gets (ctx, operation, call_id), so today an editor that needs the id has to remember the
operation object in needs_approval and look it up by identity in the editor. That fails on the approval path. After
RunState.approve() and a resumed run, needs_approval isn't called again (:948-962), so the editor gets an
operation it has never seen and can't learn which approved call it belongs to:
from agents import Agent, ApplyPatchTool, Runner
from agents.editor import ApplyPatchOperation
class AuditEditor:
def update_file(self, op: ApplyPatchOperation):
print(getattr(op, "call_id", None)) # None: the operation doesn't say which call it is
return "done"
create_file = delete_file = update_file
agent = Agent(name="a", tools=[ApplyPatchTool(editor=AuditEditor(), needs_approval=True)])
result = Runner.run_sync(agent, "Fix the typo in README.md") # with a model that calls apply_patch
state = result.to_state()
for item in result.interruptions:
state.approve(item)
Runner.run_sync(agent, state) # the editor runs; nothing tells it which approved call_id this write is
So an editor can't write an audit record per call, check that the write it is about to make is the one a person
approved, or report progress per call in a UI.
Proposed shape: a call_id: str | None = None field, last in ApplyPatchOperation, set in
ApplyPatchAction.execute (or in coerce_apply_patch_operations, which receives the tool call). A call with several
operations gives each the same call_id. It's additive: existing editors ignore it, and positional construction
doesn't change.
Context: I maintain Tracekit (https://github.com/Cygnux-Labs/Tracekit), which records and gates agent tool calls; this would let it hold apply_patch calls for a person's approval (today it has to refuse an ask for them) and record each write under the call the model made.
- Ngôn ngữ chính
- Python
- Star
- 30.2k
- Fork
- 4.9k
- Merge trung bình
- 12 giờ 50 phút
- Pull request đã merge (30 ngày)
- 162
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openai/openai-agents-python
-
fix(typing): explicitly specialize ToolContext[Any] in ToolFunctionWithToolContextCó thể làm lại được @AbarnaaSree đã nhận 9 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
openai/openai-agents-python#5387 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
function_tool on a callable object uses an inherited or generated class docstring as the tool descriptionCó thể đã có người làm @Narendra02053 đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
openai/openai-agents-python#5443 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 44/100
openai/openai-agents-python#5416 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 53/100
openai/openai-agents-python#5413 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
openai/openai-agents-python#5412 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của openai/openai-agents-python
Issue tương tự
-
backlog
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
EchoTools/nevr-runtime#1108 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
parse names a key after a top-level multi() threshold Bitcoin Core v31.1 refuses as not validĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
btclib-org/btclib-wallet#587 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Judgment-Pack/judgment-pack-spec#275 ·
Maintainer thường phản hồi trong vòng 1 ngày