Skip to content

fix(docs): clarify AgentHooks description in Chinese translation - #4301

Open
scrazyakai wants to merge 1 commit into
openai:mainfrom
scrazyakai:main
Open

fix(docs): clarify AgentHooks description in Chinese translation#4301
scrazyakai wants to merge 1 commit into
openai:mainfrom
scrazyakai:main

Conversation

@scrazyakai

Copy link
Copy Markdown

"自定义副作用" can be misleading, while "自定义Hooks" is easier to understand.

@seratch

seratch commented Aug 8, 2026

Copy link
Copy Markdown
Member

Thanks for the feedback! It's auto translated, so could you suggest the best way to map English and Chinese terms? https://github.com/openai/openai-agents-python/blob/main/docs/scripts/translate_docs.py

@seratch seratch added the documentation Improvements or additions to documentation label Aug 8, 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: 5967b1dfd7

ℹ️ 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 docs/zh/agents.md
- `on_handoff`:控制权从一个智能体转移到另一个智能体时。

如果你希望使用单个观察器监控整个工作流,请使用`RunHooks`;如果某个智能体需要自定义副作用,请使用`AgentHooks`。
如果你希望使用单个观察器监控整个工作流,请使用`RunHooks`;如果某个智能体需要自定义`Hooks`,请使用`AgentHooks`。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Apply this clarification through the translation source

When the translation job next regenerates this page, docs/scripts/translate_docs.py::translate_file will rewrite docs/zh/agents.md from the unchanged English source, so this correction will disappear. Update the English source or translation controls and regenerate the localized pages instead of editing the generated Chinese artifact directly.

AGENTS.md reference: AGENTS.md:L110-L110

Useful? React with 👍 / 👎.

Comment thread docs/zh/agents.md
- `on_handoff`:控制权从一个智能体转移到另一个智能体时。

如果你希望使用单个观察器监控整个工作流,请使用`RunHooks`;如果某个智能体需要自定义副作用,请使用`AgentHooks`。
如果你希望使用单个观察器监控整个工作流,请使用`RunHooks`;如果某个智能体需要自定义`Hooks`,请使用`AgentHooks`。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the AgentHooks behavior distinction

For Chinese readers, formatting Hooks as an identifier introduces a nonexistent generic API name and turns the guidance into the tautology “use AgentHooks when an agent needs custom Hooks,” so it no longer explains when to choose this scope over RunHooks. src/agents/__init__.py exports RunHooks and AgentHooks, not Hooks, and the surrounding section consistently translates the concept as “钩子”; retain a description of agent-specific lifecycle callbacks or side effects instead.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants