Skip to content

fix(examples): apply executor iteration limit - #1563

Open
awais-ur-rehman wants to merge 1 commit into
tmc:mainfrom
awais-ur-rehman:feat/fix-agent-iteration-example
Open

awais-ur-rehman wants to merge 1 commit into
tmc:mainfrom
awais-ur-rehman:feat/fix-agent-iteration-example

Conversation

@awais-ur-rehman

Copy link
Copy Markdown

Summary

The MRKL example passes WithMaxIterations(3) to the agent, where it has no effect on the executor's limit. Pass it to NewExecutor so the example stops after three iterations as intended.

Fixes #1201.

Breaking Changes

None.

Testing

  • Go 1.26.10: go test -race -short ./agents passed.
  • go build . in examples/mrkl-agent-example passed.
  • Offline reproduction using fake.NewFakeLLM and a counting tool: the original construction executes five tool calls; the corrected construction executes three. Both end with ErrNotFinished.
  • git diff --check passed. Live OpenAI/SerpAPI execution and the full integration suite were not run.

PR Checklist

  • Read CONTRIBUTING.md and CODE_OF_CONDUCT.md.
  • Checked existing PRs and issues for an equivalent fix.
  • Described the defect and linked the issue.
  • Uses the existing executor option; adds no new concept or function.
  • Verified the example build and existing executor tests.

OpenAI Codex assisted with investigation and validation.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mrkl-agent-example incorrect usage of WithMaxIterations

1 participant