ux: add 0.4s delay between extracted tool executions for smoother experience
- SHA
dff75e09ea78356d35b9471004dbaeabd4c0615e- Parents
-
7466f7b - Tree
e84941d
dff75e0
dff75e09ea78356d35b9471004dbaeabd4c0615e7466f7b
e84941d| Status | File | + | - |
|---|---|---|---|
| M |
src/loader/agent/loop.py
|
4 | 1 |
src/loader/agent/loop.pymodified@@ -1021,7 +1021,10 @@ class Agent: | ||
| 1021 | 1021 | pass |
| 1022 | 1022 | # This duplicates the tool execution logic above, but that's intentional |
| 1023 | 1023 | # to handle the case where raw JSON tool calls are extracted |
| 1024 | - for tc in tool_calls: | |
| 1024 | + for i, tc in enumerate(tool_calls): | |
| 1025 | + # Small delay between tool executions for better UX | |
| 1026 | + if i > 0: | |
| 1027 | + await asyncio.sleep(0.4) | |
| 1025 | 1028 | try: |
| 1026 | 1029 | with open("/tmp/loader_debug.log", "a") as f: |
| 1027 | 1030 | f.write(f"[loop] executing extracted tool: {tc.name} args={tc.arguments}\n") |