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.
src/Client/ARCPClient.php:292andsrc/Client/ARCPClient.php:307await correlated responses forping()andputArtifact()and then trust PHPDoc casts instead of validating the payload. Other helpers such asinvokeTool(),subscribe(),listJobs(), andfetchArtifact()explicitly mapNackthroughErrorMapperand reject unexpected response types with SDK exceptions. If a peer returns aNackor a wrong correlated payload for ping or artifact upload, these helpers can surface a PHPTypeErroror 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
ARCPExceptionpath.Fix prompt: Add the same response validation pattern to
ping()andputArtifact()thatlistJobs()andfetchArtifact()already use. MapNackthroughErrorMapper, throwInvalidArgumentExceptionfor unexpected successful payload types, and add tests that inject correlatedNackand wrong-type responses for both helpers.