feat: wait returns on permission request and improve CLI logging

This commit is contained in:
Mohamed Boudra
2026-01-29 12:12:39 +07:00
parent c015fdbef1
commit 7a8841481e
13 changed files with 295 additions and 341 deletions
@@ -1902,6 +1902,10 @@ export class DaemonClientV2 {
sawRunningInQueue = true;
queuedIdle = null; // Reset: any previous idle was before this run
}
// Return immediately if we have pending permissions (even if still running)
if (sawRunningInQueue && hasPendingPermissions) {
return msg.payload;
}
if (
sawRunningInQueue &&
(status === "idle" || status === "error") &&
@@ -1934,6 +1938,11 @@ export class DaemonClientV2 {
if (status === "running" || hasPendingPermissions) {
sawRunning = true;
}
// Return if we have pending permissions (even if still running)
// OR if agent is idle/error with no pending permissions (after having run)
if (sawRunning && hasPendingPermissions) {
return msg.payload;
}
if (
sawRunning &&
(status === "idle" || status === "error") &&