Skip to content

fix(wework): make task supervision lifecycle atomic - #2396

Merged
qdaxb merged 2 commits into
mainfrom
agent/supervisor-lifecycle-ui
Aug 3, 2026
Merged

fix(wework): make task supervision lifecycle atomic#2396
qdaxb merged 2 commits into
mainfrom
agent/supervisor-lifecycle-ui

Conversation

@qdaxb

@qdaxb qdaxb commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Persist pre-task supervision atomically as part of runtime task creation.
  • Delay supervisor evaluation until the runtime session is ready instead of reporting an initialization race as an error.
  • Move the pending supervision state out of the composer toolbar into a neutral task-context notice above the editor.
  • Keep the + menu as the configuration entry point and show active supervision in the right-side information panel.
  • Add Chinese and English architecture documentation for the lifecycle contract.

Root cause

The pre-task UI previously called supervisor setup before the runtime task address and Codex session existed. That produced invalid thread_id=none / session_id=none state, and the later task upsert could overwrite the configuration. The first message path also failed to forward the initial supervisor configuration into runtime task creation.

Validation

  • Wework Vitest: 267 files, 2,645 tests passed.
  • Wework TypeScript, ESLint, Prettier, typography checks passed.
  • Executor cargo fmt, cargo test, and cargo clippy passed.
  • Real desktop E2E supervisor-lifecycle passed twice, including pending-state assertion and post-create state removal.
  • Visual evidence: wework/test-results/desktop-e2e/2026-08-03T16-56-39-372Z-75116/supervisor-pending-context.png.

Summary by CodeRabbit

  • New Features

    • Configure task supervision before starting a conversation.
    • View pending, active, and configured supervision states in the composer and workspace details.
    • Open supervision settings in a dedicated dialog, edit configurations, and disable supervision.
    • Preserve pending settings until task creation and apply them automatically.
    • Added localized English and Simplified Chinese labels.
  • Documentation

    • Documented supervision setup and runtime readiness behavior.
  • Tests

    • Expanded coverage for configuration, pending states, task creation, and end-to-end supervision flows.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@qdaxb, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 12 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 16b0488d-221e-4b99-bd15-f7db2158b8be

📥 Commits

Reviewing files that changed from the base of the PR and between 6198e7a and 085b081.

📒 Files selected for processing (24)
  • docs/en/wegent/developer-guide/architecture.md
  • docs/zh/wegent/developer-guide/architecture.md
  • executor/src/runtime_work/handler/supervisor.rs
  • executor/src/runtime_work/handler/tasks.rs
  • executor/src/runtime_work/handler/tests.rs
  • wework/e2e/desktop/task-flow.e2e.mjs
  • wework/src/components/chat/ChatInput.test.tsx
  • wework/src/components/chat/ChatInput.tsx
  • wework/src/components/chat/composer/AddContextMenu.test.tsx
  • wework/src/components/chat/composer/AddContextMenu.tsx
  • wework/src/components/chat/composer/ComposerToolbar.tsx
  • wework/src/components/chat/composer/ProjectChatComposer.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/layout/EnvironmentInfoPopover.test.tsx
  • wework/src/components/layout/EnvironmentInfoPopover.tsx
  • wework/src/components/layout/TaskSupervisorControl.test.tsx
  • wework/src/components/layout/TaskSupervisorControl.tsx
  • wework/src/components/layout/useWorkbenchPaneSession.ts
  • wework/src/components/layout/workspace-panels/WorkspacePanelActions.tsx
  • wework/src/features/workbench/useWorkbenchRuntimeMessaging.ts
  • wework/src/features/workbench/workbenchContextTypes.ts
  • wework/src/i18n/locales/en/common.json
  • wework/src/i18n/locales/zh-CN/common.json
  • wework/src/types/api.ts
📝 Walkthrough

Walkthrough

The change adds pre-creation supervisor configuration. The executor persists initial settings during task creation and waits for runtime session readiness before evaluation. The desktop UI adds controlled configuration dialogs, pending indicators, runtime status displays, forwarding logic, tests, localization, and documentation.

Changes

Supervisor lifecycle

