- Refactored CodeAgent to utilize CodeAgentTools instead of the generic Tools class for enhanced functionality.
- Introduced custom pricing for 'bu-latest' and 'smart' models, specifying input and output costs per token, along with cache read costs.
This update improves the agent's tool capabilities and introduces new pricing structures for better cost management.
Previously, done() calls inside if/else/elif blocks would only show a warning
but still execute, potentially causing tasks to never complete if the condition
wasn't met. This changes the behavior to raise a RuntimeError, forcing the LLM
to restructure code properly.
The proper pattern is:
```python
# Validate and set result variables
if condition:
result = "success"
else:
result = "failure"
# Then call done() unconditionally
await done(result, success=True)
```
Changes:
- Upgraded warning to RuntimeError in namespace.py
- Added comprehensive test suite with 5 test cases
- Tests cover if/else/elif blocks and verify standalone done() still works
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>