Did German communists seek to immediately relinquish control over these territories or did they wish to extend their revolutionary government to the colonies?
While I can't comment on the exact plans and ideas representatives of the Social Democratic Party of Germany (SPD) held about the future of the colonial possessions of the German Empire, one can definitely attest a growing split about the general character of colonialism in history within the German Social Democrats around the 1900 mark - this split ran along the lines of an even bigger debate about socialism and the way forward for the socialist movement that was slowly seperating Marxists into different groups: A "revisionist" wing (at least that's what their inner-party opponents called them) most notably represented by Eduard Bernstein who among other things argued that no violent revolution was necessary for a transition to a socialist society which instead would be achievable through gradual reforms; opposed to that group, a wing of "orthodox Marxists" formed around persons like Karl Kautsky or Rosa Luxemburg.
Of course, seeing that internationalism was a lived reality for Social Democrats at the time, these conflicts weren't just confined to the Germany party of Social Democrats but instead openly discussed at meetings of the Second International - indeed, you can find accounts of how such conflicts (about the "colonial question") played out at these congresses by reading the reports several attendants later gave to the parties in their respective countries. One such attendant of the 7th International Socialist Congress held in Stuttgart 1907 (the only one ever being held in Germany) was one of the four represantives from Russia, none other than Lenin who described the discussion of the congresse's comittee on colonialims as follows:
This is not the first time the colonial question has figured at international congresses. Up till now their decisions have always been an unqualified condemnation of bourgeois colonial policy as a policy of plunder and violence. This time, however, the Congress Commission was so composed that opportunist elements, headed by Van Kol of Holland, predominated in it. A sentence was inserted in the draft resolution to the effect that the Congress did not in principle condemn all colonial policy, for under socialism colonial policy could play a civilising role. [...] The opportunists rallied behind Van Kol. Speaking for the majority of the German delegation Bernstein and David urged acceptance of a “socialist colonial policy” and fulminated against the radicals for their barren, negative attitude, their failure to appreciate the importance of reforms, their lack of a practical colonial programme, etc. Incidentally, they were opposed by Kautsky, who felt compelled to ask the Congress to pronounce against the majority of the German delegation.
As we can see, while Henri Van Kol (who himself had not only spent quite some time in the Dutch colony on Java but also ended up buying a coffee plantation) was the main speaker in favor of what he called "positive colonialism", both his primary supporters and opponents in that regard came from the German delegation, the biggest present at the congress. And as Lenin pointed out, the topic of colonialism wasn't new, esp. for the Social Democrats of Germany. Eduard Bernstein for example set out his view on the issue in his 1899 work titled "The Preconditions of Socialism", widely regarded as the first theoretical book on "Revisionist Marxism":
It is not inevitable that the occupation of tropical countries by Europeans should harm the natives in their enjoyment of life, nor has it usually been the case up till now. Moreover, we can recognise only a conditional right of savages to the land they occupy. Higher civilisation has ultimately a higher right. It is not conquest but the cultivation of the land that confers an historical right to its use.
Even at that point, Bernstein found himself in disagreement not just with Kautsky (who regarded any colonial policy as nothing else than capitalist policy) as mentioned by Lenin but also with the chairman of the Social Democratic Party, August Bebel, sometimes called the "Arbeiterkaiser" or "Worker's Kaiser". Bebel, often regarded as one the father figures of Social Democracy in Germany, had repeatedly denounced the colonial policies and aspirations of the German Empire (esp. under Wilhelm II.) throughout his parliamentary career in the Reichstag, e.g. in a speech January 26th, 1889:
Basically, the essence of all colonial policy is the exploitation of a foreign population in the highest potency. Wherever we look up the history of colonial policy in the last three centuries, everywhere we encounter violence and the oppression of the peoples concerned, which not infrequently ends with their complete extermination. And the driving motive is always to acquire gold, gold and again only gold. And in order to be able to carry on the exploitation of the African population to the fullest extent and as undisturbed as possible, millions are to be used from the pockets of the empire, from the pockets of the taxpayers, the East African Company is to be supported with the means of the empire, so that the exploitation business is secured for it. (translated with DeepL).
So in summary, the issue of a socialist perspective on colonialism was a topic of deep discussion and disagreement within the Social Democratic Party of Germany pre-WW1 - embedded in the larger line of conflict between the party's "right" wing of Revisionists around Bernsteind and "left" wing of Orthodox Marxists with Kautsky and Luxemburg was another factor for the eventual split of the Social Democratic Party over the question of supporting the German war effort in WW1. It should be noted though, that the positions weren't as black and white as this comment makes them out to be for the sake of contrast - Karl Kautsky, unlike Rosa Luxemburg, did not join other left-winger to form what would become the Communist Party of Germany. Kautsky will still have the last word of this reply, maybe being the first part actually answering the question set asked:
The idea of giving up the colonies voluntarily can, therefore, so long as the rule of capitalism continues, only function for us like a compass which shows us the direction in which our policy on the colonies must tend, and not as a practical proposal on whose immediate implementation we must work. Its main practical implication for us is that we cannot agree to any extension in colonial possessions, and that we must work zealously for an increase in the self government of the natives. The native uprisings to throw off foreign domination will be always certain of the sympathies of the fighting proletariat. But the armed might of the capitalist nations is so immense that it is not to be expected that any of these uprisings could come anywhere near their aim.
Sources:
Lenin Collected Works, Progress Publishers, 1972, Moscow, Volume 13, pages 75-81.
Bernstein, E. (1993). The tasks and opportunities of Social Democracy. In H. Tudor (Ed.), Bernstein: The Preconditions of Socialism (Cambridge Texts in the History of Political Thought, pp. 98-188). Cambridge: Cambridge University Press. doi:10.1017/CBO9780511802584.010
August Bebel's speech in front of the Reichstag on January 26nd 1889 (German)