Skip to content

feat: hide worker threads from UI and disable spawn (#1624) - #1631

Merged
senamakel merged 3 commits into
tinyhumansai:mainfrom
senamakel:feat/hide-worker-threads
May 13, 2026
Merged

senamakel merged 3 commits into
tinyhumansai:mainfrom
senamakel:feat/hide-worker-threads

Conversation

@senamakel

@senamakel senamakel commented May 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Filter worker/subagent threads (any thread with parentThreadId) out of the main conversation list.
  • Stop the orchestrator from registering spawn_worker_thread and force spawn_subagent's dedicated_thread flag to false.
  • Stopgap until a proper worker-thread UI showcase lands — tracked in Showcase worker/subagent threads with a dedicated UI surface #1624.

Problem

When the orchestrator spawns a worker/subagent thread (via spawn_worker_thread or spawn_subagent { dedicated_thread: true }), the worker thread today shows up as a standalone entry in the user's conversation list with no coherent presentation — no clear title, no progress affordance, no done state, no link back to the parent. The inline WorkerThreadRefCard inside the parent thread is the only deliberate showcase; the standalone list entry is noise.

Solution

Three small changes, all pointing at #1624 for the eventual re-enable:

  • app/src/pages/Conversations.tsx: filteredThreads drops threads whose parentThreadId is set, so workers never appear in the sidebar.
  • src/openhuman/tools/orchestrator_tools.rs: the SpawnWorkerThreadTool::new() push is commented out, with an #[allow(unused_imports)] on the import so the orchestrator no longer advertises spawn_worker_thread to the model.
  • src/openhuman/tools/impl/agent/spawn_subagent.rs: the dedicated_thread extraction is commented out and hard-set to false, so even if the model requests a dedicated thread the runtime treats it as inline.

cargo check --manifest-path Cargo.toml passes cleanly (warnings are pre-existing).

Submission Checklist

  • N/A: behaviour-toggle only — registration & filter changes are guarded by existing tests for the non-worker path; adding tests for the disabled branch would just lock in the temporary stopgap.
  • N/A: changed lines are dead-code toggles (commented-out registration, forced false) and a one-line filter; not exercisable for meaningful coverage gain.
  • N/A: behaviour-only change — no new feature rows.
  • N/A: no new feature IDs affected.
  • No new external network dependencies introduced (mock backend used per Testing Strategy)
  • N/A: change is invisible to release-cut surfaces (no UI flows added, just a list filter; smoke checklist untouched).
  • Linked issue closed via Closes #NNN in the ## Related section

Impact

Desktop UI: worker threads no longer appear as standalone list entries. WorkerThreadRefCard inside parent threads continues to render. Backend: orchestrator no longer exposes spawn_worker_thread; spawn_subagent always runs inline. No migration. No perf or security implications.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: feat/hide-worker-threads
  • Commit SHA: ccc5887

Validation Run

  • N/A: pnpm --filter openhuman-app format:check — no JS/CSS format-sensitive lines changed (one-line filter addition with project-style indentation)
  • N/A: pnpm typecheck — single-property filter; types unchanged
  • N/A: focused tests — behaviour toggle only, see Submission Checklist
  • Rust fmt/check (if changed): cargo check --manifest-path Cargo.toml clean
  • N/A: Tauri fmt/check (if changed) — shell unchanged

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: worker/subagent threads no longer surface in the conversation list, and the orchestrator can no longer spawn dedicated worker threads.
  • User-visible effect: cleaner sidebar; no more orphan worker entries appearing alongside user-initiated conversations.

Parity Contract

  • Legacy behavior preserved: WorkerThreadRefCard inline rendering unchanged; spawn_subagent inline path unchanged; non-orchestrator agents unaffected.
  • Guard/fallback/dispatch parity checks: dedicated_thread arg still consumed (via args.get) so existing call sites don't error on unknown-arg validation; orchestrator import kept with #[allow(unused_imports)] to ease re-enable.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): N/A
  • Canonical PR: N/A
  • Resolution: N/A

Summary by CodeRabbit

  • Behavior Changes
    • Worker and subagent threads no longer appear in the main conversation list; only primary conversations are shown for a cleaner view.
    • Resuming a previously selected thread now respects visibility and falls back to the most recent visible conversation or creates a new one if none exist.
    • The option to spawn dedicated worker threads has been temporarily disabled; attempts to use it will return an error and should be retried without the flag.

Review Change Stack

Worker/subagent threads have no proper UI showcase yet — they spawn as
standalone conversation entries with no coherent presentation. Filter
them out of the conversation list and stop the orchestrator from
spawning them at all until a dedicated surface lands.

- app/src/pages/Conversations.tsx: drop threads with `parentThreadId`
  from `filteredThreads` so workers don't clutter the sidebar.
- src/openhuman/tools/orchestrator_tools.rs: comment out the
  `SpawnWorkerThreadTool` registration.
- src/openhuman/tools/impl/agent/spawn_subagent.rs: force
  `dedicated_thread = false` so `spawn_subagent` always runs inline.

Tracking re-enable + showcase in tinyhumansai#1624.
@senamakel
senamakel requested a review from a team May 13, 2026 11:35
@coderabbitai

coderabbitai Bot commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c807134-0e7c-480c-92e2-434f057aa1fc

📥 Commits

Reviewing files that changed from the base of the PR and between 72b8950 and 74a6353.

📒 Files selected for processing (1)
  • src/openhuman/tools/impl/agent/spawn_subagent.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/openhuman/tools/impl/agent/spawn_subagent.rs

📝 Walkthrough

Walkthrough

The PR disables the worker-thread feature across backend and UI: the orchestrator stops offering spawn_worker_thread, spawn_subagent rejects/ignores dedicated_thread requests, and the conversation list filters out threads with parentThreadId.

Changes

Worker Thread Feature Disable

Layer / File(s) Summary
Hide worker/subagent threads from conversation list
app/src/pages/Conversations.tsx
During mount-time loadThreads() resolution, visibleThreads excludes threads with parentThreadId; persisted selectedThreadId is only resumed if present in visibleThreads, otherwise the most-recent visible thread is chosen or a new thread is created. The rendered filteredThreads also excludes parentThreadId threads.
Disable worker-thread tool and execution
src/openhuman/tools/orchestrator_tools.rs, src/openhuman/tools/impl/agent/spawn_subagent.rs
The orchestrator no longer registers SpawnWorkerThreadTool (import and conditional push commented out) and spawn_subagent returns an error when args["dedicated_thread"] is true while forcing dedicated_thread to false for other paths; relevant unit tests were updated to remove spawn_worker_thread expectations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

  • tinyhumansai/openhuman#1221: This PR hides and disables the worker-thread feature (parentThreadId plumbing and spawn_worker_thread tool) that was added in #1221.
  • tinyhumansai/openhuman#1513: Both PRs modify Conversations.tsx’s mount-time loadThreads() handling; this change further narrows resumed selection to visible threads.
  • tinyhumansai/openhuman#1047: This PR changes the dedicated worker thread flow introduced earlier by disabling dedicated_thread spawning and hiding parent-thread UI paths.

Poem

A worker thread once dreamed to stay,
But now it fades from sight, away—
The UI hides its orphaned thread,
The spawner turns the flag to dead,
And orchestrators march ahead! 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: hide worker threads from UI and disable spawn (#1624)' accurately describes the main changes: hiding worker threads from the UI and disabling the spawn functionality, which aligns with the primary objectives of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@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

🤖 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 `@app/src/pages/Conversations.tsx`:
- Around line 941-949: The initial/resume selection logic currently picks from
data.threads and can choose hidden worker/subagent threads; update that code to
use the same top-level-thread filter as filteredThreads (i.e., exclude threads
with parentThreadId and respect selectedLabel) before deciding the initial or
resumed active thread. Concretely, replace usages of data.threads (or the
selector that picks the default thread) with the filteredThreads result (or
replicate the same filter logic: t => !t.parentThreadId && (selectedLabel ===
'all' || t.labels?.includes(selectedLabel))) so the active thread is always one
visible in the sidebar.

In `@src/openhuman/tools/impl/agent/spawn_subagent.rs`:
- Around line 169-177: The code currently ignores the caller's dedicated_thread
request by unconditionally setting dedicated_thread = false; instead read
args.get("dedicated_thread") and, when it is true, return an explicit outcome
(e.g., an Err or a specific RPC response) rather than silently falling back to
inline execution; also emit a debug/trace log on entry showing the requested
dedicated_thread value and a trace log when rejecting/handling a true request so
callers can see their intent was declined. Locate the handling around
args.get("dedicated_thread") and the dedicated_thread binding in
spawn_subagent.rs and replace the silent ignore with a logged decision +
explicit return/result indicating dedicated threads are not supported.

In `@src/openhuman/tools/orchestrator_tools.rs`:
- Around line 73-78: Tests currently still assert that spawn_worker_thread
(SpawnWorkerThreadTool / definition.id == "orchestrator") is registered, but
registration was commented out; update the unit tests to reflect the disabled
registration by removing or changing assertions that expect spawn_worker_thread
to be present and instead assert it is absent (or simply remove it from expected
tool lists), and update any helper/expected-tool-id arrays or assertions that
reference "spawn_worker_thread" or SpawnWorkerThreadTool so the test suite
matches the runtime behavior.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ce74ce55-ba74-4a41-ac8d-9a9400663271

📥 Commits

Reviewing files that changed from the base of the PR and between 57c6d1b and ccc5887.

📒 Files selected for processing (3)
  • app/src/pages/Conversations.tsx
  • src/openhuman/tools/impl/agent/spawn_subagent.rs
  • src/openhuman/tools/orchestrator_tools.rs

Comment thread app/src/pages/Conversations.tsx
Comment thread src/openhuman/tools/orchestrator_tools.rs
- Conversations.tsx: filter `parentThreadId` threads out of initial/resume
  selection too, so we can't auto-select a hidden worker thread on load.
- spawn_subagent: return an explicit `ToolResult::error` when
  `dedicated_thread: true` is requested instead of silently downgrading
  to inline, so callers get a clear signal that the flag is disabled.
- orchestrator_tools tests: drop `spawn_worker_thread` from expected
  tool-name vectors now that the registration is commented out.

@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: 1

🤖 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 `@src/openhuman/tools/impl/agent/spawn_subagent.rs`:
- Around line 169-187: The runtime now rejects dedicated worker threads in
spawn_subagent (see the dedicated_thread_requested check using
args.get("dedicated_thread") and the early return), so update the tool
schema/docs that still describe an enabled worker-thread path to reflect this
rejection: change the dedicated_thread parameter description to state that true
is temporarily unsupported and will be rejected (only false or omission is
allowed), update any examples and help text that claim a worker thread will be
spawned, and adjust schema validation/enum/comments to prohibit or warn about
true so the tool contract matches the spawn_subagent runtime behavior.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 44d96e80-c0a6-487d-b66a-4c489dd12bd4

📥 Commits

Reviewing files that changed from the base of the PR and between ccc5887 and 72b8950.

📒 Files selected for processing (3)
  • app/src/pages/Conversations.tsx
  • src/openhuman/tools/impl/agent/spawn_subagent.rs
  • src/openhuman/tools/orchestrator_tools.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/openhuman/tools/orchestrator_tools.rs

Comment thread src/openhuman/tools/impl/agent/spawn_subagent.rs
Schema description for `dedicated_thread` still advertised the
worker-thread path even though the runtime now rejects requests with
`dedicated_thread: true`. Update the description so the LLM-visible
contract matches actual behavior and avoids predictable failed calls.
@senamakel
senamakel merged commit c63871e into tinyhumansai:main May 13, 2026
21 checks passed
obchain added a commit to obchain/openhuman that referenced this pull request May 13, 2026
Resolves orchestrator_tools.rs conflict by keeping the collapsed
`delegate_to_integrations_agent` from this PR while picking up the
`spawn_worker_thread` disable note added upstream (tinyhumansai#1624 / tinyhumansai#1631).
AusAgentSmith pushed a commit to AusAgentSmith/openhuman that referenced this pull request May 23, 2026
senamakel added a commit to nocstah/openhuman that referenced this pull request Sep 11, 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.

1 participant