Skip to content

fix: update tool call prompt for clearer execution guidelines#9133

Open
Soulter wants to merge 1 commit into
masterfrom
perf/tool-call-prompt
Open

fix: update tool call prompt for clearer execution guidelines#9133
Soulter wants to merge 1 commit into
masterfrom
perf/tool-call-prompt

Conversation

@Soulter

@Soulter Soulter commented Jul 4, 2026

Copy link
Copy Markdown
Member

Modifications / 改动点

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果


Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Enhancements:

  • Update the tool call prompt to emphasize progress updates, final summaries with changed files and verification, and explicit handling of checks.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area:core The bug / feature is about astrbot's core, backend labels Jul 4, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The updated TOOL_CALL_PROMPT now repeats the idea of summarizing results ("short final summary" vs. "after execution, briefly summarize"), which could be tightened to a single, clearer instruction to avoid confusion.
  • Consider simplifying or restructuring the new sentence about progress updates, final summary, changed files, verification, and caveats into a bullet-like or more segmented phrasing to improve readability and reduce cognitive load for the model.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The updated TOOL_CALL_PROMPT now repeats the idea of summarizing results ("short final summary" vs. "after execution, briefly summarize"), which could be tightened to a single, clearer instruction to avoid confusion.
- Consider simplifying or restructuring the new sentence about progress updates, final summary, changed files, verification, and caveats into a bullet-like or more segmented phrasing to improve readability and reduce cognitive load for the model.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the TOOL_CALL_PROMPT in astr_main_agent_resources.py to instruct the agent to provide concise progress updates, a short final summary, and run relevant checks. The review feedback correctly identifies a missing semicolon and space at the end of the newly added string literal, which would otherwise cause it to merge with the next line due to implicit string concatenation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

"briefly explain the purpose before calling a tool; "
"give concise progress updates while working and a short final "
"summary with changed files, verification, and any caveats; "
"run relevant checks when practical, and clearly say when a check was not run."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The string literal on line 30 is implicitly concatenated with the string literal on line 31. Because line 30 does not end with a semicolon or space (e.g., ; ), the two instructions will merge into: ...clearly say when a check was not run.follow the tool schema exactly.... Adding a semicolon and space at the end of line 30 ensures the instructions remain distinct and clear for the LLM.

Suggested change
"run relevant checks when practical, and clearly say when a check was not run."
"run relevant checks when practical, and clearly say when a check was not run; "

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
astrbot-docs d7b8aae Commit Preview URL

Branch Preview URL
Jul 04 2026, 07:23 AM

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

Labels

area:core The bug / feature is about astrbot's core, backend size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant