Skip to content

restructure ux rendering flow and ui bugs for single agent harness#1648

Merged
Douglasymlai merged 3 commits into
feat/single-agent-harnessfrom
feat/singl-agent-harness-ux-fix
May 20, 2026
Merged

restructure ux rendering flow and ui bugs for single agent harness#1648
Douglasymlai merged 3 commits into
feat/single-agent-harnessfrom
feat/singl-agent-harness-ux-fix

Conversation

@Douglasymlai
Copy link
Copy Markdown
Contributor

@Douglasymlai Douglasymlai commented May 20, 2026

Related Issue

Description

Adds CAMEL-based single-agent mode and fixes the session/chat UX so single-agent runs behave correctly end-to-end (no workforce-only planning UI, no mode flicker on load).

Backend

  • Introduces single_agent_service, factory, toolkits (observable_todo, depth_limited_agent), agent memory, and chat routing so tasks can run as a single CAMEL agent instead of a workforce.

Frontend — session mode

  • Adds inferSessionModeFromTask() with a null fallback while a saved session is still loading, so the UI does not flash workforce → single-agent.
  • Defaults new projects to Single Agent (pageTabStore v1 migration clears legacy persisted workforce default).
  • Hides the session side panel until mode is known on an existing session; workspace/chat input still resolve to a concrete mode for starting tasks.
  • Skips pre-setting sessionMode on replay/share playback; mode is inferred from streamed events.

Frontend — single-agent chat flow

  • Single-agent tasks skip planning/splitting/confirm phases (UserQueryGroup, taskLifecycleUi, sessionNavLead).
  • Shows the work-log area and “Preparing to execute” during PENDING (before first todo_state), matching direct-run behavior.
  • Starts the work-log timer on first todo_state (no confirm step).
  • Renames display label Single Agent → CAMEL Agent across chat store and types.

Frontend — work log & polish

  • TaskWorkLogAccordion: singular “Preparing agent” label, unified running header shimmer, capitalized narration.
  • Sidebar icons for single-agent follow task status (no HITL/hand-from-waiting subtasks).
  • Unit test for single-agent preparation block label.

Testing Evidence (REQUIRED)

Screenshot 2026-05-20 at 17 55 50

Automated

# Backend
cd backend && pytest tests/app/agent/toolkit/test_observable_todo_toolkit.py tests/app/agent/toolkit/test_depth_limited_agent_toolkit.py tests/app/utils/test_agent_memory.py -q

# Frontend
npm run test -- test/unit/components/TaskWorkLogAccordion.test.tsx

Manual (attach screenshots/screen recording to this PR)

  • New task — Single Agent (default): From Workspace, start a task in Single Agent mode → no plan/split card; “Preparing to execute” then work log appear while status is still pending; side panel shows Single Agent view.

  • New task — Workforce: Toggle to Workforce → plan/split/confirm flow unchanged.

  • Reload saved single-agent session: Open an existing single-agent chat → side panel does not flash workforce UI before settling on Single Agent.

  • Reload saved workforce session: Open workforce session → workforce side panel and splitting/HITL icons behave as before.

  • Replay/share: Play back a saved session → session mode and side panel match playback events (no wrong-mode flash at start).

  • Work log: Running step shows full header shimmer; prep block reads “Preparing agent” in single-agent mode.

  • I have included human-verified testing evidence in this PR.

  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).

  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

@Douglasymlai Douglasymlai merged commit 597ee1a into feat/single-agent-harness May 20, 2026
@4pmtong 4pmtong added this to the Sprint 23 milestone May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants