Skip to content

Conversation

@stuartleeks
Copy link
Contributor

Why are these changes needed?

The initializer for ACADynamicSessionsCodeExecutor creates a new GUID to use as the session ID for dynamic sessions.

In some scenarios it is desirable to be able to re-create the agent group chat from saved state. In this case, the ACADynamicSessionsCodeExecutor needs to be associated with a previous instance (so that any execution state is still valid)

This PR adds a new argument to the initializer to allow a session ID to be passed in (defaulting to the current behaviour of creating a GUID if absent).

Related issue number

Closes #6119

Checks

@stuartleeks
Copy link
Contributor Author

One outstanding question I have is what the behaviour should be if restart is called?

Ideas so far

  1. reset the ID to a new GUID (current behaviour)
  2. add an optional arg to set a new ID if passed but revert to a new GUID by default
  3. add a preserve_session_id arg to __init__ that controls whether the session ID is preserved to reset when calling restart

Would be interested in thoughts :-)

@codecov
Copy link

codecov bot commented Apr 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.32%. Comparing base (9de16d5) to head (a4fa448).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6171   +/-   ##
=======================================
  Coverage   77.31%   77.32%           
=======================================
  Files         197      197           
  Lines       13797    13797           
=======================================
+ Hits        10667    10668    +1     
+ Misses       3130     3129    -1     
Flag Coverage Δ
unittests 77.32% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stuartleeks stuartleeks force-pushed the aca-dynamic-sessions-session-id branch from 590ad8b to 79262e6 Compare April 1, 2025 16:31
@ekzhu
Copy link
Contributor

ekzhu commented Apr 1, 2025

Looks like there is a pyright error.

@ekzhu
Copy link
Contributor

ekzhu commented Apr 1, 2025

I think we can keep the current behavior with a note in the API doc.

.. note: 
  
  The session ID will be reset upon `restart()`. 

We can get feedback later.

One outstanding question I have is what the behaviour should be if restart is called?

Ideas so far

  1. reset the ID to a new GUID (current behaviour)
  2. add an optional arg to set a new ID if passed but revert to a new GUID by default
  3. add a preserve_session_id arg to __init__ that controls whether the session ID is preserved to reset when calling restart

Would be interested in thoughts :-)

@stuartleeks stuartleeks force-pushed the aca-dynamic-sessions-session-id branch from 733ac2b to 8784b7f Compare April 2, 2025 15:11
@stuartleeks
Copy link
Contributor Author

Added a note to make the behaviour when calling restart clear. Rebased on latest main

@ekzhu ekzhu enabled auto-merge (squash) April 2, 2025 21:34
@ekzhu ekzhu merged commit 9143e58 into microsoft:main Apr 2, 2025
56 checks passed
@stuartleeks stuartleeks deleted the aca-dynamic-sessions-session-id branch April 3, 2025 07:18
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.

2 participants