Skip to content

feat: add return_handle to commit_user_turn - #8729

Merged
chenghao-mou merged 3 commits into
mainfrom
chenghao/feat/AGT-3629-commit-user-turn-handle
Nov 24, 2026
Merged

chenghao-mou merged 3 commits into
mainfrom
chenghao/feat/AGT-3629-commit-user-turn-handle

Conversation

@chenghao-mou

@chenghao-mou chenghao-mou commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Manual turn handlers need the handle for the reply commit_user_turn() already schedules so they can wait for playout. A wait in generate_reply() would only help callers that start a separate reply. Thanks to @bml1g12 for proposing a result with the transcript and speech handle.

transcript, handle = await session.commit_user_turn(return_handle=True)
if handle is not None:
    await handle

With skip_reply=True, an accepted turn enters chat history before the opt-in result resolves.

Fixes #7585
Addresses AGT-3629

Initial prompt and agent context

Model: GPT-6.2 Sol

#7585

Investigate this issue. One solution I can think of is to add a parameter return_handle=False so we can change this without breaking existing calls.

okay, let's implement return_handle then, do we return just the handle or a tuple

@chenghao-mou chenghao-mou added the review_effort:medium Needs some domain context or careful validation label Nov 22, 2026
@chenghao-mou
chenghao-mou marked this pull request as ready for review November 22, 2026 19:27
@chenghao-mou
chenghao-mou requested a review from a team as a code owner November 22, 2026 19:27
devin-ai-integration[bot]

This comment was marked as resolved.

@bml1g12

bml1g12 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Awesome, thanks for this!

@longcw longcw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! something nit:

@chenghao-mou
chenghao-mou merged commit e9e0f50 into main Nov 24, 2026
23 checks passed
@chenghao-mou
chenghao-mou deleted the chenghao/feat/AGT-3629-commit-user-turn-handle branch November 24, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review_effort:medium Needs some domain context or careful validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return the SpeechHandle from commit_user_turn or ensure await session.commit_user_turn(...) commits to chat context on resolve

3 participants