feat: add session end lifecycle callback - #2387
Conversation
🦋 Changeset detectedLatest commit: d911119 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.
There was a problem hiding this comment.
🟥 Room names bypass telemetry redaction
Session reports export room names under unmarked room. PII-enabled collectors cannot strip these customer-controlled names.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
🟥 Agent names bypass telemetry redaction
Session reports export agent names under unmarked agent_name. PII-enabled collectors cannot strip these potentially customer-defined names.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
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