feat: add session end lifecycle callback - #2387
Open
chenghao-mou wants to merge 11 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: 73c27df The changes in this PR will be included in the next version bump. This PR includes changesets to release 39 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Use SIGKILL when the supervisor must stop a child. Job processes consume SIGTERM, so the default Node kill signal cannot enforce shutdown or memory limits.
ProcPool.close could return while on-demand job children still ran, allowing CLI shutdown to cut off session-end cleanup. Await every unique executor close alongside watcher tasks.
Cloud session reports use the Python schema. Preserve room and agent_name instead of renaming these transport fields for log redaction.
Python emits the process exit reason under reason. Preserve that schema instead of applying a PII-specific field name in Node.
| @@ -162,18 +153,28 @@ export abstract class SupervisedProc { | |||
| this.#logger.child({ reason: msg.value.reason }).debug('job exiting'); | |||
Contributor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Behavior: Add
onSessionEndafter the primary session closes and before internal report generation. Bound the callback to 300 seconds, then flush final OTEL logs after shutdown callbacks.Parity: Apply Python's 30-second connect and 900-second total deadlines to session report uploads. Retry only connection setup failures or responses with
RetryInfo.Validation: Agents tests, build, typecheck, lint, format, and throws checks pass. The API check still reports unrelated baseline drift.
Addresses AGT-3407
Addresses #2375
Initial prompt and agent context
Model: GPT-5.6