Commit 13f7116
Drop protocol v2 support: bump MIN to 3 + delete v2 RPC handlers
Bumps the minimum supported wire protocol version from 2 to 3 across
TypeScript, Python, .NET, Go, and Rust (Java intentionally left at 2 —
out of scope for this PR).
Before this change every SDK registered v2-only RPC handlers for
``tool.call`` and ``permission.request`` alongside the v3
broadcast-event model. The handlers were dead code on a v3 server (the
server only ever sends broadcast events) but were kept "just in case"
the SDK ever connected to a v2 server.
Now that ``MIN_PROTOCOL_VERSION = 3``, a v2 server is rejected at the
``connect`` handshake before any session-level RPC can fire, so the v2
adapters can be deleted outright.
Deletions per SDK:
- **.NET** (``Client.cs``):
- ``OnToolCallV2`` and ``OnPermissionRequestV2`` RPC handler methods
- ``ToolCallResponseV2`` and ``PermissionRequestResponseV2`` records
- Their ``[JsonSerializable]`` entries
- ``NoResultPermissionDirectRpcErrorMessage`` constant (no longer
reachable)
- **TypeScript** (``client.ts``, ``session.ts``):
- ``handleToolCallRequestV2`` / ``handlePermissionRequestV2`` private
methods on ``CopilotClient``
- ``normalizeToolResultV2`` / ``isToolResultObject`` helpers
- ``CopilotSession._handlePermissionRequestV2``
- ``NO_RESULT_PERMISSION_V2_ERROR`` constant
- Unused ``ToolCallRequestPayload`` / ``ToolCallResponsePayload`` /
``ToolResultObject`` imports in ``client.ts``
- **Python** (``client.py``):
- ``_handle_tool_call_request_v2`` and ``_handle_permission_request_v2``
methods (both create_session and resume_session paths)
- The whole "Protocol v2 backward-compatibility adapters" section
- ``_NO_RESULT_PERMISSION_V2_ERROR`` constant
- ``test_v2_permission_adapter_rejects_no_result`` unit test
- **Go** (``client.go``):
- ``handleToolCallRequestV2`` and ``handlePermissionRequestV2`` methods
- ``toolCallRequestV2`` / ``toolCallResponseV2`` /
``permissionRequestV2`` / ``permissionResponseV2`` payload types
- ``noResultPermissionDirectRpcError`` constant
- **Rust** (``session.rs``, ``lib.rs``):
- ``permission.request`` direct-RPC match arm in the session router
- ``direct_permission_payload`` helper + its unit tests
What's preserved:
- ``MIN_PROTOCOL_VERSION`` constant in each SDK (now ``= 3``)
- The handshake check that rejects servers reporting older versions
- ``negotiated_protocol_version`` field on the client (no longer
branched on anywhere, but harmless and may grow back if we add a v4
later)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 8b51c98 commit 13f7116
8 files changed
Lines changed: 12 additions & 679 deletions
File tree
- dotnet/src
- go
- nodejs/src
- python
- copilot
- rust/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
62 | | - | |
| 59 | + | |
63 | 60 | | |
64 | 61 | | |
65 | 62 | | |
| |||
1610 | 1607 | | |
1611 | 1608 | | |
1612 | 1609 | | |
1613 | | - | |
1614 | | - | |
1615 | | - | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
1619 | 1610 | | |
1620 | 1611 | | |
1621 | 1612 | | |
| |||
1799 | 1790 | | |
1800 | 1791 | | |
1801 | 1792 | | |
1802 | | - | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
1808 | | - | |
1809 | | - | |
1810 | | - | |
1811 | | - | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
1816 | | - | |
1817 | | - | |
1818 | | - | |
1819 | | - | |
1820 | | - | |
1821 | | - | |
1822 | | - | |
1823 | | - | |
1824 | | - | |
1825 | | - | |
1826 | | - | |
1827 | | - | |
1828 | | - | |
1829 | | - | |
1830 | | - | |
1831 | | - | |
1832 | | - | |
1833 | | - | |
1834 | | - | |
1835 | | - | |
1836 | | - | |
1837 | | - | |
1838 | | - | |
1839 | | - | |
1840 | | - | |
1841 | | - | |
1842 | | - | |
1843 | | - | |
1844 | | - | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
1853 | | - | |
1854 | | - | |
1855 | | - | |
1856 | | - | |
1857 | | - | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
1861 | | - | |
1862 | | - | |
1863 | | - | |
1864 | | - | |
1865 | | - | |
1866 | | - | |
1867 | | - | |
1868 | | - | |
1869 | | - | |
1870 | | - | |
1871 | | - | |
1872 | | - | |
1873 | | - | |
1874 | | - | |
1875 | | - | |
1876 | | - | |
1877 | | - | |
1878 | | - | |
1879 | | - | |
1880 | | - | |
1881 | | - | |
1882 | | - | |
1883 | | - | |
1884 | | - | |
1885 | | - | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
1889 | | - | |
1890 | | - | |
1891 | | - | |
1892 | | - | |
1893 | | - | |
1894 | | - | |
1895 | | - | |
1896 | | - | |
1897 | | - | |
1898 | | - | |
1899 | | - | |
1900 | | - | |
1901 | | - | |
1902 | | - | |
1903 | | - | |
1904 | 1793 | | |
1905 | 1794 | | |
1906 | 1795 | | |
| |||
2071 | 1960 | | |
2072 | 1961 | | |
2073 | 1962 | | |
2074 | | - | |
2075 | | - | |
2076 | | - | |
2077 | | - | |
2078 | | - | |
2079 | | - | |
2080 | | - | |
2081 | 1963 | | |
2082 | 1964 | | |
2083 | 1965 | | |
| |||
2100 | 1982 | | |
2101 | 1983 | | |
2102 | 1984 | | |
2103 | | - | |
2104 | 1985 | | |
2105 | 1986 | | |
2106 | 1987 | | |
| |||
2111 | 1992 | | |
2112 | 1993 | | |
2113 | 1994 | | |
2114 | | - | |
2115 | 1995 | | |
2116 | 1996 | | |
2117 | 1997 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | 55 | | |
58 | 56 | | |
59 | 57 | | |
| |||
1384 | 1382 | | |
1385 | 1383 | | |
1386 | 1384 | | |
1387 | | - | |
| 1385 | + | |
1388 | 1386 | | |
1389 | 1387 | | |
1390 | 1388 | | |
| |||
1740 | 1738 | | |
1741 | 1739 | | |
1742 | 1740 | | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | 1741 | | |
1748 | 1742 | | |
1749 | 1743 | | |
1750 | | - | |
1751 | | - | |
1752 | 1744 | | |
1753 | 1745 | | |
1754 | 1746 | | |
| |||
1902 | 1894 | | |
1903 | 1895 | | |
1904 | 1896 | | |
1905 | | - | |
1906 | | - | |
1907 | | - | |
1908 | | - | |
1909 | | - | |
1910 | | - | |
1911 | | - | |
1912 | | - | |
1913 | | - | |
1914 | | - | |
1915 | | - | |
1916 | | - | |
1917 | | - | |
1918 | | - | |
1919 | | - | |
1920 | | - | |
1921 | | - | |
1922 | | - | |
1923 | | - | |
1924 | | - | |
1925 | | - | |
1926 | | - | |
1927 | | - | |
1928 | | - | |
1929 | | - | |
1930 | | - | |
1931 | | - | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
1935 | | - | |
1936 | | - | |
1937 | | - | |
1938 | | - | |
1939 | | - | |
1940 | | - | |
1941 | | - | |
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 | | - | |
1997 | | - | |
1998 | | - | |
1999 | | - | |
2000 | | - | |
2001 | | - | |
2002 | | - | |
2003 | | - | |
2004 | | - | |
2005 | | - | |
2006 | | - | |
2007 | | - | |
2008 | | - | |
2009 | | - | |
2010 | | - | |
2011 | | - | |
2012 | | - | |
2013 | | - | |
2014 | | - | |
2015 | | - | |
2016 | | - | |
0 commit comments