Skip to content

feat: ai.tool() should support passing triggerOptions (priority, tags) to subtasks #3123

@argjent-doldadress

Description

@argjent-doldadress

Is your feature request related to a problem?

ai.tool() internally calls task.triggerAndWait() but only passes metadata. There's no way to forward priority, tags, or other trigger options to the subtask. The only workaround is skipping ai.tool() entirely and writing custom tool() wrappers.

Describe the solution you'd like to see

Add a triggerOptions field to ToolOptions that gets merged into the triggerAndWait call:

ai.tool(myTask, {
    triggerOptions: {
        priority: 200,
        tags: ["user:abc", "type:onboarding"],
    },
});

Describe alternate solutions

Subtasks spawned via ai.tool() could automatically inherit the parent run's priority and tags.

Additional information

Relevant for any agentic workflow using priority-based queue ordering where subtasks should respect the parent's priority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions