File tree Expand file tree Collapse file tree
packages/agent-manager/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,7 +208,13 @@ describe('CodexAdapter', () => {
208208
209209 const agents = await adapter . detectAgents ( ) ;
210210 expect ( agents ) . toHaveLength ( 1 ) ;
211- expect ( agents [ 0 ] . pid ) . toBe ( 105 ) ;
211+ expect ( agents [ 0 ] ) . toMatchObject ( {
212+ pid : 105 ,
213+ name : 'repo-x' ,
214+ summary : 'Codex process running' ,
215+ projectPath : '/repo-x' ,
216+ } ) ;
217+ expect ( agents [ 0 ] . sessionId ) . toBe ( 'pid-105' ) ;
212218 } ) ;
213219
214220 it ( 'should list process when session metadata is unavailable' , async ( ) => {
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ interface CodexSession {
4343 lastPayloadType ?: string ;
4444}
4545
46- type SessionMatchMode = 'cwd' | 'missing-cwd' | 'any' ;
46+ type SessionMatchMode = 'cwd' | 'missing-cwd' ;
4747
4848export class CodexAdapter implements AgentAdapter {
4949 readonly type = 'codex' as const ;
@@ -94,7 +94,7 @@ export class CodexAdapter implements AgentAdapter {
9494 const assignedPids = new Set < number > ( ) ;
9595 const agents : AgentInfo [ ] = [ ] ;
9696
97- // Match exact cwd first, then missing-cwd sessions, then any available session .
97+ // Match exact cwd first, then missing-cwd sessions.
9898 this . assignSessionsForMode (
9999 'cwd' ,
100100 codexProcesses ,
@@ -113,15 +113,6 @@ export class CodexAdapter implements AgentAdapter {
113113 processStartByPid ,
114114 agents ,
115115 ) ;
116- this . assignSessionsForMode (
117- 'any' ,
118- codexProcesses ,
119- sortedSessions ,
120- usedSessionIds ,
121- assignedPids ,
122- processStartByPid ,
123- agents ,
124- ) ;
125116
126117 // Every running codex process should still be listed.
127118 for ( const processInfo of codexProcesses ) {
@@ -454,8 +445,6 @@ export class CodexAdapter implements AgentAdapter {
454445 if ( mode === 'missing-cwd' ) {
455446 return ! session . projectPath ;
456447 }
457-
458- return true ;
459448 } ) ;
460449 }
461450
You can’t perform that action at this time.
0 commit comments