Layer / File(s) Summary
Runtime supervisor initialization
wework/src/types/api.ts, executor/src/runtime_work/handler/*
Task creation accepts initialSupervisor. The executor validates and persists the configuration, preserves applicable existing state, and requires a runtime session before scheduling evaluation.
Controlled supervisor dialog and status
wework/src/components/layout/TaskSupervisorControl.tsx, wework/src/components/layout/TaskSupervisorControl.test.tsx
Supervisor configuration now uses controlled portal-rendered dialogs. Status rendering uses TaskSupervisorStatusButton, with initial configuration restoration and dialog accessibility coverage.
Composer and workspace supervisor controls
wework/src/components/chat/*, wework/src/components/layout/EnvironmentInfoPopover.tsx, wework/src/components/layout/workspace-panels/*, wework/src/i18n/locales/*
Composer menus, pending indicators, workspace panels, and localized labels expose supervisor configuration and state.
Task creation and runtime readiness
wework/src/components/layout/DesktopWorkbenchMain.tsx, wework/src/components/layout/useWorkbenchPaneSession.ts, wework/src/features/workbench/*, wework/e2e/desktop/task-flow.e2e.mjs, docs/*/wegent/developer-guide/architecture.md
New-task configuration flows through runtime task creation and clears after task readiness. Existing tasks configure directly. Tests and architecture documentation cover the lifecycle.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • wecode-ai/Wegent#2392: Introduced the related supervisor functionality and shared handler, UI, E2E, and API areas.
  • wecode-ai/Wegent#2044: Shares supervisor configuration changes across the desktop workbench and runtime task creation flow.
  • wecode-ai/Wegent#2211: Shares runtime task state and supervisor lifecycle integration points.

Suggested reviewers: micro66

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant DesktopWorkbenchMain
  participant ProjectChatComposer
  participant RuntimeMessaging
  participant Executor
  participant RuntimeSession

  User->>ProjectChatComposer: Configure supervisor
  ProjectChatComposer->>DesktopWorkbenchMain: Invoke configuration callback
  User->>ProjectChatComposer: Submit first task message
  ProjectChatComposer->>RuntimeMessaging: Send initialSupervisor
  RuntimeMessaging->>Executor: Create task with supervisor settings
  Executor->>RuntimeSession: Establish runtime session
  RuntimeSession-->>DesktopWorkbenchMain: Return task readiness
  DesktopWorkbenchMain->>ProjectChatComposer: Clear pending indicator
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: making the task supervision lifecycle atomic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 3
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch agent/supervisor-lifecycle-ui
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/supervisor-lifecycle-ui

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qdaxb
qdaxb force-pushed the agent/supervisor-lifecycle-ui branch from 6198e7a to 02e2010 Compare August 3, 2026 17:13

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
wework/src/components/layout/TaskSupervisorControl.test.tsx (1)

74-99: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a test for clicking disable when only initialConfig is set.

This test confirms the disable button renders when only initialConfig is present (Line 98), but no test clicks it and asserts onClear is called. Add a fireEvent.click on task-supervisor-disable-button and assert onClear is invoked, to cover the new pre-task disable path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/layout/TaskSupervisorControl.test.tsx` around lines 74
- 99, Extend the test “reopens supervision configured before the task starts” to
click task-supervisor-disable-button and assert that the onClear mock is called,
covering the pre-task disable behavior when only initialConfig is provided.
wework/src/i18n/locales/zh-CN/common.json (1)

158-163: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Align supervisor_title wording across locales.

The English supervisor_title stays "Personal supervisor," but this Chinese update simplifies it to "监督" ("Supervision"), dropping the "personal" nuance present in English. Both strings render from the same UI element (TaskSupervisorControl.tsx's dialog heading), so the two locales now convey different meanings. Align the wording in one of the two files.

As per path instructions: "Add new user-facing copy to the appropriate Wework namespace in both src/i18n/locales/en/ and src/i18n/locales/zh-CN/."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/i18n/locales/zh-CN/common.json` around lines 158 - 163, Update the
zh-CN supervisor_title translation in the common locale to preserve the
“personal supervisor” meaning conveyed by the English supervisor_title, while
leaving the other supervisor translations unchanged.

Source: Path instructions

wework/src/components/layout/TaskSupervisorControl.tsx (1)

122-345: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Split TaskSupervisorDialogContent into smaller pieces.

TaskSupervisorDialogContent spans roughly 220 lines and mixes form state, escape-key handling, save/disable async logic, and the full dialog markup (header, status message, mode selector, model/frequency selectors, instructions textarea, footer). Extract the header, status message, and form fields into smaller sub-components to keep the function focused.

