Skip to content

Conversation

@james2037
Copy link
Owner

This commit addresses concerns regarding the utility of AbstractTransport and TransportInterface.

Key changes:

  • I removed unused utility methods (encodeMessage, decodeMessage) and constant (MAX_MESSAGE_SIZE) from AbstractTransport.
  • I removed the default log() implementation from AbstractTransport.
  • Based on your feedback and the minimal remaining functionality in AbstractTransport (only a default preferSseStream method), AbstractTransport.php has been removed entirely.
  • StdioTransport and HttpTransport now directly implement TransportInterface.
    • StdioTransport implements preferSseStream as a no-op. Its specific log() method for STDERR output is now a direct public method, not part of the interface.
    • HttpTransport implements preferSseStream.
  • The log() method declaration was removed from TransportInterface as it was not called polymorphically by the Server and HttpTransport did not require it. This simplifies the interface for HttpTransport.

These changes streamline the transport hierarchy, remove dead code, and clarify the roles of the transport components, while ensuring all existing tests and linting checks pass.

This commit addresses concerns regarding the utility of `AbstractTransport` and `TransportInterface`.

Key changes:
- I removed unused utility methods (`encodeMessage`, `decodeMessage`) and constant (`MAX_MESSAGE_SIZE`) from `AbstractTransport`.
- I removed the default `log()` implementation from `AbstractTransport`.
- Based on your feedback and the minimal remaining functionality in `AbstractTransport` (only a default `preferSseStream` method), `AbstractTransport.php` has been removed entirely.
- `StdioTransport` and `HttpTransport` now directly implement `TransportInterface`.
    - `StdioTransport` implements `preferSseStream` as a no-op. Its specific `log()` method for STDERR output is now a direct public method, not part of the interface.
    - `HttpTransport` implements `preferSseStream`.
- The `log()` method declaration was removed from `TransportInterface` as it was not called polymorphically by the `Server` and `HttpTransport` did not require it. This simplifies the interface for `HttpTransport`.

These changes streamline the transport hierarchy, remove dead code, and clarify the roles of the transport components, while ensuring all existing tests and linting checks pass.
@github-actions
Copy link

github-actions bot commented Jun 5, 2025

🧪 Test Results Summary

PHPUnit Tests

✅ All tests passed!

Details: OK (232 tests, 939 assertions)

  • Total Tests: 232
  • Total Assertions: 939

Code Quality

  • PHPCS: ✅ No issues
  • PHPStan: ✅ No errors found

📁 Detailed Reports

  • Coverage Report: Download the test-outputs artifact for detailed HTML coverage report
  • Test Results: Check the "Tests" tab above for detailed test results
  • Raw Logs: View the "Actions" tab for complete output logs

This comment will update automatically when you push new commits.

Code Coverage

Code Coverage

Package Line Rate Health
Capability/CapabilityInterface.php 0%
Capability/ResourcesCapability.php 100%
Capability/ToolsCapability.php 100%
Exception/InvalidParamsException.php 0%
Exception/InvalidRequestException.php 0%
Exception/MethodNotSupportedException.php 0%
Exception/TransportException.php 0%
Message/JsonRpcMessage.php 100%
Registry/Registry.php 97%
Resource/Attribute/ResourceUri.php 100%
Resource/BlobResourceContents.php 100%
Resource/Resource.php 100%
Resource/ResourceContents.php 100%
Resource/ResourceRegistry.php 100%
Resource/TextResourceContents.php 100%
Server.php 69%
Tool/Attribute/Parameter.php 100%
Tool/Attribute/Tool.php 100%
Tool/Attribute/ToolAnnotations.php 100%
Tool/Content/AbstractContent.php 100%
Tool/Content/AbstractMediaContent.php 100%
Tool/Content/Annotations.php 100%
Tool/Content/AudioContent.php 100%
Tool/Content/ContentItemInterface.php 0%
Tool/Content/EmbeddedResource.php 100%
Tool/Content/ImageContent.php 100%
Tool/Content/TextContent.php 100%
Tool/Tool.php 100%
Tool/ToolRegistry.php 100%
Transport/HttpTransport.php 69%
Transport/StdioTransport.php 95%
Transport/TransportInterface.php 0%
Summary 88% (858 / 971)

@codecov
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Transport/HttpTransport.php 0.00% 2 Missing ⚠️
src/Transport/StdioTransport.php 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@james2037 james2037 closed this Jun 5, 2025
@james2037 james2037 deleted the refactor-transport-abstraction branch June 5, 2025 02:13
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