Skip to content

[Feature Proposal] Implement 'jointask' for Active Task Handoff & Contextual CollaborationΒ #3285

@rapus95

Description

@rapus95

What problem does this proposed feature solve?

Roo Code's current subtasking mechanisms, while valuable for decomposing complex problems, lead to significant context loss. When a subtask completes or a task becomes dormant, its accumulated internal state, reasoning, and learned information are not easily recoverable or directly transferable to other existing tasks in an automated fashion. While users can manually re-engage with an old task to revive its context, tasks themselves lack the ability to initiate this.

This limitation results in several inefficiencies:

  • Information Silos: Valuable knowledge and context built within one task remain isolated and inaccessible to others that might benefit from it.
  • Inefficient Workflows: Tasks may expend resources re-discovering information or re-solving problems that another (dormant) task has already processed.
  • Limited Specialization & Collaboration: It's difficult for one task to directly "consult" or "delegate" a specific part of a problem to another pre-existing task that might have specialized knowledge or relevant history, without significant manual intervention.
  • Loss of "Live Memory": The rich, dynamic context built up during a task's operation is effectively lost for future automated use once the task is no longer in the immediate execution chain.

Describe the proposed solution in detail

This issue proposes a new core command/functionality called jointask(target_task_id, message). This feature will enable an active roo task to:

  1. Identify and Target: Specify a target_task_id corresponding to any pre-existing task, whether currently active, dormant, or previously completed.
  2. Reactivate & Restore Context: The system will reactivate the target_task_id. Crucially, this reactivation will restore the target task's full prior context, including its memory, history, internal state, and any accumulated knowledge up to the point it last became inactive.
  3. Inject New Input: The message (a string, prompt, or structured data) provided by the calling task will be passed as new input to the reactivated target task, guiding its subsequent actions within its restored context.

Essentially, jointask allows one task to "call for help," "delegate a sub-problem," or "pass the baton" to another specific task, bringing its "live memory" and specialized capabilities back into the active workflow. The target task, now equipped with its past knowledge and the new directive, can then continue processing, potentially using jointask itself to collaborate further or return results to the original caller or another designated task.

Key Functionalities & Benefits:

  • Persistent Live Memory: Enables explicit access to and utilization of the rich contextual history of any task within the system instead of reading loads of files on task start ("memory bank approach")
  • Specialized Team Workflow: Facilitates the creation and interaction of "teams" of specialist tasks (e.g., Code Analyst, API Researcher, Git Manager). Tasks can direct specific queries or sub-problems to the most appropriate specialist, which can then leverage its full historical context.
  • Dynamic Contextual Handoff: Allows for seamless and context-rich transfer of information and control flow between tasks, far exceeding simple output-input chaining.
  • Reduced Redundancy: Minimizes re-work by allowing tasks to build directly upon each other's specific prior efforts and findings.
  • Foundation for Advanced Features: This mechanism serves as a foundational building block for more sophisticated capabilities like:
    • Smarter Task Compression/Summarization: New tasks can ask their ancestors for key insights, thus accelerating the progress after compression if something was missed.
    • Proactive Assistance: Orchestrator mode could itself create dedicated specialists not just by introducing new modes but also by controlling which task focuses on what topic.

Technical considerations or implementation details (optional)

  • Task Identification: Assumes a robust system for persistent, unique task IDs. For example, by always having the current task ID as part of the generated prompt. If the current task knows its own ID, it can communicate it to other tasks.
  • Message Injection: The message from the calling task should be added to the reactivated task's history as a new prompt or input, allowing it to process it naturally, in the same way it would get up running again if the user entered a new prompt.
  • Task Spawning and Mode Switching: Supplying predefined IDs or maybe even name tags as the first parameter would generalize mode switching and task creation. For example, jointask(0, "dothat") could create a new task in the same mode as the caller. jointask(CODE, "dothat") could be a generic approach to switch to the code mode. Optionally, it could be designed as a 3 argument function, supplying the target mode as a dedicated argument.
  • New Capability Rule: Have a toggleable capability for task joining as that's way more powerful than subtask starting.

