Skip to content

[FEATURE]: agent definitions should have optional maxSteps #3631

Closed

Description

@rekram1-node

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Some people want to limit their subagents, I mean this would most likely work for primary agents too but the usecase is largely for subagents, once N steps are hit it should stop.

On the n-1 step, it should remove all tools from the request to force a text response

We control the agentic loop in packages/opencode/src/session/prompt.ts

This feature is lower priority for us but it is a good addition for new contributors

Activity

  1. github-actions commented on Oct 31, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • Limit Subagent Tree Depth #2906: Similar request to limit subagent execution, specifically focusing on tree depth limits to prevent excessive nested subagent creation

    Feel free to ignore if none of these address your specific case.

  2. nwthomas commented on Oct 31, 2025

    @nwthomas
    Contributor

    Hey @rekram1-node I'd love to knock this out next if you all are game

  3. rekram1-node commented on Oct 31, 2025

    @rekram1-node
    ContributorAuthor

    sure thing :)

  4. nwthomas commented on Nov 13, 2025

    @nwthomas
    Contributor

    Still intending to finish this shortly. Have been super sick the last two weeks.

  5. rekram1-node commented on Nov 13, 2025

    @rekram1-node
    ContributorAuthor

    hey no prob heal up and no rush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions