anthropics / anthropics/claude-quickstarts
You need to trap errors encountered during tool_use
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 3k
- Avg merge
- 5h 13m
- Merged PRs (30d)
- 3
Description
Consider the following crash dump:
```
> ./run.sh
Container started with ID: 55e7749387c5f72b4b5a05efc8ee9184d547391bf28d95e65d910b2ef8f44da3
Waiting for container 55e7749387c5f72b4b5a05efc8ee9184d547391bf28d95e65d910b2ef8f44da3 to reach running state...
Container 55e7749387c5f72b4b5a05efc8ee9184d547391bf28d95e65d910b2ef8f44da3 is now running.
Xvfb started successfully on display :1
Xvfb PID: 9
starting tint2 on display :1 ...
starting mutter
starting vnc
PORT=5904
starting noVNC
noVNC started successfully
✨ Computer Use Demo is ready!
➡️ Open http://localhost:8084 in your browser to begin
2024-10-29 14:44:49.092 Uncaught app exception
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
^^^^^^
File "/usr/local/lib/python3.11/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
exec(code, module.__dict__)
File "/host/src/computer_use_demo/streamlit.py", line 384, in
asyncio.run(main())
File "/usr/lib/python3.11/asyncio/runners.py", line 188, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 120, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 650, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/host/src/computer_use_demo/streamlit.py", line 214, in main
st.session_state.messages = await sampling_loop(
^^^^^^^^^^^^^^^^^^^^
File "/host/src/computer_use_demo/loop.py", line 165, in sampling_loop
result = await tool_collection.run(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/host/src/computer_use_demo/tools/collection.py", line 32, in run
return await tool(**tool_input)
^^^^^^^^^^^^^^^^^^
TypeError: EditTool.__call__() missing 1 required keyword-only argument: 'path'
```
The agent loop has used a tool incorrectly, and this has crashed the process.
This means the conversation is now lost. I encounter this kind of crash several times a day.
This kind of error should be trapped, so that the next agent cycle has an opportunity to invoke the tool correctly.
I'm connecting this issue with https://github.com/anthropics/anthropic-quickstarts/issues/121 as that represents another error that should be trapped thus allowing the agent loop to continue.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.