Excellent — yes, that’s exactly the right approach for taming argcomplete’s ambiguity:
wrap your completer in a small factory that inspects the parse state (parsed_args) and only delegates to the inner completer if it’s actually “safe” to do so.
Let’s go step-by-step and build that.
You can absolutely write something like: