Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions agents/codelayer/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ export async function createCodelayerAgent(opts: CodelayerAgentOptions): Promise
tools: toolOpts,
systemPromptAdditions = [],
rlm = false,
rpi = false,
tars = false,
exaApiKey,
context7ApiKey,
Expand Down Expand Up @@ -428,7 +427,7 @@ export async function createCodelayerAgent(opts: CodelayerAgentOptions): Promise
includeEnvironment: environment?.include,
date: environment?.date,
platform: environment?.platform,
systemPromptAdditions: [ORCHESTRATOR_PROMPT, ...(rpi ? ['RPI specialist subagents are enabled. Prefer delegating specialized research and codebase analysis tasks to subagents when appropriate.'] : []), ...personaPromptAdditions],
systemPromptAdditions: [ORCHESTRATOR_PROMPT, ...personaPromptAdditions],
})
const aux = await createCodingAgentAuxToolset({
cwd,
Expand Down Expand Up @@ -505,10 +504,7 @@ export async function createCodelayerAgent(opts: CodelayerAgentOptions): Promise
includeEnvironment: environment?.include,
date: environment?.date,
platform: environment?.platform,
systemPromptAdditions: [
...(rpi ? ['RPI specialist subagents are enabled. Prefer delegating specialized research and codebase analysis tasks to subagents when appropriate.'] : []),
...personaPromptAdditions,
],
systemPromptAdditions: personaPromptAdditions,
})

return new Agent({
Expand Down
5 changes: 3 additions & 2 deletions agents/codelayer/test/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -865,14 +865,15 @@ describe('createCodelayerAgent', () => {
expect(system.some((entry) => entry.includes('You are TARS'))).toBe(true)
})

test('adds the rpi specialist guidance when requested', async () => {
test('does not add broad delegation guidance when rpi specialists are requested', async () => {
const agent = await createCodelayerAgent({
model: createMockModel('claude-sonnet-4-5'),
cwd: '/tmp',
rpi: true,
})
const system = getSystemEntries(agent)
expect(system.some((entry) => entry.includes('RPI specialist subagents are enabled'))).toBe(true)
expect(system.some((entry) => entry.includes('RPI specialist subagents are enabled'))).toBe(false)
expect(system.some((entry) => entry.includes('Prefer delegating specialized research'))).toBe(false)
})

test('allows environment prompt controls', async () => {
Expand Down
Loading