Skip to content

Commit 0d9188f

Browse files
committed
Remove debug console.log statements from production code
1 parent 1c411e8 commit 0d9188f

4 files changed

Lines changed: 0 additions & 32 deletions

File tree

src/plugin/pty/SessionLifecycle.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export class SessionLifecycleManager {
1616
private sessions: Map<string, PTYSession> = new Map()
1717

1818
private createSessionObject(opts: SpawnOptions): PTYSession {
19-
console.log('Creating session object with opts:', opts)
2019
const id = generateId()
2120
const args = opts.args ?? []
2221
const workdir = opts.workdir ?? process.cwd()
@@ -40,12 +39,10 @@ export class SessionLifecycleManager {
4039
buffer,
4140
process: null, // will be set
4241
}
43-
console.log('Session object created:', session)
4442
return session
4543
}
4644

4745
private spawnProcess(session: PTYSession): void {
48-
console.log('Spawning PTY process for command:', session.command, 'args:', session.args)
4946
const env = { ...process.env, ...session.env } as Record<string, string>
5047
try {
5148
const ptyProcess: IPty = spawn(session.command, session.args, {
@@ -55,15 +52,8 @@ export class SessionLifecycleManager {
5552
cwd: session.workdir,
5653
env,
5754
})
58-
console.log('PTY process spawned with pid:', ptyProcess.pid)
5955
session.process = ptyProcess
6056
session.pid = ptyProcess.pid
61-
console.log('Session after spawn:', {
62-
id: session.id,
63-
pid: session.pid,
64-
command: session.command,
65-
status: session.status,
66-
})
6757
} catch (error) {
6858
console.error('Failed to spawn PTY process:', error)
6959
throw error
@@ -75,15 +65,12 @@ export class SessionLifecycleManager {
7565
onData: (id: string, data: string) => void,
7666
onExit: (id: string, exitCode: number | null) => void
7767
): void {
78-
console.log('Setting up event handlers for session:', session.id)
7968
session.process!.onData((data: string) => {
80-
console.log('PTY onData for session', session.id, 'data length:', data.length)
8169
session.buffer.append(data)
8270
onData(session.id, data)
8371
})
8472

8573
session.process!.onExit(({ exitCode }) => {
86-
console.log('PTY onExit for session', session.id, 'exitCode:', exitCode)
8774
// Flush any remaining incomplete line in the buffer
8875
session.buffer.flush()
8976

@@ -154,16 +141,6 @@ export class SessionLifecycleManager {
154141

155142
getSession(id: string): PTYSession | null {
156143
const session = this.sessions.get(id) || null
157-
console.log('SessionLifecycle getSession for id:', id, 'found:', !!session)
158-
if (session)
159-
console.log('Session details:', {
160-
id: session.id,
161-
pid: session.pid,
162-
status: session.status,
163-
process: !!session.process,
164-
command: session.command,
165-
args: session.args,
166-
})
167144
return session
168145
}
169146

src/plugin/pty/manager.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,36 +41,30 @@ class PTYManager {
4141
}
4242

4343
spawn(opts: SpawnOptions): PTYSessionInfo {
44-
console.log('Manager spawn called with opts:', opts)
4544
const session = this.lifecycleManager.spawn(
4645
opts,
4746
(id, data) => {
48-
console.log('Manager onData callback for id:', id, 'data length:', data.length)
4947
notifyRawOutput(id, data)
5048
},
5149
async (id, exitCode) => {
52-
console.log('Manager onExit callback for id:', id, 'exitCode:', exitCode)
5350
if (onSessionUpdate) onSessionUpdate()
5451
const session = this.lifecycleManager.getSession(id)
5552
if (session && session.notifyOnExit) {
5653
await this.notificationManager.sendExitNotification(session, exitCode || 0)
5754
}
5855
}
5956
)
60-
console.log('Manager spawn returning session:', session)
6157
if (onSessionUpdate) onSessionUpdate()
6258
return session
6359
}
6460

6561
write(id: string, data: string): boolean {
66-
console.log('Manager write called for id:', id, 'data:', data)
6762
const result = withSession(
6863
this.lifecycleManager,
6964
id,
7065
(session) => this.outputManager.write(session, data),
7166
false
7267
)
73-
console.log('Manager write result:', result)
7468
return result
7569
}
7670

@@ -102,7 +96,6 @@ class PTYManager {
10296
id,
10397
(session) => {
10498
const info = this.lifecycleManager.toInfo(session)
105-
console.log('Manager get returning info:', info)
10699
return info
107100
},
108101
null

src/web/server/handlers/sessions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export async function getSession(req: BunRequest<'/api/sessions/:id'>): Promise<
4343
return new ErrorResponse('Invalid session ID', 400)
4444
}
4545
const session = manager.get(sessionId)
46-
console.log('API getSession for id:', sessionId, 'session:', session)
4746
if (!session) {
4847
return new ErrorResponse('Session not found', 404)
4948
}

test/pty-echo.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ describe('PTY Echo Behavior', () => {
2424

2525
// Subscribe to raw output events
2626
onRawOutput((_sessionId, rawData) => {
27-
console.log('Received raw data:', rawData)
2827
receivedOutputs.push(rawData)
2928
})
3029

0 commit comments

Comments
 (0)