From 6d0924259b4ef3c0a4d64c062265a4af1cf2d025 Mon Sep 17 00:00:00 2001 From: Chris <363708+christopherwoodall@users.noreply.github.com> Date: Wed, 16 Jul 2025 05:16:25 -0500 Subject: [PATCH 1/6] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 192038d..a94bfe8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ heavy-agent = "source_agent.heavy:main" [project] requires-python = ">=3.10" -version = "0.0.11" +version = "0.0.12" name = "source-agent" description = "Simple coding agent." readme = ".github/README.md" From 1b07895c017b275d2d53b3a1557ad4e298b9c00d Mon Sep 17 00:00:00 2001 From: Chris <363708+christopherwoodall@users.noreply.github.com> Date: Wed, 16 Jul 2025 05:16:27 -0500 Subject: [PATCH 2/6] Create question_answered.py --- src/source_agent/tools/question_answered.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/source_agent/tools/question_answered.py diff --git a/src/source_agent/tools/question_answered.py b/src/source_agent/tools/question_answered.py new file mode 100644 index 0000000..e69de29 From 7daa924f027df9ede949a49091b45b5f4c86d02e Mon Sep 17 00:00:00 2001 From: Chris <363708+christopherwoodall@users.noreply.github.com> Date: Wed, 16 Jul 2025 05:28:29 -0500 Subject: [PATCH 3/6] Update naming for messaging tools --- src/source_agent/tools/msg_final_answer.py | 34 +++++++++++++++++++ ..._mark_complete.py => msg_task_complete.py} | 4 +-- src/source_agent/tools/question_answered.py | 0 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/source_agent/tools/msg_final_answer.py rename src/source_agent/tools/{task_mark_complete.py => msg_task_complete.py} (92%) delete mode 100644 src/source_agent/tools/question_answered.py diff --git a/src/source_agent/tools/msg_final_answer.py b/src/source_agent/tools/msg_final_answer.py new file mode 100644 index 0000000..634f127 --- /dev/null +++ b/src/source_agent/tools/msg_final_answer.py @@ -0,0 +1,34 @@ +# ruff: noqa: E501 + +from datetime import datetime +from .tool_registry import registry + + +@registry.register( + name="msg_final_answer", + description="Final summary of the task. Call this tool when the user's original request has been fully satisfied and you have provided a complete answer. This signals task completion and exits the agent loop.", + parameters={ + "type": "object", + "properties": { + "answer": { + "type": "string", + "description": "The final answer to the user's question or request.", + }, + }, + "required": ["answer"], + }, +) +def msg_final_answer(answer: str): + """ + Final summary of the task. + """ + timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") + + return { + "success": True, + "content": { + "status": "answered", + "answer": answer, + "timestamp": timestamp, + }, + } diff --git a/src/source_agent/tools/task_mark_complete.py b/src/source_agent/tools/msg_task_complete.py similarity index 92% rename from src/source_agent/tools/task_mark_complete.py rename to src/source_agent/tools/msg_task_complete.py index 5eb1f27..f2039e4 100644 --- a/src/source_agent/tools/task_mark_complete.py +++ b/src/source_agent/tools/msg_task_complete.py @@ -4,7 +4,7 @@ @registry.register( - name="task_mark_complete", + name="msg_task_complete", description="REQUIRED: Call this tool when the user's original request has been fully satisfied and you have provided a complete answer. This signals task completion and exits the agent loop.", parameters={ "type": "object", @@ -21,7 +21,7 @@ "required": ["task_summary", "completion_message"], }, ) -def task_mark_complete(task_summary: str, completion_message: str) -> dict: +def msg_task_complete(task_summary: str, completion_message: str) -> dict: try: timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") diff --git a/src/source_agent/tools/question_answered.py b/src/source_agent/tools/question_answered.py deleted file mode 100644 index e69de29..0000000 From d9649d366d39c3435b146713d2be068e810ba679 Mon Sep 17 00:00:00 2001 From: Chris <363708+christopherwoodall@users.noreply.github.com> Date: Wed, 16 Jul 2025 05:28:33 -0500 Subject: [PATCH 4/6] Update AGENTS.md --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index bc7d0b3..215bf31 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -30,7 +30,7 @@ Simulate three internal specialists: - Output executable code first. - Include minimal, relevant explanation if necessary. - When you have fully satisfied the user's request and provided a complete answer, - you MUST call the `task_mark_complete` tool with a summary of what was accomplished and a final message for the user. This signals that the task is finished. + you MUST call the `msg_task_complete` tool with a summary of what was accomplished and a final message for the user. This signals that the task is finished. - Debrief the user before marking the task complete, ensuring they understand the changes made and any implications. ## Important Files From a33a98e8979d68404dd7e295e893fc443aae480e Mon Sep 17 00:00:00 2001 From: Chris <363708+christopherwoodall@users.noreply.github.com> Date: Wed, 16 Jul 2025 05:28:38 -0500 Subject: [PATCH 5/6] Update code.py --- src/source_agent/agents/code.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/source_agent/agents/code.py b/src/source_agent/agents/code.py index 9f71d18..37d48b2 100644 --- a/src/source_agent/agents/code.py +++ b/src/source_agent/agents/code.py @@ -58,22 +58,28 @@ def run(self, user_prompt: str = None, max_steps: int = 50): if message.tool_calls: for tool_call in message.tool_calls: print(f"πŸ”§ Calling: {tool_call.function.name}") - print(f"πŸ“ Args: {tool_call.function.arguments}") + # print(f"πŸ“ Args: {tool_call.function.arguments}") result = self.handle_tool_call(tool_call) self.messages.append(result) - print("βœ… Result:", result) + # print("βœ… Result:", result) - if tool_call.function.name == "task_mark_complete": + # # TODO - Better message handling + # if tool_call.function.name == "msg_final_answer": + # print("βœ… Final answer received!") + # return result + + if tool_call.function.name == "msg_task_complete": print("πŸ’― Task marked complete!") return result - else: - print("πŸ’­ No tools; continuing") + # else: + # # print("πŸ’­ No tools; continuing") + # pass print("\n" + "-" * 40 + "\n") - print("🚨 Max steps reached without task completion.") + # print("🚨 Max steps reached without task completion.") return {"error": "Max steps reached without task completion."} def handle_tool_call(self, tool_call): From e80237a2f5389c1f1ee2ad93b7d51464be5d6eb1 Mon Sep 17 00:00:00 2001 From: Chris <363708+christopherwoodall@users.noreply.github.com> Date: Wed, 16 Jul 2025 05:30:10 -0500 Subject: [PATCH 6/6] Update entrypoint.py --- src/source_agent/entrypoint.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/source_agent/entrypoint.py b/src/source_agent/entrypoint.py index fb4e102..dc0019a 100644 --- a/src/source_agent/entrypoint.py +++ b/src/source_agent/entrypoint.py @@ -169,7 +169,6 @@ def main() -> int: help="Run in interactive step‑through mode", ) parser.add_argument( - "-h", "--heavy", action="store_true", default=False,