As per coding guidelines: "functions should remain focused, preferably under 50 lines."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/layout/TaskSupervisorControl.tsx` around lines 122 -
345, Refactor TaskSupervisorDialogContent into focused sub-components,
extracting the dialog header, supervisor status message, and form fields/footer
markup while keeping state, escape-key handling, save, and disable orchestration
in the parent. Preserve all existing props, translations, test IDs,
accessibility attributes, and behavior; keep each component focused and
preferably under 50 lines.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wework/src/components/chat/composer/AddContextMenu.tsx`:
- Around line 158-178: Update the supervisor menu button in AddContextMenu,
identified by data-testid="task-supervisor-toggle-button", to receive
disabled={disabled} so it cannot invoke handleConfigureSupervisor when the
composer becomes disabled. Add a rerender test covering the transition from
enabled to disabled while the menu is open, verifying the action is disabled.

In `@wework/src/components/layout/DesktopWorkbenchMain.tsx`:
- Around line 579-588: Update the supervisorFeatureAvailable logic near
currentRuntimeTaskSupportsSupervisor to derive the selected model’s runtime
using inferRuntimeName(selectedModel), and require that runtime to be Codex when
no currentRuntimeTask exists. Preserve the existing current-task runtime check
and other feature/service guards.
- Around line 629-690: Guard supervisor updates in setTaskSupervisor and
clearTaskSupervisor until sendPreparedRuntimeMessage has confirmed runtime task
creation, not merely when currentRuntimeTask is populated by the optimistic
view. Disable or defer both callbacks while
executorClient.runtime.createRuntimeTask is pending, then use the confirmed task
address for supervisor endpoint calls and preserve pending configuration until
creation succeeds.

---

Nitpick comments:
In `@wework/src/components/layout/TaskSupervisorControl.test.tsx`:
- Around line 74-99: Extend the test “reopens supervision configured before the
task starts” to click task-supervisor-disable-button and assert that the onClear
mock is called, covering the pre-task disable behavior when only initialConfig
is provided.

In `@wework/src/components/layout/TaskSupervisorControl.tsx`:
- Around line 122-345: Refactor TaskSupervisorDialogContent into focused
sub-components, extracting the dialog header, supervisor status message, and
form fields/footer markup while keeping state, escape-key handling, save, and
disable orchestration in the parent. Preserve all existing props, translations,
test IDs, accessibility attributes, and behavior; keep each component focused
and preferably under 50 lines.

In `@wework/src/i18n/locales/zh-CN/common.json`:
- Around line 158-163: Update the zh-CN supervisor_title translation in the
common locale to preserve the “personal supervisor” meaning conveyed by the
English supervisor_title, while leaving the other supervisor translations
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 740aa892-ead1-4ca9-9e75-dd851cfdf96f

📥 Commits

Reviewing files that changed from the base of the PR and between 205665d and 6198e7a.

📒 Files selected for processing (24)
  • docs/en/wegent/developer-guide/architecture.md
  • docs/zh/wegent/developer-guide/architecture.md
  • executor/src/runtime_work/handler/supervisor.rs
  • executor/src/runtime_work/handler/tasks.rs
  • executor/src/runtime_work/handler/tests.rs
  • wework/e2e/desktop/task-flow.e2e.mjs
  • wework/src/components/chat/ChatInput.test.tsx
  • wework/src/components/chat/ChatInput.tsx
  • wework/src/components/chat/composer/AddContextMenu.test.tsx
  • wework/src/components/chat/composer/AddContextMenu.tsx
  • wework/src/components/chat/composer/ComposerToolbar.tsx
  • wework/src/components/chat/composer/ProjectChatComposer.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/layout/EnvironmentInfoPopover.test.tsx
  • wework/src/components/layout/EnvironmentInfoPopover.tsx
  • wework/src/components/layout/TaskSupervisorControl.test.tsx
  • wework/src/components/layout/TaskSupervisorControl.tsx
  • wework/src/components/layout/useWorkbenchPaneSession.ts
  • wework/src/components/layout/workspace-panels/WorkspacePanelActions.tsx
  • wework/src/features/workbench/useWorkbenchRuntimeMessaging.ts
  • wework/src/features/workbench/workbenchContextTypes.ts
  • wework/src/i18n/locales/en/common.json
  • wework/src/i18n/locales/zh-CN/common.json
  • wework/src/types/api.ts

