kikocis/auto-code-rover public
| 1 | """ |
| 2 | Common stuff for task agents. |
| 3 | """ |
| 4 | |
| 5 | from app.data_structures import MessageThread |
| 6 | |
| 7 | |
| 8 | def replace_system_prompt(msg_thread: MessageThread, prompt: str) -> MessageThread: |
| 9 | """ |
| 10 | Replace the system prompt in the message thread. |
| 11 | This is because the main agent system prompt main invole tool_calls info, which |
| 12 | should not be known to task agents. |
| 13 | """ |
| 14 | msg_thread.messages[0]["content"] = prompt |
| 15 | return msg_thread |