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

Closed
opened 2026-02-16 17:35:28 -05:00 by yindo · 5 comments
Owner

Originally created by @rekram1-node on GitHub (Oct 31, 2025).

Originally assigned to: @nwthomas on GitHub.

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

Originally created by @rekram1-node on GitHub (Oct 31, 2025). Originally assigned to: @nwthomas on GitHub. ### Feature hasn't been suggested before. - [x] 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
yindo added the help-wantedgood first issue labels 2026-02-16 17:35:28 -05:00
yindo closed this issue 2026-02-16 17:35:28 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 31, 2025):

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

  • #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.

@github-actions[bot] commented on GitHub (Oct 31, 2025): This issue might be a duplicate of existing issues. Please check: - #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.
Author
Owner

@nwthomas commented on GitHub (Oct 31, 2025):

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

@nwthomas commented on GitHub (Oct 31, 2025): Hey @rekram1-node I'd love to knock this out next if you all are game
Author
Owner

@rekram1-node commented on GitHub (Oct 31, 2025):

sure thing :)

@rekram1-node commented on GitHub (Oct 31, 2025): sure thing :)
Author
Owner

@nwthomas commented on GitHub (Nov 13, 2025):

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

@nwthomas commented on GitHub (Nov 13, 2025): Still intending to finish this shortly. Have been super sick the last two weeks.
Author
Owner

@rekram1-node commented on GitHub (Nov 13, 2025):

hey no prob heal up and no rush

@rekram1-node commented on GitHub (Nov 13, 2025): hey no prob heal up and no rush
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2400