Traditional AI assistants often use a single-turn Q&A model, but py-code-agent introduces the ReAct (Reasoning + Acting) reasoning loop. When react.enabled: true is enabled, the Agent follows the "Think → Act → Observe" loop:
- Thought: The LLM analyzes the current task state and decides the next action
- Act: Call a tool or generate the final answer
- Observe: Feed the tool execution result back into the context
- Repeat: Until task_done is called or the maximum number of rounds is reached
This model allows the Agent to code autonomously—it can write files, run tests, fix errors, and iterate continuously until the task is completed. For example, when asked to "create a Python script that prints the Fibonacci sequence", the Agent will proactively analyze the requirement, write code, verify the output, rather than just returning a code snippet.