assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM tool_call WHERE task_id=? AND tool_name='vision' AND provider='DEEPSEEK'",Integer.class,id)).isEqualTo(1);
await().atMost(Duration.ofSeconds(5)).untilAsserted(()->assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM tool_call WHERE task_id=? AND tool_name='get_company_profile' AND status='STARTED'",Integer.class,id)).isEqualTo(1));
tasks.cancel(owner(),id);
await().atMost(Duration.ofSeconds(5)).untilAsserted(()->assertThat(jdbc.queryForObject("SELECT COUNT(*) FROM tool_call WHERE task_id=? AND tool_name='get_company_profile' AND status='SUCCEEDED'",Integer.class,id)).isEqualTo(1));
jdbc.update("UPDATE agent_task SET status='RUNNING' WHERE id=?",id);
jdbc.update("INSERT INTO tool_call(id,task_id,provider,tool_name,client_version,status) VALUES(?,?,'ZLBX','BID_SEARCH','zlbx-bidding/2.3.0','STARTED')",UUID.randomUUID().toString(),id);
jdbc.update("INSERT INTO company_profile(user_id,document,version,completed,updated_at) VALUES(?,?,9999,FALSE,CURRENT_TIMESTAMP)",owner(),json.write(temporary));