Skip to content

Dashboard chat submits to /api/steer instead of /api/task, and SSE handler doesn't clear "Working..." state #167

Description

@josephfung

Problem

The dashboard chat doesn't work — messages show "Task In Progress / Working..." indefinitely and never display a response. There are two bugs, both in App.tsx:

1. Chat submits to the wrong endpoint

handleSubmitTask (line 232) sends the user's message to POST /api/steer:

await axios.post('/api/steer', {
  jobId: selectedJob,
  message: prompt,
  author: 'operator',
  source: 'dashboard',
});

/api/steer injects a steering message into an already-running task via the SteeringManager. It writes a file to disk and returns — it does not submit anything to the orchestrator. Since selectedJob defaults to 'job_active' and no task is running with that ID, the message goes nowhere.

The correct endpoint is POST /api/task, which submits the prompt to the orchestrator, generates a jobId, and kicks off execution with SSE events:

await axios.post('/api/task', { prompt });

2. SSE handler doesn't process completion events

The es.onmessage handler (line 382) only clears taskRunning when it receives a job_update event:

if (data.type === 'job_update') {
  if (data.data?.status === 'completed' || data.data?.status === 'failed') {
    setTaskRunning(false);
  }
}

But the backend (daemon.ts submitTask callback + orchestrator) never sends job_update. It sends:

  • done — task completed with result text
  • task.end — task lifecycle ended
  • job_failed — task threw an error

These all fall through to the catch-all else block, which displays raw JSON as a system message but never calls setTaskRunning(false).

Steps to reproduce

  1. Open the dashboard at localhost:8070
  2. Type any message in the chat input
  3. Click SEND
  4. Observe: "Task In Progress / Working..." appears and never clears
  5. Confirm via docker compose logs zora that no task was submitted to the orchestrator

Fix

Both bugs are in src/dashboard/frontend/src/App.tsx:

  1. Change axios.post('/api/steer', ...) to axios.post('/api/task', { prompt })
  2. Add handlers for done, task.end, and job_failed that call setTaskRunning(false)

Working patch in my fork: josephfung@838ceba

Happy to open a PR if my understanding is correct and my patch aligns with the design.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions