fix: Ralph Loop wizard screen creation and session idle detection

- Fix screen creation failing when using cpulimit/nice (env vars were passed
  as command args instead of shell variables)
- Fix session status never becoming 'idle' after startInteractive()
- Add automatic state file cleanup on startup (removes orphaned sessions)
- Add /api/cleanup-state endpoint for manual cleanup
- Make frontend session readiness check more robust (20 attempts, multiple checks)
- Add fallback to direct PTY write if writeViaScreen fails

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-27 11:02:02 +01:00
co-authored by Claude Opus 4.5
parent 2d8597a66f
commit f92d009034
9 changed files with 649 additions and 104 deletions
+70 -1
View File
@@ -5433,6 +5433,68 @@ kbd {
justify-content: center;
}
/* Existing Plan Badge (in case selector) */
.existing-plan-badge {
font-size: 0.7rem;
background: var(--accent);
color: white;
padding: 0.1rem 0.4rem;
border-radius: 3px;
margin-left: 0.5rem;
font-weight: normal;
}
/* Existing Plan Card (Step 2) */
.existing-plan-card {
background: var(--bg-input);
border: 1px solid var(--accent);
border-radius: 6px;
padding: 1rem;
text-align: left;
}
.existing-plan-header {
display: flex;
align-items: center;
gap: 0.5rem;
font-weight: 500;
margin-bottom: 0.75rem;
}
.existing-plan-icon {
font-size: 1.2rem;
}
.existing-plan-stats {
display: flex;
gap: 1rem;
margin-bottom: 1rem;
font-size: 0.85rem;
}
.existing-plan-stats .stat {
display: flex;
align-items: center;
gap: 0.25rem;
}
.existing-plan-stats .stat.pending {
color: var(--yellow);
}
.existing-plan-stats .stat.completed {
color: var(--green);
}
.existing-plan-stats .stat.total {
color: var(--text-muted);
}
.existing-plan-actions {
display: flex;
gap: 0.5rem;
}
/* Plan Loading State */
.plan-loading-state {
padding: 1.5rem 1rem;
@@ -5563,6 +5625,13 @@ kbd {
font-size: 0.9rem;
}
.plan-stats {
font-weight: normal;
font-size: 0.8rem;
color: var(--text-muted);
margin-left: 0.5rem;
}
.plan-editor-actions {
display: flex;
gap: 0.35rem;
@@ -5572,7 +5641,7 @@ kbd {
display: flex;
flex-direction: column;
gap: 0.35rem;
max-height: 160px;
max-height: 300px;
overflow-y: auto;
margin-bottom: 0.5rem;
}