Skip to content

Commit cda10e9

Browse files
committed
fix(agent-terminal): add debug logging for onData payloads
1 parent 1393936 commit cda10e9

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

dashboard/frontend/src/components/AgentTerminal.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ export default function AgentTerminal({ agent, workingDir, accentColor = '#00FFA
106106
// alternative.
107107
const AUTO_REPLY_RE = /^\x1b\[(\?|>)[0-9;]*[a-zA-Z]$|^\x1b\[[0-9;]*[nRct]$/
108108
term.onData((data) => {
109+
// TEMP DEBUG: log every onData payload so we can see what's being
110+
// sent to the pty on startup
111+
const hex = Array.from(data).map((c) => (c as unknown as string).charCodeAt(0).toString(16).padStart(2, '0')).join('')
112+
// eslint-disable-next-line no-console
113+
console.log('[xterm onData]', data.length, 'B hex:', hex, ' match:', AUTO_REPLY_RE.test(data))
109114
if (AUTO_REPLY_RE.test(data)) return
110115
if (wsRef.current?.readyState === WebSocket.OPEN) {
111116
wsRef.current.send(JSON.stringify({ type: 'input', data }))

dashboard/terminal-server/src/claude-bridge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class ClaudeBridge {
175175
if (process.env.DEBUG) {
176176
console.log(`Session ${sessionId} output:`, data);
177177
}
178-
178+
179179
// Buffer data to check for trust prompt
180180
dataBuffer += data;
181181

0 commit comments

Comments
 (0)