Commit 4ebd2b8
committed
fix(client): isolate per-tool outputSchema compile failures (PR #2249 review)
Addresses claude-bot review on PR #2249: assertSchemaSafeToCompile (SEP-2106
SSRF / composition-DoS guard) throws inside getValidator(), and
cacheToolMetadata() eagerly compiled every advertised tool's outputSchema with
no per-tool error handling. A single tool advertising a non-local $ref or an
over-budget schema therefore rejected the entire listTools() call, leaving the
client unable to list or call ANY tool from that server.
- catch compilation per-tool in cacheToolMetadata(); store the error in a new
_toolOutputValidatorErrors map instead of letting it propagate.
- surface the scoped error from callTool() only when the offending tool is
actually called (clear, descriptive ProtocolError).
- integration test: one tool with a non-local $ref outputSchema does not break
listTools() or the use of a sibling good tool; the bad tool errors only on call.
Note: the second review comment (experimental/tasks callToolStream truthiness)
is stale \u2014 the tasks feature was removed in c8d7401 before this branch, no
callToolStream exists, and no truthiness structuredContent checks remain.1 parent 5e39b25 commit 4ebd2b8
2 files changed
Lines changed: 82 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
227 | 234 | | |
228 | 235 | | |
229 | 236 | | |
| |||
812 | 819 | | |
813 | 820 | | |
814 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
815 | 833 | | |
816 | 834 | | |
817 | 835 | | |
| |||
858 | 876 | | |
859 | 877 | | |
860 | 878 | | |
| 879 | + | |
861 | 880 | | |
862 | 881 | | |
863 | | - | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
864 | 885 | | |
865 | | - | |
866 | | - | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
867 | 892 | | |
868 | 893 | | |
869 | 894 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1940 | 1940 | | |
1941 | 1941 | | |
1942 | 1942 | | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
1943 | 1997 | | |
1944 | 1998 | | |
1945 | 1999 | | |
| |||
0 commit comments