Skip to content

Client helpers do not consistently map Nack responses #39

Description

@nficano

src/Client/ARCPClient.php:292 and src/Client/ARCPClient.php:307 await correlated responses for ping() and putArtifact() and then trust PHPDoc casts instead of validating the payload. Other helpers such as invokeTool(), subscribe(), listJobs(), and fetchArtifact() explicitly map Nack through ErrorMapper and reject unexpected response types with SDK exceptions. If a peer returns a Nack or a wrong correlated payload for ping or artifact upload, these helpers can surface a PHP TypeError or return an invalid value rather than the typed ARCP exception taxonomy described by the client class documentation.

The inconsistency makes error handling depend on which helper a caller used, and it leaves common transport or protocol failure cases outside the documented ARCPException path.

Fix prompt: Add the same response validation pattern to ping() and putArtifact() that listJobs() and fetchArtifact() already use. Map Nack through ErrorMapper, throw InvalidArgumentException for unexpected successful payload types, and add tests that inject correlated Nack and wrong-type responses for both helpers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingseverity:mediumMedium severity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions