-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Python: feat(core): add max_duration_seconds bound and stop_reason signal to tool loop (#7587) #7772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Karthik Thota (karthik-0306)
wants to merge
7
commits into
microsoft:main
Choose a base branch
from
karthik-0306:fix-issue-7587
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Python: feat(core): add max_duration_seconds bound and stop_reason signal to tool loop (#7587) #7772
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
05ce001
feat(core): add max_duration_seconds bound and stop_reason signal to …
karthik-0306 7483e81
fix(core): unify batch limit decision precedence and propagate stop_r…
karthik-0306 10bb055
test: add missing tests for duration bounds, batch limits, and sessio…
karthik-0306 475d45b
Fix _apply_batch_limit_decision limits bug and Phase 1 test execution
karthik-0306 feb0479
fix(core): preserve budget start_time across approval resumes, dedupe…
karthik-0306 4ca7664
Merge main into fix-issue-7587, resolve CHNAGELOG conflict
karthik-0306 1d0e149
chore: remove CHANGELOG entry, updated centrally on release per review
karthik-0306 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this approach, is there a reason we can't use the
finish_reasonfield, I wouldn't mind adding a custom reason into the existingFinishReasonLiteral(we would have to sync with Roger Barreto (@rogerbarreto) on a name for that and make it consistent between MEAI and here)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we went with a separate
additional_propertieskey rather than repurposingfinish_reasonis that they seemed like two different things:finish_reasontoday reflects why one specific model call ended (from the provider), while this is about why the framework cut the whole multi-turn loop short — a decision we make, not the model. Folding it intofinish_reasonon the final response would mean losing whatever the model's own real finish_reason was on that last call.That said, this is your call to make — happy to move this to
FinishReasonLiteralif that's what you and Roger land on for consistency with MEAI. Let me know what name(s) you'd like and I'll wire it up accordingly.