fix: post-merge review fixes for PR #384 (tool-schema-overlap) - #386
Merged
Conversation
P0: BaseAgent.__aexit__ now calls __aexit__ on _LifecycleCapable
capabilities in _external_capabilities, closing direct MCPClient
connections that were previously leaked.
P1: Replace internal Sany URL in examples/kb_diag_agent.yaml with
placeholder.
P1: _get_mcp_server_info catches and logs errors from cap.list_tools()
on config-defined MCP capabilities instead of crashing.
P2: ParamOverride.enum relaxed from list[str] to list[Any] to support
integer/number enums.
P3: Added 'intentional duplication' comments to _AliasLoader in all 10
agentpool* shim modules.
OpenCode GitHub Action fails on repos created after 2026-07-15 due to GitHub's new immutable OIDC sub format (anomalyco/opencode#37823). Setting use_github_token: true bypasses the broken OIDC exchange path. See: anomalyco/opencode#37823
Closed
This was referenced Aug 22, 2026
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.
Summary
Fixes five issues identified during code review of the merged PR #384.
Changes
_ensure_clientdirect MCPClient never closed (resource leak)BaseAgent.__aexit__now calls__aexit__on_LifecycleCapablecaps in_external_capabilitiesexamples/kb_diag_agent.yamlhttps://mcp.example.com/…_get_mcp_server_infocrashes ifcap.list_tools()failslogger.exceptionParamOverride.enumonly acceptedlist[str]list[Any]for integer/number enums_AliasLoaderduplicated in 10 shim files without explanationP0 Detail
McpServerCap.__aexit__already handles closing direct clients correctly (if self._session_pool is None and self._client is not None: await self._client.__aexit__(...)), but nothing in the agent lifecycle ever called it on config-defined capabilities. This fix adds a cleanup loop inBaseAgent.__aexit__that iterates_external_capabilitiesand calls__aexit__on any_LifecycleCapableinstances, wrapped in try/except for safety.Verification
ruff check— all passedruff format --check— all passedmypy— no issuespytest— 153 tests passed (mcp_server_cap, tool_schema_overlap, shim identity, manager status)