feat: add agentic video analysis and clarify action results
Report device actions as dispatched and preserve full failure details. Route Flash through McpActionExecutor and use ToolFailure across helper tools and agent loops instead of inferring failure from response text. Require model-provided descriptions for coordinate targets. Keep observed element metadata separate from those descriptions in safety checks, visual summaries, history, and frontend labels. Add Gemini Interactions API video analysis with configurable processing mode, chunk size, and timeouts. Centralize Google provider capabilities and token usage normalization, and update google-genai to 2.22.0. Preserve system instructions on follow-up interactions, replan pending chunks when falling back to static processing, and reject unanswered native video and audio segments instead of caching placeholder results. Keep helper-tool failure status intact through history tools and committee calls. Validation: 1,762 Python unit tests passed (3 skipped), 40 frontend formatter tests passed, and the production UI build completed. Ruff lint, formatting, the quality ratchet, and git diff checks passed.
This commit is contained in:
1 parent
611d1a0947
commit
a45daf23f8
120 files changed
+6301
-1710
No files matched your search
@@ -911,6 +911,19 @@ export function getToolTitle(tool: any): string {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Join per-point self-described targets (click_sequence `target_descriptions`)
|
||||
* into one label, chained with ' → ' like the coordinate rendering.
|
||||
* Returns '' when the value is missing or holds no usable text.
|
||||
*/
|
||||
export function joinTargetDescriptions(descriptions: any): string {
|
||||
if (!Array.isArray(descriptions)) return '';
|
||||
const parts = descriptions
|
||||
.map(d => (d === null || d === undefined) ? '' : String(d).trim())
|
||||
.filter(d => d.length > 0);
|
||||
return parts.join(' → ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get target text description for tools
|
||||
*/
|
||||
@@ -950,6 +963,11 @@ export function getToolTargetText(tool: any): string {
|
||||
if (name === 'report_failure_analysis') {
|
||||
return args.status || args.reason || args.analysis || '';
|
||||
}
|
||||
if (name === 'click_sequence' || name === 'tap_sequence') {
|
||||
// One self-described target per point, chained like getToolCoords does.
|
||||
const joined = joinTargetDescriptions(args.target_descriptions);
|
||||
if (joined) return joined;
|
||||
}
|
||||
if (args.target && typeof args.target === 'string') {
|
||||
return args.target;
|
||||
}
|
||||
@@ -959,7 +977,7 @@ export function getToolTargetText(tool: any): string {
|
||||
if (args.index !== undefined) {
|
||||
return `Element #${args.index}`;
|
||||
}
|
||||
return args.target_text || args.target_class || args.element || args.element_text || (name !== 'input_text' ? args.text : '') || '';
|
||||
return args.target_text || args.target_description || args.target_class || args.element || args.element_text || (name !== 'input_text' ? args.text : '') || '';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1162,7 +1180,8 @@ export function extractToolExtraParams(toolData: any, cache?: WeakMap<any, Actio
|
||||
}
|
||||
|
||||
const standardKeys = new Set([
|
||||
'action', 'name', 'type', 'target_text', 'text', 'input_text', 'target',
|
||||
'action', 'name', 'type', 'target_text', 'target_description', 'target_descriptions',
|
||||
'text', 'input_text', 'target',
|
||||
'coordinates', 'coords', 'target_bounds', 'bounds', 'target_resource_id',
|
||||
'resource_id', 'target_class', 'class_name', 'normalized_coordinates',
|
||||
'pre_image_name', 'post_image_name', 'pre_screenshot', 'post_screenshot',
|
||||
|
||||
Reference in new issue
Block a user