Describe alternatives considered (if any)

  1. Manual User Re-engagement: Users can currently re-open and interact with old tasks by looking them up in the history and providing new input.
    * Why jointask is preferred: Manual re-engagement is not automated, cannot be initiated by tasks themselves, and doesn't scale for complex, autonomous inter-task workflows. jointask empowers tasks to perform these contextual handoffs.
    2. Standard Subtasking: Creating new subtasks to handle parts of a problem.
    * Why jointask is preferred: Standard subtasking typically involves creating a new task, which starts with a limited, explicitly passed context. It doesn't allow for re-engaging an existing, specific task with its full, rich historical context. jointask is about leveraging the "wisdom" and "experience" of specific, previously active tasks.
    3. Passing Extensive Context Payloads: Tasks could attempt to pass all potentially relevant historical data to new tasks or via messages.
    * Why jointask is preferred: This is highly inefficient, verbose, and makes it difficult for the receiving task to discern the most relevant information. jointask revives the entirety of a specific task's inherent context, making it immediately available and operational without massive data transfers in the jointask call itself. The "memory" is already within the target task.

Additional Context & Mockups

The core idea is to enable a "team" of roo agents to collaborate more effectively by explicitly calling upon each other, bringing their unique histories and specializations to bear on a problem. This is analogous to how human teams operate, where one member might consult another with specific expertise or prior experience on a related matter.

Example Scenario: Implementing a Minecraft Entity

Imagine a team of specialized roo tasks, each with a unique ID:

  • Orchestrator (ID: 2113)
  • NetworkGuru (ID: 1237)
  • GUIGuru (ID: 8832)
  • Git Manager (ID: 1284)
  • Main Developer Task (ID: 2232) - The task currently working on a new entity.

Disclaimer: Sent message would be longer and with a little more context (like the files currently working on, though, they can also be taken from active tabs). I've kept them intentionally short here for interaction demonstration instead of implementation demonstration.

Workflow using jointask:

  1. Main Developer Task (2232) needs to implement an Entity:

    • Issues: Task 2232: jointask(8832, "I (Task 2232) need a new GUI that provides a 5*9 inventory for miner inventory, 6 dedicated slots (for those described in InventoryComponent) plus 2 progress bars that show remainingFuel and remainingEnergy and lastly a grid for access to the player inventory. And when I hit the R button while in GUI the miner needs to execute Rpressed on the server. Can you set that up?")
  2. GUIGuru (8832) activates and -relying on previous GUI setup knowledge- starts building the GUI without having to fetch full GUI source again:

    • Implements GUI and keybindings and creates a first iteration payload X for server communication
    • Issues: Task 8832: jointask(1237, "Task 2232 requested GUI setup and Payload X to call Rpressed on the server side. Please implement the latter in accordance to the project guidelines. When done, report to 2232.")
  3. NetworkGuru (1237) activates and

    • -relying on deeper understanding of the project networking approach- right away one-shots the network calling code. Again.
    • Issues: Task 1237: jointask(2232, "GUI and Networking are set up.")
  4. Main Developer Task (2232) receives information and might run a round of testing before:

    • Issues: Task 2232: jointask(1284, "Miner entity finished. Please commit the changes. Once done, notify the Orchestrator (2113).")
  5. Git Manager (1284) activates, prepares, and makes a git-history-aware commit since it knows the larger picture thanks to knowing all recently made commits.

    • Issues: Task 1284: jointask(2113, "The Miner entity is implemented and versioned. Commit hash: [commit_hash].")
  6. Orchestrator (2113) is informed:

    • Acknowledges: Task 2113: "Noted. Next up is task 15. Implementing an engine item. Handoff to Architect for item design"

This example illustrates how jointask allows for a fluid, context-aware handoff between specialized tasks, mirroring an effective team workflow and preserving valuable accumulated knowledge within each task.

Conceptual Task Role Management (Usage Pattern):

A user or an orchestrator task could maintain a list of "specialist" task IDs for easier reference when using jointask.

// Example of how task IDs might be managed for easy lookup
"specialist_tasks": [
  "orchestrator": "2113",
  "network_guru": "1237",
  "gui_guru": "8832",
  "git_manager": "1284"
]

// Then a task could do:
// jointask(specialist_tasks["gui_guru"], "Please setup a gui with the following contents...");

Proposal Checklist

  • I have searched existing Issues and Discussions to ensure this proposal is not a duplicate.
  • This proposal is for a specific, actionable change intended for implementation (not a general idea).
  • I understand that this proposal requires review and approval before any development work begins.

Are you interested in implementing this feature if approved?

  • Partly. I would like but I fear it to be a huuuuge task tbh. And I won't be available for the next 2 weeks anyway (except today, 8.5.). But if there are questions or issues arise with the idea, I'd love to help tackling them on a conceptual level. And to sweeten the deal and get this awesome thing built, I'm throwing in a Roo Bucks bounty worth 50€ for whoever makes this magic happen!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - Needs ApprovalReady to move forward, but waiting on maintainer or team sign-off.enhancementNew feature or requestfeature requestFeature request, not a bug

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions