Commit a93e36e
Fix: engine.agent propagates to threat detection job causing "No such agent" failure (#17949)
* Initial plan
* initial plan
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Fix: strip engine.agent from threat detection engine config
When engine.agent is set along with an explicit model, the
modelExplicitlyConfigured branch was assigning detectionEngineConfig
= engineConfig (a pointer copy), propagating the Agent field to the
threat detection job. The detection job has no repo checkout, so the
agent file can't be found, causing "No such agent" failures.
Fix: create a struct copy that excludes Agent in the
modelExplicitlyConfigured branch, matching the existing pattern in
the else-branch.
Add TestBuildEngineStepsStripsAgentField to verify --agent never
appears in detection steps for both code paths.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Simplify detection engine config to only inherit ID and Model
Per review feedback, the detection engine config should only carry
ID and Model — all other fields (Version, MaxTurns, Concurrency,
UserAgent, Env, Config, Args, Firewall, Agent) are intentionally
stripped. This collapses the two-branch logic into a single
minimal-copy pattern.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Also copy Version, Env, Config, Args into detection engine config
Per review feedback, the detection engine config now inherits ID,
Model, Version, Env, Config, and Args. MaxTurns, Concurrency,
UserAgent, Firewall, and Agent remain intentionally omitted.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Add changeset [skip-ci]
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: Codex <codex@localhost>1 parent b4d5106 commit a93e36e
8 files changed
Lines changed: 85 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
340 | 339 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
361 | 347 | | |
362 | 348 | | |
363 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
940 | 1002 | | |
941 | 1003 | | |
942 | 1004 | | |
| |||
0 commit comments