ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.
Python ai-agentsamdcomfyuidockerllama-cppllmlocal-ain8nnvidiaopen-webuiragself-hostedspeech-to-textstrix-halotext-to-speechworkflow-automation
fix(pixel): name the missing field when an inspection step leaves it out (#8270)
Mike Bradley78ed96b0c5bf
diff --git a/ods/extensions/services/pixel-agent/plugin/workspace-preview-inspect.mjs b/ods/extensions/services/pixel-agent/plugin/workspace-preview-inspect.mjsindex ce5a1d6ee..9dcd10341 100644--- a/ods/extensions/services/pixel-agent/plugin/workspace-preview-inspect.mjs+++ b/ods/extensions/services/pixel-agent/plugin/workspace-preview-inspect.mjs@@ -362,6 +362,9 @@ const INPUT_HINTS = new Map([['invalid preview inspection steps','Provide 1 to 12 supported steps per inspection.'],['unsupported inspection navigation','path is allowed only for a final download assertion. The inspector opens the published snapshot entry page and has no navigation or reload action. Verify supported in-page interactions and report cross-reload persistence as unverified; do not simulate a reload or use sibling test pages as persistence evidence.'],['invalid inspection step','Each step needs action and locator; assert-text additionally requires expectedText (normalized visible text, 1 to 256 characters); select-option or fill requires value (exact option value or synthetic text, 0 to 256 printable characters); download must be last and requires path, expectedBytes and expectedSha256 for one existing snapshot PDF/ZIP up to 4 MiB; press requires key (ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Space, Enter, Escape, Tab, one lowercase letter a-z or one digit 0-9; no modifiers, chords or text) and accepts holdMs (integer 0 to 1000 milliseconds, default 100); assert-painted takes only action and locator.'],+ ['missing expectedText','assert-text needs expectedText: the exact visible text the element should show after the earlier steps (normalized, 1 to 256 characters). To check only that it is shown, use assert-visible.'],+ ['missing value','select-option and fill need value: the exact option value, or synthetic text of 0 to 256 printable characters.'],+ ['missing key','press needs key: ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Space, Enter, Escape, Tab, one lowercase letter a-z or one digit 0-9.'],['invalid CSS locator','Use one non-empty CSS selector of 1 to 256 printable characters, without Playwright engine prefixes or chaining.'],['invalid CSS locator exact','A CSS locator has no matching mode: omit exact or use exact:true.'],['invalid semantic locator','Use a supported role and its exact accessible name ({role, name}, exact:true optional), or a CSS selector ({selector}).'],@@ -374,7 +377,15 @@ const INPUT_HINTS = new Map([// per invalid step identifies all affected steps in a single bounded response.// This validates the same request; it never edits a plan or contacts Chromium.function inspectionStepProblem(step,index,count) {- const problem=(reason,field='')=>({reason,hint:`Step ${index+1} (steps[${index}]${field?'.'+field:''}): ${INPUT_HINTS.get(reason)}`});+ const problem=(reason,field='',hint=reason)=>({reason,hint:`Step ${index+1} (steps[${index}]${field?'.'+field:''}): ${INPUT_HINTS.get(hint)}`});+ // The usual slip names an action and its locator but leaves out the field the+ // action needs; name it rather than every action's rules (Workstation06,+ // 2026-10-27: assert-text without expectedText cost each run a checked call).+ if(exact(step,['action','locator'])) {+ if(step.action==='assert-text') return problem('invalid inspection step','expectedText','missing expectedText');+ if(['select-option','fill'].includes(step.action)) return problem('invalid inspection step','value','missing value');+ if(step.action==='press') return problem('invalid inspection step','key','missing key');+ }if(step && typeof step==='object' && !Array.isArray(step) && step.action!=='download' && Object.hasOwn(step,'path')) return problem('unsupported inspection navigation','path');if(!exact(step,['action','locator',...(step?.action==='assert-text'?['expectedText']:['select-option','fill'].includes(step?.action)?['value']:step?.action==='download'?downloadKeys:step?.action==='press'?pressKeys(step):[])]) || !['assert-visible','assert-hidden','assert-text','click','select-option','fill','download','press','assert-painted'].includes(step.action)) return problem('invalid inspection step');if(step.action==='download' && (index!==count-1 || !downloadValid(step))) return problem('invalid inspection step');diff --git a/ods/extensions/services/pixel-agent/tests/preview_inspection_input_recovery.test.mjs b/ods/extensions/services/pixel-agent/tests/preview_inspection_input_recovery.test.mjsindex 0bf509f56..7d0b445c3 100644--- a/ods/extensions/services/pixel-agent/tests/preview_inspection_input_recovery.test.mjs+++ b/ods/extensions/services/pixel-agent/tests/preview_inspection_input_recovery.test.mjs@@ -25,6 +25,22 @@ test('invalid inspection arguments never contact the broker or report it unavailassert.equal(calls,0);});+test('a step without the field its action needs names that field',async()=>{+ const tool=createWorkspacePreviewInspectTool({request:async()=>{throw Error('should not execute');}});+ for(const [step,hint] of [+ [{action:'assert-text',locator:{selector:'#moves'}},/Step 1 \(steps\[0\]\.expectedText\): assert-text needs expectedText.*use assert-visible\./],+ [{action:'fill',locator:{selector:'#name'}},/Step 1 \(steps\[0\]\.value\): select-option and fill need value/],+ [{action:'press',locator:{selector:'#game'}},/Step 1 \(steps\[0\]\.key\): press needs key/],+ ]) {+ const params=valid();params.steps=[step];+ const result=await tool.execute('missing-field',params);+ assert.equal(result.details.errorCode,'invalid_request');+ assert.match(result.content[0].text,hint);+ // Only the missing field, not every action's rules.+ assert.doesNotMatch(result.content[0].text,/download must be last/);+ }+});+test('valid input still distinguishes unavailable transport and cancellation',async()=>{let calls=0;const tool=createWorkspacePreviewInspectTool({request:async()=>{calls++;throw Error('not reachable');}});