Skip to content

Conversation

@nitpicker55555
Copy link
Collaborator

@nitpicker55555 nitpicker55555 commented Mar 30, 2025

Description

Support for processing a sequence of tasks in the Workforce, where each task can share context (e.g., results, memory) with others.

  • Added process_task_sequence and process_task_sequence_async methods to Workforce
  • Introduced shared_context and shared_channel to persist information across tasks
  • Each task's result is stored in shared_context with the pattern task_{task.id}
  • Compatible with current single-task flow; does not affect process_task

This addresses collaborative task execution as proposed in Issue #1832.

Checklist

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section or Fixes #1832 (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed
  • I have added examples if this is a new feature

"technology used, innovation, and potential impact."
),
),
Task(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add some comments on these?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like step by step run all task ....

@zjrwtx
Copy link
Collaborator

zjrwtx commented Mar 31, 2025

thanks @nitpicker55555 ,left some comment

@Wendong-Fan Wendong-Fan changed the title Feat/sequence task workforce feat: sequence task workforce May 22, 2025
Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nitpicker55555 for the contribution, and apologies for the delayed review comment.

The current implementation appears to process a sequence of top-level tasks within the workforce, rather than allowing for a pre-defined, fixed sequence of subtasks for a single overarching goal. As it stands, each task in the sequence is still subject to the workforce's internal decomposition process.

The user's requirement, as I understand it, is to support a scenario where subtasks are explicitly defined and executed in a specific order without further decomposition by the workforce. This would give more direct control over the execution flow.

Maybe allowing the Task to specify which worker node should handle it could offer more granular control. Happy to discuss this further

@Wendong-Fan Wendong-Fan added Agents Related to camel agents system Waiting for Update PR has been reviewed, need to be updated based on review comment labels May 24, 2025
@Wendong-Fan Wendong-Fan added this to the Sprint 30 milestone May 24, 2025
@Wendong-Fan Wendong-Fan linked an issue May 24, 2025 that may be closed by this pull request
3 tasks
@nitpicker55555 nitpicker55555 force-pushed the feat/sequence-task-workforce branch from 14bff5d to 1243997 Compare June 5, 2025 23:36
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 5, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nitpicker55555 nitpicker55555 force-pushed the feat/sequence-task-workforce branch from 1243997 to 9c61604 Compare June 5, 2025 23:39
@nitpicker55555 nitpicker55555 force-pushed the feat/sequence-task-workforce branch from 9c61604 to 53f48a2 Compare June 5, 2025 23:45
@nitpicker55555 nitpicker55555 reopened this Jun 5, 2025
@nitpicker55555 nitpicker55555 force-pushed the feat/sequence-task-workforce branch from 1243997 to 7b06d3b Compare June 5, 2025 23:56
@nitpicker55555
Copy link
Collaborator Author

@Wendong-Fan I've updated the Workforce so it now processes pre-defined subtasks directly instead of always decomposing them, and I also added a way for user to assign specific subtasks to the exact worker user wants. And I've put multi_hop_example.py to show how it all works, looking forward to your feedback

@Wendong-Fan Wendong-Fan removed the Waiting for Update PR has been reviewed, need to be updated based on review comment label Jun 6, 2025
@Wendong-Fan Wendong-Fan added the Review Required PR need to be reviewed label Jun 6, 2025
@Wendong-Fan
Copy link
Member

Screenshot 2025-06-06 at 17 30 16

@Wendong-Fan I've updated the Workforce so it now processes pre-defined subtasks directly instead of always decomposing them, and I also added a way for user to assign specific subtasks to the exact worker user wants. And I've put multi_hop_example.py to show how it all works, looking forward to your feedback

thanks @nitpicker55555 ! Will check the update later, please remember to update the PR label

Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested with the example code seems it's hanging, could @nitpicker55555 help checking the reason?

@nitpicker55555
Copy link
Collaborator Author

nitpicker55555 commented Jun 11, 2025

@Wendong-Fan CI passed now, this failure is not related to current pr and happened many times because of the test_alpaca_collector file,
this is a test that involves using an LLM to construct data in the Alpaca format. One of the assertions checks that the input key (which represents additional background information) is empty. However, the LLM may incorrectly interpret the original user question as the input, leading to assertion failures.
Another contributing factor is that the source code in alpaca_collector does not include examples where input is non-empty, which may increase the likelihood of misclassification by the LLM.

@Wendong-Fan
Copy link
Member

@Wendong-Fan CI passed now, this failure is not related to current pr and happened many times because of the test_alpaca_collector file, this is a test that involves using an LLM to construct data in the Alpaca format. One of the assertions checks that the input key (which represents additional background information) is empty. However, the LLM may incorrectly interpret the original user question as the input, leading to assertion failures. Another contributing factor is that the source code in alpaca_collector does not include examples where input is non-empty, which may increase the likelihood of misclassification by the LLM.

hey @nitpicker55555 , I mean it was hanging when I ran examples/workforce/multi_hop_example.py

@Wendong-Fan Wendong-Fan added Waiting for Update PR has been reviewed, need to be updated based on review comment and removed Review Required PR need to be reviewed labels Jun 18, 2025
@waleedalzarooni
Copy link
Collaborator

@nitpicker55555, any updates?

@Wendong-Fan Wendong-Fan modified the milestones: Sprint 30, Sprint 48 Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Agents Related to camel agents system Waiting for Update PR has been reviewed, need to be updated based on review comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Question] Workforce and Task management for production reasoning agent

5 participants