Comment on lines +158 to +178
{onConfigureSupervisor && (
<button
type="button"
role="menuitem"
data-testid="task-supervisor-toggle-button"
onClick={handleConfigureSupervisor}
className="flex h-9 w-full items-center gap-2.5 rounded-lg px-3 text-left text-base font-normal leading-[18px] text-text-primary hover:bg-muted"
>
<Eye className="h-[18px] w-[18px] shrink-0 text-text-secondary" />
<span className="min-w-0 truncate">
<span>{t('workbench.supervisor_title')}</span>
<span className="ml-2 text-text-muted">
{supervisorPending
? t('workbench.supervisor_pending_menu')
: supervisorEnabled
? t('workbench.supervisor_configure')
: t('workbench.supervisor_enable')}
</span>
</span>
</button>
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Disable the supervisor menu action when the composer is disabled.

If the menu opens before disabled changes to true, this action remains enabled and can call onConfigureSupervisor. The pending indicator in ProjectChatComposer disables the same action. Pass disabled={disabled} here. Add a rerender test for this state transition.

Proposed fix
 <button
   type="button"
   role="menuitem"
   data-testid="task-supervisor-toggle-button"
+  disabled={disabled}
   onClick={handleConfigureSupervisor}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{onConfigureSupervisor && (
<button
type="button"
role="menuitem"
data-testid="task-supervisor-toggle-button"
onClick={handleConfigureSupervisor}
className="flex h-9 w-full items-center gap-2.5 rounded-lg px-3 text-left text-base font-normal leading-[18px] text-text-primary hover:bg-muted"
>
<Eye className="h-[18px] w-[18px] shrink-0 text-text-secondary" />
<span className="min-w-0 truncate">
<span>{t('workbench.supervisor_title')}</span>
<span className="ml-2 text-text-muted">
{supervisorPending
? t('workbench.supervisor_pending_menu')
: supervisorEnabled
? t('workbench.supervisor_configure')
: t('workbench.supervisor_enable')}
</span>
</span>
</button>
)}
{onConfigureSupervisor && (
<button
type="button"
role="menuitem"
data-testid="task-supervisor-toggle-button"
disabled={disabled}
onClick={handleConfigureSupervisor}
className="flex h-9 w-full items-center gap-2.5 rounded-lg px-3 text-left text-base font-normal leading-[18px] text-text-primary hover:bg-muted"
>
<Eye className="h-[18px] w-[18px] shrink-0 text-text-secondary" />
<span className="min-w-0 truncate">
<span>{t('workbench.supervisor_title')}</span>
<span className="ml-2 text-text-muted">
{supervisorPending
? t('workbench.supervisor_pending_menu')
: supervisorEnabled
? t('workbench.supervisor_configure')
: t('workbench.supervisor_enable')}
</span>
</span>
</button>
)}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/chat/composer/AddContextMenu.tsx` around lines 158 -
178, Update the supervisor menu button in AddContextMenu, identified by
data-testid="task-supervisor-toggle-button", to receive disabled={disabled} so
it cannot invoke handleConfigureSupervisor when the composer becomes disabled.
Add a rerender test covering the transition from enabled to disabled while the
menu is open, verifying the action is disabled.

Comment on lines 579 to +588
const currentRuntimeTaskSupportsSupervisor =
runtimeTaskSummary?.runtime?.toLowerCase() === 'codex'
const supervisorFeatureAvailable = Boolean(
experimentalFeaturesEnabled &&
services?.runtimeWorkApi &&
(!currentRuntimeTask || currentRuntimeTaskSupportsSupervisor)
)
const supervisorModels = projectChat.models.filter(
model => model.isActive !== false && !model.compatibilityDisabled
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check whether initialSupervisor handling or supervisor availability
# is restricted to Codex runtime for newly created tasks.
rg -n -C5 "initialSupervisor" wework/src/features/workbench/useWorkbenchRuntimeMessaging.ts
rg -n -C5 "runtime.*codex|inferRuntimeName" wework/src/features/workbench/useWorkbenchRuntimeMessaging.ts

Repository: wecode-ai/Wegent

Length of output: 3309


🏁 Script executed:

#!/bin/bash
# Inspect current-task derivation, supervisor gating, model runtime inference, and initialSupervisor send path.
sed -n '530,615p' wework/src/components/layout/DesktopWorkbenchMain.tsx
printf '\n--- runtimeModelSelection ---\n'
sed -n '1,200p' wework/src/features/workbench/runtimeModelSelection.ts
printf '\n--- createRuntime flow ---\n'
sed -n '480,690p' wework/src/features/workbench/useWorkbenchRuntimeMessaging.ts
printf '\n--- sendPreparedRuntimeMessage / RuntimeTaskCreateRequest consumers ---\n'
sed -n '960,1195p' wework/src/features/workbench/useWorkbenchRuntimeMessaging.ts
rg -n -C4 "RuntimeTaskCreateRequest|initialSupervisor|collaborationMode|currentRuntimeTask|runWithRuntime" wework/src/features/workbench wework/src/components/layout/DesktopWorkbenchMain.tsx

Repository: wecode-ai/Wegent

Length of output: 50373


🌐 Web query:

Wegot wecode wegent supervisor initialSupervisor runtime codex create_task

💡 Result:

The terms you provided relate to different systems for AI agent orchestration and task management. There is no single integrated framework containing all these specific identifiers together, but they appear in the following distinct technical contexts: Wegent (often associated with the organization WeCode-AI) is an open-source, AI-native platform designed for defining, organizing, and running agent teams [1][2]. It uses a modular architecture with an Executor Manager to handle agent task execution [1][3]. The command create_task and the concept of a supervisor or task manager are central features across several MCP (Model Context Protocol) servers and agent-orchestration tools: 1. MCP-Codex-Teams and TaskFlow: These tools provide functions like create_task, create_team, and various status management commands to orchestrate multi-agent coding workflows [4][5]. 2. MCP-Task-Manager: This library provides specific tools for task management (create_task, update_task) within AI-driven coding environments [6]. 3. CostMarshal: This system uses a scheduler that supports commands such as create_task and dispatch_task to manage bounded, AI-driven coding tasks [7]. The term initialSupervisor (or initial supervisor) is generally not a standard programming API keyword in these frameworks but appears in academic, clinical, or industrial regulatory documentation (such as training manuals or compliance checklists) to describe professional reporting structures or initial training levels [8][9][10][11]. If you are working with a specific codebase or implementation that links these terms (such as a custom project utilizing Wegent alongside an MCP task manager), it is likely a bespoke integration using standard task-management patterns (create_task) and custom supervisory logic.

Citations:


🏁 Script executed:

#!/bin/bash
# Locate all code paths that read or validate initialSupervisor.
rg -n -C3 "initialSupervisor" . --glob '!**/node_modules/**' --glob '!**/.git/**'

Repository: wecode-ai/Wegent

Length of output: 11865


🏁 Script executed:

#!/bin/bash
# Inspect executor-side supervisor configuration and nearby runtime validation.
sed -n '120,225p' executor/src/runtime_work/handler/tasks.rs
rg -n -C5 "configured_supervisor|runtime|runtime_session|codex|claude_code" executor/src/runtime_work executor/src/runtime executor/src -g '*.rs' | head -n 200

Repository: wecode-ai/Wegent

Length of output: 19936


Gate new-task supervisors by the selected model runtime.

For a new task, sendPreparedRuntimeMessage derives the task runtime from the selected model with inferRuntimeName(selectedModel), but supervisorFeatureAvailable still enables supervisor configuration whenever !currentRuntimeTask. If a non-Codex model is selected, RuntimeTaskCreateRequest.runtime becomes claude_code while initialSupervisor is still sent. Restrict the new-task branch to selected models that route to Codex runtime before exposing supervisor configuration.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/layout/DesktopWorkbenchMain.tsx` around lines 579 -
588, Update the supervisorFeatureAvailable logic near
currentRuntimeTaskSupportsSupervisor to derive the selected model’s runtime
using inferRuntimeName(selectedModel), and require that runtime to be Codex when
no currentRuntimeTask exists. Preserve the existing current-task runtime check
and other feature/service guards.

Comment thread wework/src/components/layout/DesktopWorkbenchMain.tsx
@qdaxb
qdaxb force-pushed the agent/supervisor-lifecycle-ui branch from 02e2010 to 085b081 Compare August 3, 2026 17:30
@qdaxb
qdaxb added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit f24e87a Aug 3, 2026
47 checks passed
@qdaxb
qdaxb deleted the agent/supervisor-lifecycle-ui branch August 3, 2026 18:00
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.

1 participant