Browse Source

refactor(agents): limit task rejection to role

Alvin Unreal 3 weeks ago
parent
commit
3e4726ef1b

+ 2 - 2
docs/background-orchestration.md

@@ -268,8 +268,8 @@ Include:
 
 ### Task-fit rejections
 
-If a task is outside a specialist's role, permissions, or available context, it
-must not attempt partial work. It returns a brief reason to the orchestrator.
+If a task is outside a specialist's role, it must not attempt partial work. It
+returns a brief reason to the orchestrator.
 The orchestrator treats that reason as routing input to reroute or clarify the
 task and must not retry the unchanged task with the same specialist.
 

+ 3 - 1
src/agents/task-rejection.test.ts

@@ -4,10 +4,12 @@ import { TASK_REJECTION_INSTRUCTION } from './task-rejection';
 describe('task rejection instruction', () => {
   test('requires a plain reason-only response', () => {
     expect(TASK_REJECTION_INSTRUCTION).toBe(
-      'If a task is outside your role, permissions, or available context, do not attempt partial work. Return a brief reason to the orchestrator.',
+      'If a task is outside your role, do not attempt partial work. Return a brief reason to the orchestrator.',
     );
     expect(TASK_REJECTION_INSTRUCTION).not.toMatch(
       /<|>|task_rejection|recommended[_ -]?agent/i,
     );
+    expect(TASK_REJECTION_INSTRUCTION).not.toContain('permissions');
+    expect(TASK_REJECTION_INSTRUCTION).not.toContain('available context');
   });
 });

+ 1 - 1
src/agents/task-rejection.ts

@@ -1,5 +1,5 @@
 export const TASK_REJECTION_INSTRUCTION =
-  'If a task is outside your role, permissions, or available context, do not attempt partial work. Return a brief reason to the orchestrator.';
+  'If a task is outside your role, do not attempt partial work. Return a brief reason to the orchestrator.';
 
 export function appendTaskRejectionInstruction(prompt: string): string {
   return `${prompt}\n\n${TASK_REJECTION_INSTRUCTION}`;