Skip to content

feat(delegation): persona kwarg for delegate_task - #50040

Draft
arminanton wants to merge 1 commit into
NousResearch:mainfrom
arminanton:feat/delegate-task-persona
Draft

feat(delegation): persona kwarg for delegate_task#50040
arminanton wants to merge 1 commit into
NousResearch:mainfrom
arminanton:feat/delegate-task-persona

Conversation

@arminanton

Copy link
Copy Markdown
Contributor

Adds a persona: str = "" kwarg to delegate_task. When non-empty, the persona body is prepended to the subagent's prompt with an explicit AUTHORITATIVE PERSONA — follow these rules over any default subagent guidance delimiter — a clean replacement for stuffing persona text into the goal/context. Scoped to the persona feature on tools/delegate_tool.py. Draft for review.

@alt-glitch alt-glitch added type/feature New feature or request comp/tools Tool registry, model_tools, toolsets tool/delegate Subagent delegation P3 Low — cosmetic, nice to have labels Jun 21, 2026
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
@arminanton
arminanton force-pushed the feat/delegate-task-persona branch from 25b495a to 35b947f Compare August 22, 2026 21:39
@arminanton

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and self-assessed against it (no prior review comments on this PR).

Against current main the persona kwarg was only partially wired — it would never have reached the model. Completed the wiring end-to-end:

  • _build_child_system_prompt prepends the persona ahead of the goal with an === AUTHORITATIVE PERSONA === delimiter;
  • threaded through _build_child_agentdelegate_task (single-task + per-task batch, per-task beats top-level);
  • added persona to DELEGATE_TASK_SCHEMA at both the top level and in tasks[].items (otherwise the model can't pass it);
  • wired both dispatch paths (run_agent._dispatch_delegate_task + the registry handler).

Added TestChildSystemPromptPersona (4 tests, anti-tautological — asserts the persona text materially precedes the goal in the constructed prompt, and persona=''/whitespace leaves the prompt byte-identical). tests/tools/test_delegate.py → 73 passed. Rebased clean onto current main.

Adds a persona kwarg to delegate_task, threaded through the model-facing
schema (top-level + per-task), delegate_task, _build_child_agent, and
_build_child_system_prompt. When non-empty, the persona body is prepended
to the child's system prompt with an AUTHORITATIVE PERSONA delimiter ahead
of the goal, a clean replacement for stuffing persona text into context.
Empty/omitted preserves today's prompt byte-for-byte. Also wired into both
model-facing dispatch paths (run_agent._dispatch_delegate_task and the
registry lambda). Adds 4 focused, anti-tautological tests.
@arminanton
arminanton force-pushed the feat/delegate-task-persona branch from 35b947f to 332f4af Compare August 23, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants