Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ jobs:
- name: Run lint
run: make lint

format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: make sync
- name: Run format check
run: make format-check

typecheck:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ deploy-docs:
uv run mkdocs gh-deploy --force --verbose

.PHONY: check
check: format-check lint mypy tests
check: format-check lint mypy coverage
1 change: 0 additions & 1 deletion src/agents/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,6 @@ async def _get_single_step_result_from_streamed_response(
run_config: RunConfig,
tool_use_tracker: AgentToolUseTracker,
) -> SingleStepResult:

original_input = streamed_result.input
pre_step_items = streamed_result.new_items
event_queue = streamed_result._event_queue
Expand Down
4 changes: 2 additions & 2 deletions src/agents/tracing/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def set_api_key(self, api_key: str):
client.
"""
# Clear the cached property if it exists
if 'api_key' in self.__dict__:
del self.__dict__['api_key']
if "api_key" in self.__dict__:
del self.__dict__["api_key"]

# Update the private attribute
self._api_key = api_key
Expand Down
5 changes: 2 additions & 3 deletions tests/test_agent_clone_shallow_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
def greet(name: str) -> str:
return f"Hello, {name}!"


def test_agent_clone_shallow_copy():
"""Test that clone creates shallow copy with tools.copy() workaround"""
target_agent = Agent(name="Target")
Expand All @@ -16,9 +17,7 @@ def test_agent_clone_shallow_copy():
)

cloned = original.clone(
name="Cloned",
tools=original.tools.copy(),
handoffs=original.handoffs.copy()
name="Cloned", tools=original.tools.copy(), handoffs=original.handoffs.copy()
)

# Basic assertions
Expand Down
1 change: 1 addition & 0 deletions tests/test_stream_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ async def foo() -> str:
await asyncio.sleep(3)
return "success!"


@pytest.mark.asyncio
async def test_stream_events_main():
model = FakeModel()
Expand Down