Approved tool runs again if the process stops after it ran but before the run state was stored
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Tài liệu
- Độ 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
- ai, backend, documentation
Hướng nghiên cứu
Đọc tài liệu về human-in-the-loop, đặc biệt là các phần đề cập đến needs_approval, state.approve và RunState.to_json / from_json. Làm rõ liệu một lần chạy công cụ đã được phê duyệt và tiếp tục có thể chạy lại nếu tiến trình dừng trước khi trạng thái đã cập nhật được lưu hay không, đồng thời ghi lại hành vi này cùng hướng dẫn về tính idempotent hoặc cách kiểm tra hệ thống bên ngoài. Công việc được xem là hoàn thành khi tài liệu giải thích khoảng thời gian xảy ra lỗi này và người đọc có thể xác định cách làm cho công cụ an toàn khi thử lại.
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: human-in-the-loop (
needs_approval,state.approve,RunState.to_json/from_json). - Have you searched for related issues? Yes. #5239 and #4827 are about resuming after an approval, but not this case.
Question
Is it intended that an approved tool can run twice if the process stops after the tool ran but before the new run state was stored? I'd like to check that I'm resuming the intended way.
Setup (openai-agents 0.24.0, Python 3.12.10, a fake Model, no network):
Runner.run(agent, "pay alice 10")stops with an interruption forpay(amount=10, to="alice"), a@function_tool(needs_approval=True). I storeresult.to_state().to_json().- The person approves:
RunState.from_json,state.approve(item), I store the approved state, thenRunner.run(agent, state). The tool pays, and the process dies (os._exit) before anything else is stored. - A new process loads the stored approved state and calls
Runner.run(agent, state)again, because that is all it has.
Observed: the tool runs again: 2 payments, in 3 of 3 runs.
I think this is the expected at-least-once behaviour: the stored state can't know the tool already ran. If so, would a short note in the human-in-the-loop docs help? For example: "an approved tool can run more than once if the process stops before you store the new state; make the tool idempotent (for example with an idempotency key) or check the outside system first." I'm happy to send a docs PR if a maintainer wants one.
Disclosure: I'm the author of Call4Agents, a small library for this problem. I plan to publish these numbers, with the same runs for LangGraph and Pydantic AI (pydantic/pydantic-ai#10926), on or after 2026-11-05. I can paste the script here if it helps.
- Ngôn ngữ chính
- Python
- Star
- 30.2k
- Fork
- 4.9k
- Merge trung bình
- 11 giờ 46 phút
- Pull request đã merge (30 ngày)
- 160
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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openai/openai-agents-python#5405 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(typing): explicitly specialize ToolContext[Any] in ToolFunctionWithToolContextCó thể đã có người làm @AbarnaaSree đã nhận 5 ngày trước. Đ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 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ShellTool: empty ShellResult(output=[]) fabricates stdout "(no output)" in the model-visible shell_call_output and persisted shell_outputCó thể đã có người làm @AbarnaaSree đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
openai/openai-agents-python#5348 · 10 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
openai/openai-agents-python#5408 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Proposal] Payment guardrail: external spend authority + auditable receipts for agents that payĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
openai/openai-agents-python#5407 ·
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ự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
fossasia/visdom-dev#69 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Frontend build fails with Frappe version-16: DataImport is no longer exported by @framework/uiĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
BUG: PROD: v1.3.0-beta Onboarding Profile Picture Misaligns When Name Validation Error AppearsCó thể đã có người làm @RitikaSen27 đã nhận hôm nay. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
AOSSIE-Org/PictoPy#1647 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[oblt-aw][autodoc] Update workflow docs for gh-aw v0.92.5 and detector permission scopeCó thể đã có người làm @github-actions đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày