Repository navigation
Commit c56aaad
committed
fix(server): imported Claude Code sessions resume on their first follow-up
An imported Claude Code session is written as a provider thread with a strong
native ref, no conversation head and no provider turns. `openQuery` only
resumed when one of those existed or this session instance had already
opened the native thread, so the first follow-up reopened the session with a
fixed `sessionId` and the CLI rejected it: "Session ID ... is already in use".
`resumeThread` is how the orchestrator re-attaches a provider thread that
already carries a native id. When the thread has never been bound by a
provider session of ours (`providerSessionId === null`, the shape both import
paths write), record its native id as adopted and let `openQuery` resume it.
Threads this adapter minted keep their provider session id, so a retry after
a failed first create still creates the session.1 parent 00eb8f6 commit c56aaad
2 files changed
Lines changed: 87 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1783 | 1783 | | |
1784 | 1784 | | |
1785 | 1785 | | |
1786 | | - | |
| 1786 | + | |
1787 | 1787 | | |
1788 | 1788 | | |
1789 | 1789 | | |
| |||
1827 | 1827 | | |
1828 | 1828 | | |
1829 | 1829 | | |
1830 | | - | |
| 1830 | + | |
| 1831 | + | |
1831 | 1832 | | |
1832 | 1833 | | |
1833 | 1834 | | |
1834 | 1835 | | |
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 | + | |
1836 | 1861 | | |
1837 | 1862 | | |
1838 | 1863 | | |
| |||
1867 | 1892 | | |
1868 | 1893 | | |
1869 | 1894 | | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
1870 | 1919 | | |
1871 | 1920 | | |
1872 | 1921 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2987 | 2987 | | |
2988 | 2988 | | |
2989 | 2989 | | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
2990 | 2995 | | |
2991 | 2996 | | |
2992 | 2997 | | |
| |||
6932 | 6937 | | |
6933 | 6938 | | |
6934 | 6939 | | |
| 6940 | + | |
| 6941 | + | |
| 6942 | + | |
| 6943 | + | |
| 6944 | + | |
| 6945 | + | |
6935 | 6946 | | |
6936 | | - | |
| 6947 | + | |
| 6948 | + | |
| 6949 | + | |
| 6950 | + | |
6937 | 6951 | | |
6938 | 6952 | | |
6939 | 6953 | | |
| |||
7489 | 7503 | | |
7490 | 7504 | | |
7491 | 7505 | | |
| 7506 | + | |
| 7507 | + | |
| 7508 | + | |
| 7509 | + | |
| 7510 | + | |
| 7511 | + | |
| 7512 | + | |
| 7513 | + | |
| 7514 | + | |
| 7515 | + | |
| 7516 | + | |
| 7517 | + | |
| 7518 | + | |
| 7519 | + | |
| 7520 | + | |
| 7521 | + | |
| 7522 | + | |
| 7523 | + | |
| 7524 | + | |
| 7525 | + | |
7492 | 7526 | | |
7493 | 7527 | | |
7494 | 7528 | | |
| |||
0 commit comments