Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

refactor(agent): remove mega-barrel re-export and fix session memory leak#167

Open
runyaga wants to merge 1 commit into
mainfrom
refactor/api-cleanup
Open

refactor(agent): remove mega-barrel re-export and fix session memory leak#167
runyaga wants to merge 1 commit into
mainfrom
refactor/api-cleanup

Conversation

@runyaga
Copy link
Copy Markdown
Owner

@runyaga runyaga commented Mar 12, 2026

Summary

  • Remove soliplex_client re-export from soliplex_agent barrel — consumers now import soliplex_client explicitly, making dependency ownership clear and preventing cascading breaks from leaf dependency changes
  • Fix memory leak where autoDispose: false sessions were never removed from AgentRuntime._sessions map — AgentSession now accepts an onDispose callback that auto-cleans the tracking map on any disposal path
  • Gemini 3.1 Pro review caught double-removal in _handleSessionComplete and spawn() error path — both fixed

Changes

  • soliplex_agent barrel (soliplex_agent.dart): Removed 30-line soliplex_client re-export. Kept signals_core re-export (part of public API surface).
  • AgentSession: Added onDispose callback parameter. dispose() invokes it after cleanup.
  • AgentRuntime: Passes _removeSession as onDispose to session constructor. Removed now-redundant explicit _removeSession calls from _handleSessionComplete and spawn() error path.
  • Consumer files (8 lib + 22 test): Added explicit import 'package:soliplex_client/soliplex_client.dart' across agent, cli, tui packages. Removed stale hide State and widened show clauses.

Test plan

  • dart analyze --fatal-infos — 0 issues across all 4 packages
  • dart format — 0 changes needed
  • dart test — 548 unit tests pass (agent: 394, cli: 16, tui: 69, scripting: 69)
  • Gemini 3.1 Pro review: 4x PASS, 2x WARNING (both fixed)

Addresses P0 fixes #1 and #2 from the Soliplex API Audit.

🤖 Generated with Claude Code

…leak

Stop re-exporting soliplex_client from soliplex_agent barrel. Consumers
now import soliplex_client explicitly, making dependency ownership clear
and preventing breaking changes in client from cascading through agent.

Fix memory leak where autoDispose:false sessions were never removed from
AgentRuntime._sessions map. AgentSession now accepts an onDispose callback
that the runtime uses to auto-clean the tracking map on any disposal path.

44 files changed across agent, cli, tui, scripting. 548 unit tests pass.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant