[minor/bug] init log chan before writing to it, otherwise the agent hangs