Skip to content

New task creates a worker but leaves the UI on the previous session #392

Description

@areycruzer

Summary

Starting a worker from the Electron New task dialog successfully creates the worker session and adds it to the sidebar, but the main content stays on the previous session route instead of opening the new worker session.

In the reproduced flow, I started a worker while viewing the project orchestrator. The API created qa-alpha-2 and the sidebar immediately showed QA worker smoke, but the URL and main terminal remained on the orchestrator session qa-alpha-1 until I clicked the new worker in the sidebar.

Severity

P2/P3 user-visible navigation bug.

The task is created successfully, so there is no data loss, but the primary action does not take the user to the thing it just created. This is especially confusing during onboarding because the visible terminal remains the orchestrator while the new worker appears only as a small sidebar row.

Repro from clean main

Tested on main at afe0817 with isolated Electron/daemon state:

AO_DATA_DIR=/tmp/reverbcode-qa-next/ao-data \
AO_RUN_FILE=/tmp/reverbcode-qa-next/running.json \
AO_PORT=31012 \
AO_TELEMETRY_EVENTS=off \
AO_TELEMETRY_METRICS=off \
AO_TELEMETRY_REMOTE=off \
VITE_AO_POSTHOG_HOST=http://127.0.0.1:9 \
npm --prefix frontend run dev
  1. Create a disposable git repo under /tmp.
  2. Add it in Electron.
  3. Spawn/open the project orchestrator.
  4. While viewing the orchestrator session, click New task in the topbar.
  5. Fill in:
    • Title: QA worker smoke
    • Brief: Do not modify files. Stay idle after startup; this is a local Electron QA smoke test.
    • Branch: qa-worker-smoke
    • Agent: Codex
  6. Click Start task.

Expected behavior

After the worker is created, the app should navigate to the new worker session route and render its terminal/details:

/projects/qa-alpha/sessions/qa-alpha-2

This matches the apparent intent in both New Task call sites: invalidate workspace data, then navigate to the created session id.

Actual behavior

The worker is created and appears in the sidebar, but the main pane remains on the previous orchestrator session:

localhost:5173/#/projects/qa-alpha/sessions/qa-alpha-1

Clicking the new QA worker smoke sidebar row afterward opens the worker correctly, which confirms the session exists and the session route itself works.

Evidence from local QA

Screenshot immediately after clicking Start task:

/tmp/reverbcode-qa-next/evidence/new-task-start-stays-on-orchestrator.png

API proof that the worker was created while the UI stayed on the orchestrator:

{
  "id": "qa-alpha-2",
  "projectId": "qa-alpha",
  "issueId": "QA worker smoke",
  "kind": "worker",
  "harness": "codex",
  "status": "idle",
  "terminalHandleId": "qa-alpha-2/terminal_0",
  "branch": "qa-worker-smoke"
}

Full local API dump:

/tmp/reverbcode-qa-next/logs/api-sessions-after-worker.json

Control check: manually clicking the sidebar row Open QA worker smoke navigated to qa-alpha-2 and rendered the worker terminal/inspector correctly.

Code references

NewTaskDialog reports the created session id to its parent:

The session topbar handler appears intended to invalidate the workspace query and navigate to the new session:

The board-level New Task handler has the same intended shape:

The session view depends on the workspace query containing the session before it can render the selected session:

Duplicate / PR check

I checked open issues and PRs before filing:

gh search issues "new task worker navigate session route" --repo aoagents/ReverbCode --state open
gh search prs "new task worker navigate session route" --repo aoagents/ReverbCode --state open
gh issue list --repo aoagents/ReverbCode --state open --search "New Task OR worker routing OR Start task"

No matching open issue or PR showed up for this specific New Task worker navigation flow.

Nearby work:

Possible fix shape

Likely frontend-only and small-to-medium scope:

  • Ensure handleTaskCreated waits for fresh workspace data that includes the new worker before navigating, or navigates immediately while the session route has a loading/refetch path for a just-created session id.
  • Consider covering both New Task call sites (ShellTopbar and SessionsBoard) with a focused test that asserts onCreated(sessionId) results in the expected /projects/$projectId/sessions/$sessionId navigation once the worker POST succeeds.

The important user-facing behavior is: after Start task succeeds, the created worker should be the visible session without requiring a second sidebar click.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontendElectron frontend laneneeds-triageMaintainer needs to evaluate this issuepriority: mediumFix when convenient

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions