@geekbeer/minion 2.16.3 → 2.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/routes/auth.js +37 -0
package/package.json
CHANGED
package/routes/auth.js
CHANGED
|
@@ -228,11 +228,39 @@ function submitAuthCode(code) {
|
|
|
228
228
|
return { success: false, error: 'No auth session running' }
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
// Check if the process inside the pane is still alive
|
|
232
|
+
// (remain-on-exit keeps the session but the process may have exited)
|
|
233
|
+
try {
|
|
234
|
+
const deadFlag = execSync(
|
|
235
|
+
`tmux list-panes -t ${TMUX_SESSION} -F '#{pane_dead}'`,
|
|
236
|
+
{ encoding: 'utf-8', timeout: 3000 }
|
|
237
|
+
).trim()
|
|
238
|
+
if (deadFlag === '1') {
|
|
239
|
+
const content = captureTmuxPane()
|
|
240
|
+
const clean = stripAnsi(content).trim()
|
|
241
|
+
console.error(`[Auth] Cannot submit code: auth process already exited. Pane output:\n${clean.slice(0, 500)}`)
|
|
242
|
+
try { execSync(`tmux kill-session -t ${TMUX_SESSION} 2>/dev/null`) } catch {}
|
|
243
|
+
return { success: false, error: `Auth process already exited. Output: ${clean.slice(0, 200) || '(none)'}` }
|
|
244
|
+
}
|
|
245
|
+
} catch {
|
|
246
|
+
return { success: false, error: 'No auth session running' }
|
|
247
|
+
}
|
|
248
|
+
|
|
231
249
|
try {
|
|
232
250
|
console.log('[Auth] Submitting auth code to tmux session')
|
|
233
251
|
// Use send-keys with -l (literal) to avoid interpreting special chars
|
|
234
252
|
execSync(`tmux send-keys -t ${TMUX_SESSION} -l '${code.replace(/'/g, "'\\''")}'`)
|
|
235
253
|
execSync(`tmux send-keys -t ${TMUX_SESSION} Enter`)
|
|
254
|
+
|
|
255
|
+
// Log pane content after submission for diagnostics
|
|
256
|
+
setTimeout(() => {
|
|
257
|
+
try {
|
|
258
|
+
const content = captureTmuxPane()
|
|
259
|
+
const clean = stripAnsi(content).trim()
|
|
260
|
+
console.log(`[Auth] Pane content after code submission:\n${clean.slice(0, 500)}`)
|
|
261
|
+
} catch {}
|
|
262
|
+
}, 3000)
|
|
263
|
+
|
|
236
264
|
return { success: true }
|
|
237
265
|
} catch (err) {
|
|
238
266
|
console.error(`[Auth] Failed to send code: ${err.message}`)
|
|
@@ -366,6 +394,15 @@ async function authRoutes(fastify) {
|
|
|
366
394
|
// During active auth flow, bypass cache so credential changes are detected immediately
|
|
367
395
|
if (authInProgress) {
|
|
368
396
|
clearLlmCache()
|
|
397
|
+
|
|
398
|
+
// Log credential file check for diagnostics
|
|
399
|
+
const credPaths = [
|
|
400
|
+
path.join(config.HOME_DIR, '.claude', '.credentials.json'),
|
|
401
|
+
path.join(config.HOME_DIR, '.claude', 'credentials.json'),
|
|
402
|
+
]
|
|
403
|
+
for (const p of credPaths) {
|
|
404
|
+
console.log(`[Auth] Checking ${p}: ${fs.existsSync(p) ? 'EXISTS' : 'not found'}`)
|
|
405
|
+
}
|
|
369
406
|
}
|
|
370
407
|
|
|
371
408
|
const services = getLlmServices()
|