Skip to content

AA-153020 [ai-sdk] accept trackSessionEnd in agent.session() options - #157

Merged
vinaygoel merged 1 commit into
mainfrom
vinaygoel/AA-153020-session-end-option
Nov 20, 2026
Merged

vinaygoel merged 1 commit into
mainfrom
vinaygoel/AA-153020-session-end-option

Conversation

@vinaygoel

Copy link
Copy Markdown
Contributor

Linear AA-153020. Found while working on #156.

Session already honors trackSessionEnd: false: run() then skips the automatic [Agent] Session End. Several places pass it to agent.session(...):

  • the Codex guide
  • the CodexSDKTracker JSDoc
  • amplitude-ai.md

But BoundAgent.session() left the option out of its type, so a strict type check rejects those examples. This PR adds the option to the type with a doc comment. Python already accepts agent.session(track_session_end=False).

Runtime behavior is unchanged. This is a type and doc-comment change only, with no new behavior.

Test

New case in test/bound-agent.test.ts: two run() calls on sessions with trackSessionEnd: false send no Session End, then agent.trackSessionEnd(...) sends exactly one.

Checks

bound-agent.test.ts (28 tests), tsc --noEmit, check:generated and lint all pass.

Independent of #156; either can merge first.

Session already honored trackSessionEnd at runtime, and the Codex guide, the CodexSDKTracker JSDoc and amplitude-ai.md pass it, but BoundAgent.session() omitted it from its options type. Type and document it, matching Python's track_session_end, and test that run() calls with trackSessionEnd: false send no Session End until agent.trackSessionEnd.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vinaygoel
vinaygoel requested a review from a team as a code owner November 20, 2026 03:37
@linear-code

linear-code Bot commented Nov 20, 2026

Copy link
Copy Markdown

AA-153020

@vinaygoel
vinaygoel merged commit 405f3fe into main Nov 20, 2026
9 checks passed
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.

1 participant