feat: automated task loop / agent orchestrator #183

Closed
opened 2026-03-06 09:32:46 -08:00 by hikari · 0 comments
Owner

Overview

Inspired by ralph-tui's core feature, this adds an Automated Task Loop — the ability to create a task list and have Hikari automatically run Claude Code through each task in sequence, without manual intervention.

User Story

As a developer with many tasks to complete, I want to define a list of work items and have Hikari automatically work through them one by one, so I can step away whilst Claude handles the batch.

Feature Details

Task List Format

Support a simple hikari-tasks.json format:

{
  "tasks": [
    {
      "id": "task-1",
      "title": "Add unit tests for auth module",
      "prompt": "Write comprehensive unit tests for src/auth/*.ts with 100% coverage",
      "priority": 1,
      "status": "pending"
    },
    {
      "id": "task-2",
      "title": "Fix login redirect bug",
      "prompt": "Fix the bug where logged-in users are still redirected to /login",
      "priority": 2,
      "status": "pending"
    }
  ]
}

Loop Behaviour

The orchestration loop should:

  1. Select the highest-priority pending task
  2. Build the full prompt and send it to Claude Code in a new conversation tab
  3. Monitor for task completion by detecting the result message with subtype: "success" or subtype: "error" in the stream-JSON protocol
  4. Mark the task as completed (or failed) and update the task file on disk
  5. Advance to the next task automatically
  6. Repeat until all tasks are done or the user pauses/stops

UI Changes

  • New Task Loop Panel (accessible via a dedicated toolbar button)
    • Import/open an existing hikari-tasks.json file
    • Create/edit tasks inline within the panel
    • Display task list with status indicators (pending / in progress / completed / failed)
    • Start / Pause / Stop controls
    • Iteration counter (e.g. "Task 2 of 7")
  • Loop Status Badge in the status bar when a loop is active (e.g. " Loop running: 2/7")
  • Character state: use the coding animation whilst the loop is running

Pause & Resume

  • Pause between tasks (never mid-task — wait for the current task to complete first)
  • Resume from where the loop left off
  • Loop state persisted to disk so it survives app restarts

Per-Task Conversations

Each task should run in its own conversation tab so the history is preserved and inspectable after the loop finishes.

Cross-Task Context

Optionally inject a summary of previously completed tasks into the next task's system context, so Claude has awareness of what has already been done.

Iteration Limits

  • Optional maximum iteration count (stop after N tasks)
  • Headless mode consideration for future: run without UI interaction

Acceptance Criteria

  • User can create a task list or import a hikari-tasks.json file
  • User can start the loop and it runs tasks sequentially, one per conversation tab
  • Task statuses update in real time as tasks complete
  • User can pause the loop (waits for current task to finish) and resume
  • User can stop the loop immediately
  • Loop state persists across app restarts
  • Failed tasks are marked as failed and the loop advances to the next task
  • Tests written for all new logic

This issue was created with help from Hikari~ 🌸

## Overview Inspired by [ralph-tui](https://github.com/subsy/ralph-tui)'s core feature, this adds an **Automated Task Loop** — the ability to create a task list and have Hikari automatically run Claude Code through each task in sequence, without manual intervention. ## User Story As a developer with many tasks to complete, I want to define a list of work items and have Hikari automatically work through them one by one, so I can step away whilst Claude handles the batch. ## Feature Details ### Task List Format Support a simple `hikari-tasks.json` format: ```json { "tasks": [ { "id": "task-1", "title": "Add unit tests for auth module", "prompt": "Write comprehensive unit tests for src/auth/*.ts with 100% coverage", "priority": 1, "status": "pending" }, { "id": "task-2", "title": "Fix login redirect bug", "prompt": "Fix the bug where logged-in users are still redirected to /login", "priority": 2, "status": "pending" } ] } ``` ### Loop Behaviour The orchestration loop should: 1. **Select** the highest-priority pending task 2. **Build** the full prompt and send it to Claude Code in a new conversation tab 3. **Monitor** for task completion by detecting the `result` message with `subtype: "success"` or `subtype: "error"` in the stream-JSON protocol 4. **Mark** the task as completed (or failed) and update the task file on disk 5. **Advance** to the next task automatically 6. **Repeat** until all tasks are done or the user pauses/stops ### UI Changes - New **Task Loop Panel** (accessible via a dedicated toolbar button) - Import/open an existing `hikari-tasks.json` file - Create/edit tasks inline within the panel - Display task list with status indicators (pending / in progress / completed / failed) - Start / Pause / Stop controls - Iteration counter (e.g. "Task 2 of 7") - **Loop Status Badge** in the status bar when a loop is active (e.g. "⚡ Loop running: 2/7") - **Character state**: use the `coding` animation whilst the loop is running ### Pause & Resume - Pause between tasks (never mid-task — wait for the current task to complete first) - Resume from where the loop left off - Loop state persisted to disk so it survives app restarts ### Per-Task Conversations Each task should run in its own conversation tab so the history is preserved and inspectable after the loop finishes. ### Cross-Task Context Optionally inject a summary of previously completed tasks into the next task's system context, so Claude has awareness of what has already been done. ### Iteration Limits - Optional maximum iteration count (stop after N tasks) - Headless mode consideration for future: run without UI interaction ## Acceptance Criteria - [ ] User can create a task list or import a `hikari-tasks.json` file - [ ] User can start the loop and it runs tasks sequentially, one per conversation tab - [ ] Task statuses update in real time as tasks complete - [ ] User can pause the loop (waits for current task to finish) and resume - [ ] User can stop the loop immediately - [ ] Loop state persists across app restarts - [ ] Failed tasks are marked as failed and the loop advances to the next task - [ ] Tests written for all new logic ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-03-06 19:35:29 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#183