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: 7 additions & 1 deletion src/fleet/relay-fleet-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,15 @@ describe('RelayFleetClient', () => {
const messaging = new FakeMessaging()
const fleet = createClient(messaging)

await fleet.spawn({ name: 'ar-2-impl', capability: 'spawn:codex', node: 'mac-mini' })
await fleet.spawn({
name: 'ar-2-impl',
capability: 'spawn:codex',
node: 'mac-mini',
repo: 'AgentWorkforce/factory',
})

expect(messaging.placements[0]?.node).toBe('mac-mini')
expect(messaging.placements[0]?.repo).toBe('AgentWorkforce/factory')
})

it('maps resume onto a placement spawn with session_ref', async () => {
Expand Down
19 changes: 14 additions & 5 deletions src/orchestrator/factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4819,10 +4819,10 @@ describe('FactoryLoop', () => {
'ar-720-impl-relayfile',
'ar-720-review',
])
expect(fleet.spawns.map((spawn) => [spawn.name, spawn.cwd])).toEqual([
['ar-720-impl-cloud', '/work/cloud'],
['ar-720-impl-relayfile', '/work/relayfile'],
['ar-720-review', '/work/cloud'],
expect(fleet.spawns.map((spawn) => [spawn.name, spawn.repo, spawn.cwd])).toEqual([
['ar-720-impl-cloud', 'AgentWorkforce/cloud', '/work/cloud'],
['ar-720-impl-relayfile', 'AgentWorkforce/relayfile', '/work/relayfile'],
['ar-720-review', 'AgentWorkforce/cloud', '/work/cloud'],
])
expect(comments[0]).toContain('Implementers: ar-720-impl-cloud, ar-720-impl-relayfile')
})
Expand Down Expand Up @@ -5906,7 +5906,10 @@ describe('FactoryLoop', () => {

expect(fleet.resumes).toEqual([])
expect(fleet.spawns.map((spawn) => spawn.name)).toEqual(['ar-7-impl-pear', 'ar-7-review', 'ar-7-impl-pear'])
expect(fleet.spawns.at(-1)?.invocationId).toContain(':restart:')
expect(fleet.spawns.at(-1)).toMatchObject({
repo: 'AgentWorkforce/pear',
invocationId: expect.stringContaining(':restart:'),
})
})

it('emits an escalation on delivery_failed for an in-flight agent', async () => {
Expand Down Expand Up @@ -6111,6 +6114,11 @@ describe('FactoryLoop', () => {
await expect(factory.dispatch(decision)).rejects.toThrow(
'Dispatch spawn failed for AR-36/ar-36-impl-pear (spawn:codex) cwd=/work/pear: spawnPty failed',
)
expect(fleet.spawns[0]).toMatchObject({
name: 'ar-36-impl-pear',
repo: 'AgentWorkforce/pear',
})
expect(fleet.spawns).toHaveLength(1)
expect(errors).toHaveLength(1)
expect(JSON.parse(JSON.stringify(errors[0]))).toMatchObject({
issue: { key: 'AR-36' },
Expand Down Expand Up @@ -9143,6 +9151,7 @@ describe('FactoryLoop', () => {
expect(fleet.resumes).toEqual([])
expect(fleet.spawns).toHaveLength(4)
for (const spawn of fleet.spawns.slice(2)) {
expect(spawn.repo).toBe('AgentWorkforce/pear')
expect(spawn.task).toContain('Factory released this team while waiting for human input')
expect(spawn.task).toContain('Which retry helper should I use?')
expect(spawn.task).toContain('Use retryOnTimeout from factory.ts.')
Expand Down
2 changes: 2 additions & 0 deletions src/orchestrator/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2543,6 +2543,7 @@ export class FactoryLoop implements Factory {
name: spec.name,
capability: spec.capability,
node: spec.node ?? 'self',
repo: spec.repo,
task: spec.task,
workflow: spec.workflow,
inputs: spec.inputs,
Expand Down Expand Up @@ -2722,6 +2723,7 @@ export class FactoryLoop implements Factory {
name: tracked.spec.name,
capability: tracked.spec.capability,
node: tracked.spec.node ?? 'self',
repo: tracked.spec.repo,
task: tracked.spec.task,
model: tracked.spec.model,
cwd: tracked.spec.clonePath,
Expand Down