fix: auto-delegation to the crew + crew-chat visibility #110

Merged
rawan merged 3 commits from int_delegate_crew into integration 2026-06-11 12:53:29 +00:00
Member

Summary

Fixes the "no auto delegation to the crew" investigation in #99. Two root causes were found and fixed:

  1. The orchestrator never knew the installed crew existed. The base prompt told it to consult agent.list (a server JSON-RPC method, not an LLM tool) and no context provider injected the roster, so the model assumed "no crew installed" and did everything itself.
  2. Even when it did delegate, delegate_task spawns an in-process sub-agent that never writes to the durable agent_messages mailbox, so delegated work never appeared in the per-member crew-chat threads.

Changes

  • Inject an [installed crew] roster into the chat-path system prompt (new CrewRosterProvider) listing each registered member by name and role, so the model delegates to them by name via delegate_task { agent: "<name>" }.
  • Inject the same roster into the autonomy executor prompt so multi-step autonomy runs also delegate to the crew.
  • Rewrite the misleading delegation guidance in agent_minimal_base.md (drop the dead agent.list reference; key off the injected roster).
  • Bridge delegate_task / delegate_parallel into the crew mailbox: when a delegation resolves to a registered crew member (by explicit name, or by mapping a specialist profile to the member of that role), mirror the task and its result into that member's crew-chat thread.

Tests

  • Unit tests for the roster body gating/wording.
  • Integration test proving a mirrored task + reply land in the member's thread via the same query the crew UI uses.
  • Full engine lib suite green.

Related to #99

#99

## Summary Fixes the "no auto delegation to the crew" investigation in #99. Two root causes were found and fixed: 1. The orchestrator never knew the installed crew existed. The base prompt told it to consult `agent.list` (a server JSON-RPC method, not an LLM tool) and no context provider injected the roster, so the model assumed "no crew installed" and did everything itself. 2. Even when it did delegate, `delegate_task` spawns an in-process sub-agent that never writes to the durable `agent_messages` mailbox, so delegated work never appeared in the per-member crew-chat threads. ## Changes - Inject an `[installed crew]` roster into the chat-path system prompt (new `CrewRosterProvider`) listing each registered member by name and role, so the model delegates to them by name via `delegate_task { agent: "<name>" }`. - Inject the same roster into the autonomy executor prompt so multi-step autonomy runs also delegate to the crew. - Rewrite the misleading delegation guidance in `agent_minimal_base.md` (drop the dead `agent.list` reference; key off the injected roster). - Bridge `delegate_task` / `delegate_parallel` into the crew mailbox: when a delegation resolves to a registered crew member (by explicit name, or by mapping a specialist profile to the member of that role), mirror the task and its result into that member's crew-chat thread. ## Tests - Unit tests for the roster body gating/wording. - Integration test proving a mirrored task + reply land in the member's thread via the same query the crew UI uses. - Full engine lib suite green. Related to #99 https://forge.ourworld.tf/lhumina_code/hero_shrimp/issues/99
fix: No crew agents are installed issue
Some checks are pending
Verify / verify (push) Waiting to run
Verify / verify (pull_request) Waiting to run
4e1787f7f5
fix: formatting
All checks were successful
Verify / verify (push) Successful in 10m45s
Verify / verify (pull_request) Successful in 29m23s
b49883a9e5
rawan merged commit ff37889875 into integration 2026-06-11 12:53:29 +00:00
rawan deleted branch int_delegate_crew 2026-06-11 12:53:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_shrimp!110
No description provided.