Skip to content

fix(agent): remove duplicate session event handler registration#87

Draft
Charles-Sevan wants to merge 1 commit into
mainfrom
dev/cwenger/prompts
Draft

fix(agent): remove duplicate session event handler registration#87
Charles-Sevan wants to merge 1 commit into
mainfrom
dev/cwenger/prompts

Conversation

@Charles-Sevan

Copy link
Copy Markdown
Contributor

WIP

Prompts dev (Waiting other PRs to be merged)

registerSessionEventHandlers() was called inside runSession() (line 205)
and again by both callers — runReviewMode() and main(). The SDK stacks
handlers on session.on(), so every event fired twice, doubling reported
usage costs and polluting the structured event log.

Callers already capture the returned handlerState for heartbeat counters,
so removing the call from runSession() is sufficient.
Base automatically changed from dev/cwenger/interface to main July 2, 2026 13:05
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