Skip to content

feat(agent-core): throttle goal continuation turns when waiting for background agents #666

@thecannabisapp

Description

@thecannabisapp

When running in goal mode with a swarm of background agents, the driveGoal() loop currently schedules continuation turns with no minimum interval. The model calls TaskList every 1-2 seconds to check agent status, consuming 100-200 tokens per turn and wasting a large amount of context over a long-running goal.

We fixed this in our fork by adding a 15-second minimum interval between goal continuation turns and by updating the goal reminder/continuation prompt to tell the model not to poll background tasks with TaskList (prefer automatic completion notifications or TaskOutput(block=true)).

Commit with the fix: thecannabisapp@f227bb20

If the maintainers want to merge this, the key changes are in packages/agent-core/src/agent/turn/index.ts (the driveGoal throttle) and packages/agent-core/src/agent/injection/goal.ts (the prompt guidance).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions