mirror of
https://github.com/GH05TCREW/pentestagent.git
synced 2026-07-25 02:35:23 -04:00
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/GH05TCREW/pentestagent/pull/35
Author: @selectqoma
Created: 2/25/2026
Status: ✅ Merged
Merged: 2/25/2026
Merged by: @GH05TCREW
Base:
main← Head:fix/gemini-duplicate-assistant-message📝 Commits (1)
a6cf684fix: remove duplicate assistant message when content and tool_calls both present📊 Changes
2 files changed (+2 additions, -5 deletions)
View changed files
📝
pentestagent/agents/crew/orchestrator.py(+0 -3)📝
pentestagent/llm/llm.py(+2 -2)📄 Description
Summary
Root cause of issue #8: In
CrewOrchestrator.run(), when the LLM response contains bothcontentandtool_calls, the code appended two back-to-back assistant messages toself._messages:{"role": "assistant", "content": response.content}— bare content message{"role": "assistant", "content": ..., "tool_calls": [...]}— the correct combined messageGemini (and technically any spec-compliant LLM API) rejects conversations with consecutive same-role messages. On the very next turn, Gemini would error or cancel the request, which explains why worker agents end up in
cancelledstate.Fix: Remove the redundant
self._messages.append({"role": "assistant", "content": response.content})— the content is already included in the combined message that follows it.Bonus fix:
get_available_models()listedgemini-2.5-pro/gemini-2.5-flashwithout the requiredgemini/prefix. Updated to match the documented correct format.Test plan
PENTESTAGENT_MODEL=gemini/gemini-2.5-flashwith a validGEMINI_API_KEY🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.