INNER CODE UNIT · TypeScript
startRun
Core-Mate/OpenGUI · deepseek-harness-plugin/src/index.ts:506
const startRun = async (executionSignal: AbortSignal): Promise<CoremateTaskResult> => {
const operation = async (target: FleetDevice, _index: number, childSignal: AbortSignal): Promise<{ target: FleetDevice, result: CoremateTaskResult }> => {
const child = await ctx.subagents.start('spawn', {
label: `Control ${target.label}`,
prompt: [{ type: 'text', text: `Target phone: ${target.label}\n\nTask: ${task}` }],
parent,
signal: childSignal,
agentOptions: context.route,
maxDepth: 2,
toolFilter: { allow: ['phone_control'] },
persona: `You control exactly one fixed Android phone, labeled ${target.label}. Never try to discover, switch, or act on another phone. Observe before the first change. For every mutation, echo the exact current observationId. Tap with a tight targetBBox and swipe with coordinates in current screenshot pixels. Perform exactly one action per phone_control call and inspect the returned observation. Use wait only when the UI is visibly loading; ordinary actions already auto-observe. Never reuse coordinates from an old observation. Stop and report any authorization, device, model, repeated-no-progress, operation-limit, or unsupported-action error.`,
})
if (child.localAgent === undefined) {
await child.dispose()
throw new Error('coremate-mobile: a phone task requires a local child agent')
}
lease.bindAgent(child.localAgent)
phoneController.assignTarget(child.localAgent, target.serial)