Repository navigation
Commit 9d6a39d
fix(core): exempt media-policy targets from the bridge argument pre-check
resolveDeferredToolCall now pre-validates bridged arguments against the
target schema (#12889), but omni media-policy targets do not hold their
final arguments at that point: both frontends run evaluateMediaPolicyToolCall
AFTER bridge resolution (coreToolScheduler before buildInvocation, ACP
Session.runTool), and that gate is what resolves resourceId to inputPath and
merges defaultArguments/lockedArguments, while BaseMediaPolicyTool's
validateToolParams deliberately checks the NATIVE schema rather than the
model-visible projection tool_search returned.
So the pre-check refused calls the very next stage accepted. A bridged
{resourceId, outputDir} call — the shape omni/media-guidance.ts tells the
model to send — was refused with "provide exactly one of inputPath ... or
resourceId" even though resourceId was provided, and for path-less media the
model can never learn the real path, so it cannot repair the call. An
operator-pinned modelAccess.lockedArguments.outputDir was unwinnable both
ways: projectMediaPolicyToolDeclaration strips the locked key from the
model-visible properties AND required, so omitting it failed the pre-check
while sending it failed the gate. Each refusal fed
recordBatchRetryableToolError and gained RETRY_LOOP_STOP_DIRECTIVE, ending the
turn in LOOP_DETECTED / invalid_tool_params_stagnation on a call shape that
previously worked. All 14 omniPolicyToolFactories tools inherit the first
trigger; the 13 with a native required outputDir also reach the second.
Key the exemption off mediaPolicyDescriptor: the code-level fact the gate
itself keys off (it passes every non-policy tool through untouched), so the
exemption covers exactly the targets whose arguments a downstream stage
completes. Nothing fails open — the gate still emits named invalid_params
refusals before build(), and build() re-validates the merged arguments against
the native schema.
Acceptance test added to the existing #12889 block: a target whose
model-visible schema omits a key its validateToolParams requires (native
required: ['inputPath','outputDir'], projected required: []) resolves with
projection-satisfying arguments instead of being refused.
Co-authored-by: Qwen-Coder <[email protected]>
Patrol-Run: qwen-pr-closeout/jmul3pj9gc41 parent 1979183 commit 9d6a39d
2 files changed
Lines changed: 110 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
802 | 803 | | |
803 | 804 | | |
804 | 805 | | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
805 | 886 | | |
806 | 887 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
242 | 260 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
251 | 271 | | |
252 | 272 | | |
253 | 273 | | |
| |||
0 commit comments