Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/plugin/pty/session-lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export class SessionLifecycleManager {
command: session.command,
args: session.args,
workdir: session.workdir,
parentSessionId: session.parentSessionId,
status: session.status,
notifyOnExit: session.notifyOnExit,
timeoutSeconds: session.timeoutSeconds,
Expand Down
1 change: 1 addition & 0 deletions src/plugin/pty/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface PTYSessionInfo {
command: string
args: string[]
workdir: string
parentSessionId: string
status: PTYStatus
notifyOnExit: boolean
timeoutSeconds?: number
Expand Down
4 changes: 4 additions & 0 deletions test/pty-tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('PTY Tools', () => {
command: opts.command,
args: opts.args || [],
workdir: opts.workdir || '/tmp',
parentSessionId: opts.parentSessionId,
pid: 12345,
status: 'running',
notifyOnExit: opts.notifyOnExit ?? false,
Expand Down Expand Up @@ -135,6 +136,7 @@ describe('PTY Tools', () => {
command: 'echo',
args: ['hello'],
workdir: '/tmp',
parentSessionId: 'parent-session-id',
status: 'running',
notifyOnExit: false,
timeoutSeconds: undefined,
Expand Down Expand Up @@ -190,6 +192,7 @@ describe('PTY Tools', () => {
command: 'echo',
args: ['hello'],
workdir: '/tmp',
parentSessionId: 'parent-session-id',
status: 'running',
notifyOnExit: true,
timeoutSeconds: undefined,
Expand Down Expand Up @@ -297,6 +300,7 @@ describe('PTY Tools', () => {
pid: 12345,
lineCount: 10,
workdir: '/tmp',
parentSessionId: 'parent-session-id',
createdAt: new Date('2023-01-01T00:00:00Z').toISOString(),
},
]
Expand Down
3 changes: 3 additions & 0 deletions test/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('Web Types', () => {
createdAt: new Date().toISOString(),
args: ['hello'],
workdir: '/home/user',
parentSessionId: 'ses_test',
},
]

Expand Down Expand Up @@ -73,6 +74,7 @@ describe('Web Types', () => {
createdAt: new Date().toISOString(),
args: ['Hello, World!'],
workdir: '/home/user',
parentSessionId: 'ses_test',
}

expect(session.id).toBe('pty_12345')
Expand All @@ -99,6 +101,7 @@ describe('Web Types', () => {
createdAt: new Date('2026-01-21T10:00:00.000Z').toISOString(),
args: ['Hello, World!'],
workdir: '/home/user',
parentSessionId: 'ses_test',
}

expect(session.exitCode).toBeUndefined()
Expand Down
1 change: 1 addition & 0 deletions test/web-permissions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function buildSpawnInfo(overrides: Partial<PTYSessionInfo> = {}): PTYSessionInfo
command: 'echo',
args: ['blocked'],
workdir: process.cwd(),
parentSessionId: 'ses_test',
status: 'running',
notifyOnExit: false,
timedOut: false,
Expand Down
1 change: 1 addition & 0 deletions test/web-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ describe('Web Server', () => {
expect(sessionData.id).toBe(session.id)
expect(sessionData.command).toBe('bash')
expect(sessionData.args).toEqual([])
expect(sessionData.parentSessionId).toBe('test')
}, 200)

it('should return 404 for non-existent session', async () => {
Expand Down
Loading