proposed fix:
gluon.main :
just after setting web2py-component-command, set a new web2py-component-origaction header = request.url
web2py.js :
in ajax_page, inside oncomplete, just before web2py.trap_form, handle it
var origaction = xhr.getresponseheader('web2py-component-origaction');
action = (typeof origaction != 'undefined') ? origaction : action;
and it works.
Just for completeness, same type of handling in updatePage to change the w2p_remote of the cid to web2py-component-origaction
Of course, this stands as long as there's really no method to extrapolate on the oncomplete callback the "final url" that has been loaded, in which case, no gluon.main changes necessary.