@@ -23,8 +23,24 @@ afterEach(() => {
2323 runtimeMock . runtimes = undefined ;
2424} ) ;
2525
26+ const ALL_AVAILABLE : AgentRuntimes = {
27+ 'claude-code' : { status : 'available' , source : 'detected' } ,
28+ codex : { status : 'available' , source : 'detected' } ,
29+ opencode : { status : 'available' , source : 'detected' } ,
30+ pi : { status : 'available' , source : 'managed' } ,
31+ 'grok-build' : { status : 'available' , source : 'detected' } ,
32+ } ;
33+
2634describe ( 'useAgentStartCatalogs' , ( ) => {
27- it ( 'pauses only the Pi catalog while runtime availability is loading' , ( ) => {
35+ it ( 'pauses every catalog while runtime availability is loading' , ( ) => {
36+ renderHook ( ( ) => useAgentStartCatalogs ( '/repo/app' ) ) ;
37+
38+ expect ( tayoriMock . params ) . toEqual ( [ null , null , null , null , null ] ) ;
39+ } ) ;
40+
41+ it ( 'requests every catalog once the runtimes are available' , ( ) => {
42+ runtimeMock . runtimes = ALL_AVAILABLE ;
43+
2844 renderHook ( ( ) => useAgentStartCatalogs ( '/repo/app' ) ) ;
2945
3046 // The cwd is what lets an adapter resolve the tier a session would really start under —
@@ -33,26 +49,23 @@ describe('useAgentStartCatalogs', () => {
3349 { agentKind : 'claude-code' , cwd : '/repo/app' } ,
3450 { agentKind : 'codex' , cwd : '/repo/app' } ,
3551 { agentKind : 'opencode' , cwd : '/repo/app' } ,
36- null ,
52+ { agentKind : 'pi' , cwd : '/repo/app' } ,
3753 { agentKind : 'grok-build' , cwd : '/repo/app' } ,
3854 ] ) ;
3955 } ) ;
4056
41- it ( 'keeps the Pi catalog paused while its managed runtime is missing' , ( ) => {
42- runtimeMock . runtimes = { pi : { status : 'missing' } } ;
43-
44- renderHook ( ( ) => useAgentStartCatalogs ( '/repo/app' ) ) ;
45-
46- expect ( tayoriMock . params [ 3 ] ) . toBeNull ( ) ;
47- } ) ;
48-
49- it ( 'requests the Pi catalog once its runtime is available' , ( ) => {
50- runtimeMock . runtimes = { pi : { status : 'available' , source : 'managed' } } ;
57+ it ( 'skips a missing runtime but keeps out-of-range and unevaluated kinds' , ( ) => {
58+ // The dev mock host's onboarding fixture: one kind per runtime state.
59+ runtimeMock . runtimes = {
60+ 'claude-code' : { status : 'missing' } ,
61+ codex : { status : 'out-of-range' , source : 'detected' , version : '0.99.0' } ,
62+ pi : { status : 'available' , source : 'builtin' } ,
63+ } ;
5164
5265 renderHook ( ( ) => useAgentStartCatalogs ( '/repo/app' ) ) ;
5366
5467 expect ( tayoriMock . params ) . toEqual ( [
55- { agentKind : 'claude-code' , cwd : '/repo/app' } ,
68+ null ,
5669 { agentKind : 'codex' , cwd : '/repo/app' } ,
5770 { agentKind : 'opencode' , cwd : '/repo/app' } ,
5871 { agentKind : 'pi' , cwd : '/repo/app' } ,
@@ -61,7 +74,7 @@ describe('useAgentStartCatalogs', () => {
6174 } ) ;
6275
6376 it ( 'follows a workspace switch rather than capturing the first cwd' , ( ) => {
64- runtimeMock . runtimes = { pi : { status : 'available' , source : 'managed' } } ;
77+ runtimeMock . runtimes = ALL_AVAILABLE ;
6578 const { rerender } = renderHook ( ( { cwd } : { cwd : string } ) => useAgentStartCatalogs ( cwd ) , {
6679 initialProps : { cwd : '/repo/app' } ,
6780 } ) ;
0 commit comments