-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Convert worker agents to async/await pattern (cf-48) #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7ccbf5d
docs: complete Sprint 5 planning for async worker agents (cf-48)
frankbria 97fe6f1
feat: generate task breakdown for async worker agents (cf-48)
frankbria 9ff2540
feat: convert worker agents to async/await (cf-48 Phase 1-3)
frankbria ef5e825
docs: complete Phase 4 validation and polish (cf-48)
frankbria be87656
chore: mark final tasks complete in tasks.md (cf-48)
frankbria 8e91e9f
test: migrate frontend and backend worker tests to async
frankbria 324e555
fix: correct async test migration issues
frankbria b4b61bf
test: migrate all worker agent tests to async/await
frankbria debcf57
fix: complete async migration for self-correction integration tests
frankbria 18a0533
Merge branch 'main' into 048-async-worker-agents
frankbria File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Changed | ||
| - **BREAKING**: Converted worker agents to async/await pattern (cf-48) | ||
| - `BackendWorkerAgent.execute_task()` is now async | ||
| - `FrontendWorkerAgent.execute_task()` is now async | ||
| - `TestWorkerAgent.execute_task()` is now async | ||
| - All internal agent methods now use async/await | ||
| - Replaced `Anthropic` client with `AsyncAnthropic` | ||
| - Removed `_broadcast_async()` threading wrapper from all worker agents | ||
| - `LeadAgent` now calls worker agents directly with `await` (removed `run_in_executor()`) | ||
|
|
||
| ### Fixed | ||
| - Resolved event loop deadlocks in worker agent broadcasts | ||
| - Eliminated threading overhead in agent task execution | ||
| - Improved WebSocket broadcast reliability with direct async calls | ||
|
|
||
| ### Technical Details | ||
| - **Files Modified**: | ||
| - `codeframe/agents/backend_worker_agent.py`: Full async conversion | ||
| - `codeframe/agents/frontend_worker_agent.py`: Full async conversion | ||
| - `codeframe/agents/test_worker_agent.py`: Full async conversion | ||
| - `codeframe/agents/lead_agent.py`: Removed threading wrapper | ||
| - **Net Changes**: -115 lines (simpler, cleaner code) | ||
| - **Broadcast Pattern**: Direct `await broadcast_*()` calls instead of `run_coroutine_threadsafe()` | ||
| - **Migration Impact**: Existing tests require async updates (`@pytest.mark.asyncio` and `await` calls) | ||
|
|
||
| ### Migration Guide for Test Updates | ||
| Tests that call worker agent methods need to be updated: | ||
| ```python | ||
| # Before (synchronous) | ||
| def test_execute_task(agent): | ||
| result = agent.execute_task(task) | ||
|
|
||
| # After (asynchronous) | ||
| @pytest.mark.asyncio | ||
| async def test_execute_task(agent): | ||
| result = await agent.execute_task(task) | ||
| ``` | ||
|
|
||
| See: `specs/048-async-worker-agents/quickstart.md` for detailed migration instructions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove malformed/debug command.
Line 136 contains what appears to be a debug artifact or concatenated shell commands with a hardcoded absolute path. This does not follow the pattern of other entries and should be removed.
- "Bash(/dev/null echo echo '=== Dashboard sub-components (potential candidates) ===' ls /home/frankbria/projects/codeframe/web-ui/src/components/)",📝 Committable suggestion
🤖 Prompt for AI Agents