mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 14:27:21 +01:00
Fixes the headless-box launch/dispatch failure at the root and clears up the overloaded "autopilot" vocabulary. Workstream A — PTY migration, Phase 1 (server-side only): - On a box with RUNTIME_AVAILABLE=true, zellij sessions are detached, so `action go-to-tab-name` blocked to the 6s timeout (spawnSync /bin/sh ETIMEDOUT) — every launch/dispatch into kivvi/revampit failed. Launch and inject now run the agent in a FleetCrown-owned PTY via the existing Executor (docs/architecture/agent-execution-platform.md step 3): no zellij focus, no attached-terminal dependency, viewable in the browser terminal. - New SSOT helper provisionAgentWorkspace() + writeInitialPromptWhenReady() (src/lib/agent-execution/launch.ts), shared by /api/workspaces and /api/agent/launch (DRY). - /api/inject + /api/control/tab-inject route to executor.write when a live PTY workspace exists, else fall back to zellij unchanged. Dispatch inherits it. Cloud/runner paths untouched. switch-agent stays on zellij (deferred). - desktop poller: catch-all translates a residual ETIMEDOUT into an actionable message so the raw spawn error never reaches the UI. Workstream B — autopilot clarity: - Rename the cron-jobs feature "Autopilot" -> "Scheduled Jobs" everywhere (new SSOT SCHEDULED_JOBS_LABEL; AutopilotCard -> ScheduledJobsCard; /system, nav, ProjectPromptsTab). DB table cron_jobs unchanged. - The real auto-inject toggle now owns the word "Autopilot" (label beside the Build all/Pause all control; settings section + hints; fixed stale Strategist/Groq copy). - next_best template: add the explicit "nothing high-impact remains -> status: blocked / awaiting_user, stop and hand back" brake — end development and wait for the human instead of inventing T2 busywork. Verified live: kivvi launch -> 200 + running PTY + real claude process (no ETIMEDOUT); inject -> mode:pty; tsc (src+desktop), eslint, test:home 97/97, autopilot-defaults/digest/auth all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>